learn by doing
Guided labs
Small programs with a goal the machine checks for you — from the first OUT to hunting the one wrong instruction. Write, run, and get plain-word feedback until the check goes green; the narrator, the spec, and the playground have already taught you the pieces.
objective
The program starts with every register at 0. One value must travel out on the I/O channel: 42.
Two instructions to complete: MOV R1, value loads a constant into R1; OUT R1 sends it out.
hints
Predict the result
Five tiny programs with one question each. Type your prediction, then watch the machine — and the narrator — prove you right or wrong. The wraps, the jumps, and the loops behave exactly like the spec says.
Add three registers
MOV R1, 4
MOV R2, 5
ADD R1, R2
HALTWhat lands in R1?
One past the edge
MOV R1, 364
ADD R1, 1
HALTWhat lands in R1 after the wrap?
Does it overflow?
MOV R1, 364
MUL R1, R1
HALTDoes OVF get set?
The taken jump
CMP R0, R0
JEQ SKIP
MOV R1, 5
HALT
SKIP:
MOV R1, 7
HALTWhat lands in R1?
Countdown output
MOV R1, 3
TOP:
OUT R1
SUB R1, 1
CMP R1, 0
JGT TOP
HALTWhat is the second value sent out?
Random add
MOV R1, 11
MOV R2, 17
ADD R1, R2
HALTWhat lands in R1?
Random divide by 7
MOV R1, 22
MOV R2, 7
DIV R1, R2
HALTWhat lands in R1 after the division?
Random shift left
MOV R2, 24
SHL R1, R2
HALTWhat lands in R1 after the shift?