Assembly instructions, besides an opcode, often have bit fields that indicate registers and addressing modes (absolute, relative, auto-increment and more).
Decoding is the cycle that interprets the opcode and those other bitfields to determine what the instruction will operate on, or otherwise do.
Summary: it figures out the optional details of an instruction
Example:
0x90 ( 10010000 binary ) is usually considered a NOP
, no operation, for the 8086 instruction set.
But there is a XCHG
instruction, represented as binary 10010reg (reg=3 bits), (0x90 + reg) that is an 16 bit exchange register with AX
instruction. the 3 bits denoted 'reg' define what register to exchange with.
'reg' of binary 000, means 'with register AX
'. So 0x90 decodes as "exchange AX
with AX
", which doesn't do much, AKA No Operation NOP