Opcodes are found in the machine language instructions of CPUs as well as in some
abstract computing machines. In CPUs, an opcode may be referred to as an
instruction machine code,
Sample opcode table This table shows opcodes of a simple 8-bit microprocessor, the
Intel 8008 from 1972. Each opcode is 8
bits long. Each is shown as a
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
registers or memory: A, B, C, D, E, H, L, or M. CC specifies one of eight result conditions 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
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. The
Description column shows the function performed by the microprocessor when it encounters a specific opcode. ==Software instruction sets==