A Moon Mission Hiding in Two Binders
Here’s a startling truth: the code that landed humans on the Moon in 1969 still exists, meticulously transcribed from two paper binders preserved at the MIT Museum. Volunteers painstakingly converted these historical scans into a usable digital codebase, now publicly accessible and runnable. It’s a testament to preservation and collaborative effort.
This isn't a lone genius narrative. Margaret Hamilton, then a pioneering computer scientist, led the Software Engineering Division at the MIT Instrumentation Laboratoryoratory. Her team of over 400 people developed the critical software for both the Apollo command and lunar modules. Hamilton’s leadership and the sheer scale of the effort underscore the collective brilliance behind Apollo.
Written in assembly language for Apollo Guidance Computer, this surviving source code can be assembled to perfectly match the original memory image. Enthusiasts can even run it through the Virtual AGC emulator, experiencing the exact sequences the Apollo 11 astronauts executed. This allows unprecedented insight into the rigorous, constrained world of early spaceflight software.
The Computer Had Less Memory Than a Tweet
Moon missions ran on hardware less powerful than a modern thermostat. The Apollo Guidance Computer (AGC), built at MIT’s Instrumentation Laboratoryoratory, operated at a mere 1.024 MHz, with just 2,048 words of erasable memory—roughly 3,840 bytes. A modern Raspberry Pi Pico, by comparison, boasts 70 times the RAM and a clock 130 times faster.
Constraints defined the AGC. Its 72 KB of read-only memory relied on core rope memory, a marvel of physical programming. Wires threaded through tiny magnetic cores encoded the software directly: a wire through a ring signaled a binary ‘1,’ around it a ‘0.’ This meant no quick software patches; flight code was literally woven into the hardware, locked in months before launch.
Such limitations forced brilliant design. Engineers crafted exceptionally compact code, rigorously verified for perfection. The AGC’s Executive scheduler prioritized tasks, handling up to eight jobs in 12-word slots. Even the code’s internal comments, as a look at the transcribed GitHub repository reveals, sometimes diverged from the implemented logic, a testament to the rapid, iterative development under extreme pressure.
The Code Has Jokes. The Safeguards Mean Business.
Humor, it turns out, is a universal constant, even in code destined for the Moon. Despite the immense pressure, the engineers at MIT’s Instrumentation Laboratoryoratory peppered Apollo Guidance Computer’s assembly with delightful, humanizing comments. “Please crank this silly thing around” instructs the astronaut to move the landing radar antenna, while “Off to see the wizard” precedes the engine ignition sequence, playfully titled “Burn Baby Burn.”
Astronauts interacted with this complex system via the DSKY (Display/Keyboard), a minimalist interface of a small numeric keypad and display. Commands were concise, numeric verb-and-noun pairs—a “verb” for the action (e.g., display) and a “noun” for the object (e.g., clock). These rehearsed instructions, often memorized or referenced from checklists, were the only way to operate the computer in flight.
Yet, beneath the wit lay ironclad resilience. Apollo Guidance Computer’s Executive scheduler prioritized tasks, ensuring critical guidance functions always ran. When systems overloaded, as happened during Apollo 11’s descent due to a faulty rendezvous radar, less important tasks were shed, triggering alarms like 1202.
Crucially, restart checkpoints protected vital work. If the computer rebooted, it picked up essential processes from the last checkpoint, even restarting the descent engine. This robust design allowed the computer to manage faults without abandoning the mission, a testament to foresight under extreme constraint. For those curious to explore this blend of rigor and humor, the Original Apollo 11 Guidance Computer (AGC) Source Code is publicly available.
Enjoying this? Get one like it in your inbox each morning.
one email a day · unsubscribe in two clicks · no third-party tracking
Why 1202 Didn’t End the Landing
The 1202 alarm, infamous from the Apollo 11 landing, signaled a desperate fight for processor time. As the Lunar Module descended, the rendezvous radar unexpectedly consumed 13-15% of the computer’s cycles by firing 12,800 pulses per second. This activity, combined with the already 90% utilized processor, prevented critical navigation tasks from completing on schedule.
Apollo Guidance Computer’s (AGC) Executive, its scheduler, could only manage eight job slots, each 12 words long. When the navigation task failed to finish, new copies queued, rapidly filling these slots and triggering the 1202 alarm. The AGC responded by discarding unprotected work and restarting, prioritizing essential descent functions. Flight controllers, notably Steve Bales, had to quickly assess if the landing could continue, a decision made five times during the final minutes.
This resilience wasn't accidental. Margaret Hamilton's team at the MIT Instrumentation Laboratoryoratory engineered the AGC with robust restart protection, allowing it to resume critical operations even mid-descent. Checkpoints throughout the code ensured that vital tasks, like the descent engine, could be reactivated immediately.
Today, the AGC’s brilliance is inspectable. The Virtual AGC project faithfully emulates the computer and its Display and Keyboard (DSKY) interface, allowing anyone to run the Apollo 11 flight code. You can explore the exact sequences astronauts used, from pre-launch checks to the landing alarms, at the Apollo 11 AGC repository. As Hamilton observed, her team faced "no second chance," but their code gives us endless opportunities to learn.
Frequently Asked Questions
Can you run the original Apollo 11 source code today?
Yes. The transcribed source code can be assembled and run in the open-source Virtual AGC emulator.
How much memory did the Apollo Guidance Computer have?
It had 2,048 words of erasable memory, roughly 3,840 bytes, plus fixed read-only core rope memory.
What caused the 1202 alarm during Apollo 11’s landing?
Radar pulses consumed processor time, overloading the scheduler’s limited job slots. The computer discarded lower-priority work and restarted protected tasks.
Who was Margaret Hamilton?
Hamilton was a software leader on Apollo at MIT’s Instrumentation Laboratory and helped develop the software that guided the crewed missions.

