Content deleted Content added
→Sample opcode table: Combined paragraphs |
m →Sample opcode table: Bold the "operand" name to match the other paragraphs |
||
(7 intermediate revisions by 3 users not shown) | |||
Line 7:
Opcodes are found in the machine language instructions of CPUs as well as in some [[virtual machine#Process virtual machines|abstract computing machines]]. In CPUs, an opcode may be referred to as an '''instruction machine code''',<ref name="Intel_1973_MCS-4"/> '''instruction code''',<ref name="Intel_1974_MCS-40"/> '''instruction syllable''',<ref name="Jones_1988_CISC"/><ref name="Domagała_2012"/><ref name="Smotherman_2013"/><ref name="Jones_2016_CISC"/> '''instruction parcel,''' or '''opstring'''.<ref name="Schulman_2005"/><ref name="Chiba_2007"/> For any particular processor (which may be a general CPU or a more specialized processing unit), the opcodes are defined by the processor's [[instruction set architecture]] (ISA).<ref name="Hennessy_2017"/> They can be described using an [[opcode table]]. The types of operations may include [[arithmetic]], data copying, [[logical operation]]s, program control, and special instructions (e.g., [[CPUID]]).<ref name="Hennessy_2017"/>
In addition to the opcode, many instructions specify the data (known as [[operand]]s) the operation will act upon, although some instructions may have implicit operands or none.<ref name="Hennessy_2017"/> Some instruction sets have nearly uniform fields for opcode and operand specifiers, whereas others (e.g., [[x86]] architecture) have a less uniform, variable-length structure.<ref name="Hennessy_2017"/><ref name="Mansfield_1983"/> Instruction sets can be extended through [[opcode
===Sample opcode table===
Line 14:
Each opcode is 8 [[bit]]s long. Each is shown as a [[Binary number|binary]] pattern of ones and zeros in the '''Opcode''' column. Up to two additional fields may be embedded into the opcode. Some 3-bit fields are labeled DDD, SSS, CC, and ALU. The SSS (source) and DDD (destination) fields specify one of the eight possible 8008 [[Processor register|registers]] or memory: A, B, C, D, E, H, L, or M. CC specifies a condition that will activate certain JMP, CAL, and RET instructions. ALU specifies one of a possible eight [[arithmetic logic unit]] functions to be performed during an instruction, specifically, add, add with carry, subtract, subtract with borrow, logical AND, logical XOR, logical OR, and compare. The '''X''' in some fields means that either a 1 or 0 can be inserted with [[Don't-care term|no effect]].
The fixed ones and zeros are combined with the parameter fields to build the 8-bit opcode. Additionally, the full instruction might require one or two additional bytes of operands. These are shown in the second major column of the table, labeled '''Operands'''. If no operands are required, the column is filled with a dash (—).
Since the ones and zeros are difficult to remember, the '''Mnemonic''' column shows a short, easy to remember letter code that an [[assembly language]] programmer may use to invoke the required opcode.
Line 93:
=={{Anchor|SIS}}Software instruction sets==
Opcodes can be found in
==See also==
|