Two pages of the notebook are not a program listing. They are six programs compiled by hand into raw ROM addresses, five nibbles to a line, with the mnemonics inked in beside them — an attempt at a faster Space Chase, written out on ruled paper in about 1989. Nothing on this page runs. It is here to be read.
The nibbles are stored least significant first, so the page is
unreadable until you turn each cell round. A8000 reversed is
0008A, which is 138 — and 138 is exactly the number written
beside it. That one fact decodes the whole document.
Every cell is either an address — a pointer to a routine in the calculator's ROM, run in sequence — or a number sitting inline. The button switches between the two readings.
A number like 548 needs two cells: 11920 to say “a number
follows”, then the number itself. But 1, 3, 8 and 9 each get a single cell —
they are pointers to constants already sitting in ROM. Reverse those four
addresses and they land in a straight line, ten nibbles apart:
So the small integers live in one contiguous table, each entry ten nibbles long, and referring to one costs a single pointer. Nobody wrote that down. The addresses say it on their own.
The same cell, A4020, is crossed through on UP, DOWN, LEFT
and RIGHT, with CD570 written in the left margin beside each
one. The mnemonic DUP is left standing, so the operation did not
change — the address did. A4020 is used unstruck on page 6, so
whatever went wrong, it went wrong only here. That is a revision caught
mid-flight and I cannot tell you what prompted it.
LEFT assembles to DUP 9 548 SUB SWAP 1 8 SUB + and RIGHT to
DUP 540 548 SUB SWAP 1 539 SUB + — a rotation of eight bytes one
way and nine the other. The version Selden printed in 1990 is symmetric at
six each way. The hand-assembly follows the notebook exactly, one cell per
token, which puts it on the earlier of the two versions.
Between 8 ROLL and DUP 9 ROLLD sit four cells
that are not an address at all. Read as a name object — prologue, then a
length, then characters, all low nibble first — they say:
A global called RIGHT, sitting in the middle of the collision test, where there is no role for it and where the routine reads perfectly well without it. It is transcribed here and left unexplained rather than quietly dropped.
CH1 is the frame and the collision test from SPACE, with one change: the
starfield is dug out of the stack with 8 ROLL and pushed back
with 9 ROLLD instead of being recalled from a global every
frame. We decided a variable lookup per frame was the thing worth removing,
and then hand-compiled six programs into ROM addresses to get rid of it.