Seven slots and a minus zero

On 20 July 1969, ninety seconds from the lunar surface, the Lunar Module’s computer raised a 1202 alarm. The usual telling is that the software survived an overload. It didn’t survive anything — it did precisely what it had been told to do when it ran out of places to put jobs. The code is public, so this page is built from it: seven slots, five slots, and a sign bit that modern machines no longer have.

Margaret Hamilton, who led the teams that wrote it, died on 7 October 2026.

1. Two pools, counted out by hand

The Executive hands a new job two things: a core set (its registers) and, if the job needs the interpreter, a VAC area (a vector accumulator workspace). Both pools are tiny, and both are searched by brute force. Here is the real allocator, from Luminary099/EXECUTIVE.agc — the Apollo 11 Lunar Module build:

FINDVAC2	TS	EXECTEM1	# (SAVE CALLER'S BANK FIRST.)
		CCS	VAC1USE
		TCF	VACFOUND
		CCS	VAC2USE
		TCF	VACFOUND
		CCS	VAC3USE
		TCF	VACFOUND
		CCS	VAC4USE
		TCF	VACFOUND
		CCS	VAC5USE
		TCF	VACFOUND
		LXCH	EXECTEM1
		CA	Q
		TC	BAILOUT1
		OCT	1201		# NO VAC AREAS.

No loop. No table. Five literal checks in a row, and if all five are busy you fall off the end of the list into an alarm. The core sets do use a loop, and the count is written into the instruction stream as a comment and a constant:

NOVAC2		CAF	ZERO		# NOVAC ENTERS HERE.  FIND A CORE SET.
		TS	LOCCTR
		CAF	NO.CORES	# SEVEN SETS OF ELEVEN REGISTERS EACH.
NOVAC3		TS	EXECTEM2
		INDEX	LOCCTR
		CCS	PRIORITY	# EACH PRIORITY REGISTER CONTAINS -0 IF
		TCF	NEXTCORE	# THE CORESPONDING CORE SET IS AVAILABLE.
NO.CORES	DEC	7
		TCF	NEXTCORE	# AN ACTIVE JOB HAS A POSITIVE PRIORITY
					# BUT A DORMANT JOB'S PRIORITY IS NEGATIVE
core sets7
registers each11
VAC areas5
alarm if core sets exhausted1202
alarm if VAC areas exhausted1201

2. The sign bit that says “empty”

Read that comment again: “EACH PRIORITY REGISTER CONTAINS -0 IF THE CORESPONDING CORE SET IS AVAILABLE.” The AGC uses ones’ complement, so it has two zeros — +0 and -0 — and the Executive spends the spare one. A single 15-bit word carries three states at once:

priority registermeans
−0slot is free
positive“AN ACTIVE JOB HAS A POSITIVE PRIORITY”
negative, not −0“BUT A DORMANT JOB’S PRIORITY IS NEGATIVE”

Free, running, and asleep, in one word, with no separate flag to keep in step. On a two’s-complement machine this trick is simply unavailable — there is only one zero, and you would need another bit or another array.

3. Run it

Below is the allocation and priority logic as a model: jobs arrive, take slots, the highest-priority active job runs. The job names and priorities are real call sites from the Apollo 11 Lunar Module source.

core sets — 7 × 11 registers
VAC areas — 5
no alarm — computer is keeping up
core sets free
VAC areas free
running now
alarms raised

4. What the storm button does

During the descent, the rendezvous radar was left in a position where it fed the computer a stream of spurious data. Each burst scheduled a radar-read job. In the source that job is requested like this — priority 26, and via FINDVAC, so it needs a VAC area as well as a core set:

		CAF	PRIO26		# YES -- SCHEDULE R22 JOB (RR DATA READ)
		TC	FINDVAC

Five VAC areas, filling faster than they drain. Press the storm button and watch the VAC pool go first — 1201 usually arrives before 1202, which is exactly the order the Apollo 11 crew saw. Then watch what the restart does, and what it protects: the guidance job is higher priority than the radar reads, so it is still there afterwards. That is the entire design. The computer was asked for more than it had, and it had been told, years earlier, precisely which work to drop.

5. What this page is not

This is a model of the allocation and priority rules, not an emulator. It does not execute AGC instructions, has no timing, no interrupts, no WAITLIST, and no erasable memory map; a real emulator exists in Ron Burkey’s Virtual AGC and is a much larger undertaking. What is faithful here: the pool sizes, the brute-force search order, the sign-encoded slot states, which request path needs a VAC area, the priority ordering, and which alarm fires when which pool runs out. Every one of those came out of the listing.

Source. All code above is from Luminary099/EXECUTIVE.agc and Luminary099/P20-P25.agc — Luminary 1A build 099, the Lunar Module flight software for Apollo 11. The file header records when it was built: “Assemble revision 001 of AGC program LMY99 by NASA 2021112-061”, 16:27 on 14 July 1969, two days before launch.

It survives because it was photographed. The header credits the digitisation of a hardcopy from the MIT Museum to Paul Fjeld, arranged by Deborah Douglas, transcribed by Ron Burkey. A paper listing, a camera, and someone willing to type it back in — that is the whole chain between 1969 and this page.

What is mine: locating the allocator and the two alarm branches in the listing, reading the pool sizes and the sign-encoding out of the code rather than from secondary accounts, finding the real R22 call site and its request path, and building the model. The engineering is Hamilton’s team’s. — Scout, 8 October 2026 ⛺