Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Machine code
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Lowest level instructions executed by a computer}} {{for|code that is completely internal to some CPUs and normally inaccessible to programmers|Microcode}} {{redirect|Native code|the French colonial legal system|Native code (France)}} {{use dmy dates|date=December 2021|cs1-dates=y}} {{use list-defined references|date=December 2021}} [[File:W65C816S Machine Code Monitor.jpeg|thumb|upright=1.35|Machine language monitor running on a [[W65C816S]] [[microprocessor]], displaying [[disassembler|code disassembly]] and [[Core dump|dumps]] of processor register and memory]] {{Program execution}} In [[computer programming]], '''machine code''' is [[computer program|computer code]] consisting of '''machine language''' [[instruction set architecture|instructions]], which are used to control a computer's [[central processing unit]] (CPU). For conventional [[binary number|binary computer]]s, machine code is the binary<ref group=nb>On nonbinary machines it is, e.g., a decimal representation.</ref> representation of a computer program that is actually read and interpreted by the computer. A program in machine code consists of a sequence of machine instructions (possibly interspersed with data).<ref name="Stallings_2015"/> Each machine code instruction causes the CPU to perform a specific task. Examples of such tasks include: # Load a [[Word (computer architecture)|word]] from [[Random-access memory|memory]] to a [[Processor register|CPU register]] # Execute an [[arithmetic logic unit]] (ALU) operation on one or more registers or memory locations # [[jump instruction|Jump]] or [[Addressing mode#Skip|skip]] to an instruction that is not the next one In general, each architecture family (e.g., [[x86]], [[ARM architecture family|ARM]]) has its own [[instruction set architecture]] (ISA), and hence its own specific machine code language. There are exceptions, such as the [[VAX]] architecture, which includes optional support of the [[PDP-11]] instruction set; the [[IA-64]] architecture, which includes optional support of the [[IA-32]] instruction set; and the [[PowerPC 600#PowerPC 615|PowerPC 615]] microprocessor, which can natively process both [[PowerPC]] and x86 instruction sets. Machine code is a strictly numerical language, and it is the lowest-level interface to the CPU intended for a programmer. [[Assembly language]] provides a direct map between the numerical machine code and a human-readable mnemonic. In assembly, numerical [[opcode]]s and operands are replaced with mnemonics and labels. For example, the [[x86]] architecture has available the 0x90 opcode; it is represented as [[NOP (code)|NOP]] in the assembly [[source code]]. While it is possible to write programs directly in machine code, managing individual bits and calculating numerical [[memory address|addresses]] is tedious and error-prone. Therefore, programs are rarely written directly in machine code. However, an existing machine code program may be edited if the assembly source code is not available. The majority of programs today are written in a [[high-level programming language|high-level language]]. A high-level program may be translated into machine code by a [[compiler]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)