An Instruction Remembers an Address, Not a Number
Before level 28 the game offers a short interactive intro: three toggles set an address, and a lamp shows what lies in that memory cell. This page tells the same story in text.
Experiment: peek into a cell
Here is random-access memory. Three toggles set a cell number — from 0 to 7 — and the Data lamp shows the contents. Cells 2, 3, 4, 5 and 6 hold the numbers 1, 2, 4, 8 and 15 in advance. Set address 2 — the lamp shows 1; address 6 — it shows 15. The lamp shows what lies inside the cell, not its number.
Predict: what SUB 1 subtracts
The program contains a SUB 1 instruction. Does it subtract one? No. SUB cannot read a number straight from the instruction: an arbitrary number does not fit into the four bits of an operand, so SUB treats the operand as a cell address. SUB 1 subtracts whatever lies in cell RAM[1] — and that could be anything.
The rule: the operand is an address
The SUB N and AND N instructions read cell RAM[N]; only LDA loads the number itself from its operand. That is why the numbers a program needs all the time are placed into memory in advance: LDA 1 loads a one into the accumulator, STA 2 stores it into cell RAM[2] — and from then on SUB 2 subtracts exactly that. Such pre-written numbers are called constants.
Where it is used
On level 28 the program decodes the gamepad buttons with the bit masks 1, 2, 4 and 8, while the mask 15 clips coordinates at the screen edge. The level boilerplate writes these five constants into cells RAM[2]…RAM[6] before the main loop starts — and from then on the AND and SUB instructions read them from memory on every step.