Bit-Manipulation Laboratory
Write assembly instructions, run them one step at a time, and watch every register change bit by bit. Each step shows the exact 8-bit result, the bits that changed and the status flags the instruction set.
Watch it before you run it
The coach calls the play
How one coaching instruction becomes a 16-bit word the machine can run
Tactics board · the coach's call
Machine · instruction format
Coach · Kick-off, the playbook is on the bench
The squad has not learned the playbook by heart. Every play sits in the book until the coach calls it, and only the called play is ever used.
Machine · Stored program concept
Instructions and data both sit in main memory as binary. The processor holds no instructions of its own until one is fetched, which is why the same CPU can run any program.
Every word shown here is 16 bits: opcode in the top eight, operand in the bottom eight. Click a step to jump straight to it.
Program
One instruction per line · values as 12, 0x0C or 0b00001100 · comments start with ;
OR with a mask forces the masked bits to 1 and leaves every other bit alone.
Experiments
Try these in the lab
Instruction set
The subset of the 9618 assembly language this laboratory executes.
LDI R0, 0b10101010
MOV R1, R0
AND R0, 0b00001111
OR R0, 0b00001111
XOR R0, 0b00001111 · also written EOR
NOT R0
LSL R0, 2
LSR R0, 2
ADD R0, 1
SUB R0, 1
INC R0
DEC R0
CMP R0, 0b00100000
END
Registers · 8-bit
click a bit to flip it
Status register
Execution trace
0 steps
Press Step to execute the first instruction. Each entry shows the instruction, the binary result and the registers it changed.
Trace table
One row per executed instruction · click any row to rewind the machine to that step
Press Play or Step and every instruction will appear here as a row, with the full register state after it runs.