Interactive explainer: CPU instruction operands, source vs destination, DEC example, and state transition model

Anatomy of an instruction

DEC opcode what to do
RAX destination operand encoded as register index
DEC has one operand — the destination.
The CPU reads from it, subtracts 1, writes back.
The operand is selected by register index, not by value.

Click a register — DEC will target it

Set pre-state value 0x000000000000000A

State transition: pre → DEC → post

Pre-state (before DEC)
DEC RAX
Post-state (after DEC)