The code that took America to the moon was just published to GitHub, and it’s like a 1960s time capsule
Keith Collins / TIME
When programmers at the MIT Instrumentation Laboratory set out to develop the flight software for the Apollo 11 space program in the mid-1960s, the necessary technology did not exist. They had to invent it.
They came up with a new way to store computer programs, called “rope memory,” and created a special version of the assembly programming language.
Assembly itself is obscure to many of today’s programmers—it’s very difficult to read, intended to be easily understood by computers, not humans. For the Apollo Guidance Computer (AGC), MIT programmers wrote thousands of lines of that esoteric code.
Here’s a very 1960s data visualization of just how much code they wrote—this is Margaret Hamilton, director of software engineering for the project, standing next to a stack of paper containing the software:
The AGC code has been available to the public for quite a while–it was first uploaded by tech researcher Ron Burkey in 2003, after he’d transcribed it from scanned images of the original hardcopies MIT had put online. That is, he manually typed out each line, one by one.
“It was scanned by a airplane pilot named Gary Neff in Colorado,” Burkey said in an email. “MIT got hold of the scans and put them online in the form of page images, which unfortunately had been mutilated in the process to the point of being unreadable in places.” Burkey reconstructed the unreadable parts, he said, using his engineering skills to fill in the blanks.
“Quite a bit later, I managed to get some replacement scans from Gary Neff for the unreadable parts and fortunately found out that the parts I filled in were 100% correct!” he said.
The effort made the code available to any researcher or hobbyist who wanted to explore it. Burkey himself even used the software to create a simulation of the AGC:
As enormous and successful as Burkey’s project has been, however, the code itself remained somewhat obscure to many of today’s software developers. That was until last Thursday (July 7), when former NASA intern Chris Garry uploaded the software in its entirety to GitHub, the code-sharing site where millions of programmers hang out these days.
Within hours, coders began dissecting the software, particularly looking at the code comments the AGC’s original programmers had written. In programming, comments are plain-English descriptions of what task is being performed at a given point. But as the always-sharp joke detectives in Reddit’s r/ProgrammerHumor section found, many of the comments in the AGC code go beyond boring explanations of the software itself. They’re full of light-hearted jokes and messages, and very 1960s references.
One of the source code files, for example, is called BURN_BABY_BURN–MASTER_IGNITION_ROUTINE, and the opening comments explain why:
## At the get-together of the AGC developers celebrating the 40th anniversary
## of the first moonwalk, Don Eyles (one of the authors of this routine along
## with Peter Adler) has related to us a little interesting history behind the
## naming of the routine.
## It traces back to 1965 and the Los Angeles riots, and was inspired
## by disc jockey extraordinaire and radio station owner Magnificent Montague.
## Magnificent Montague used the phrase “Burn, baby! BURN!” when spinning the
## hottest new records. Magnificent Montague was the charismatic voice of
## soul music in Chicago, New York, and Los Angeles from the mid-1950s to
## the mid-1960s.
About 900 lines into that subroutine, a reader can see the playfulness of the original programming team come through, in the first and last comments in this block of code:
P40AUTO TC MAKECADR # HELLO THERE.
TS TEMPR60 # FOR GENERALIZED RETURN TO OTHER BANKS.
P40A/P TC BANKCALL # SUBROUTINE TO CHECK PGNCS CONTROL
CADR G+N,AUTO # AND AUTO STABILIZATION MODES
CCS A # +0 INDICATES IN PGNCS, IN AUTO
TCF TURNITON # + INDICATES NOT IN PGNCS AND/OR AUTO
CAF APSFLBIT # ARE WE ON THE DESCENT STAGE?
TCF GOBACK # RETURN
CAF BIT5 # YES, CHECK FOR AUTO-THROTTLE MODE
BZF GOBACK # IN AUTO-THROTTLE MODE — RETURN
TURNITON CAF P40A/PMD # DISPLAYS V50N25 R1=203 PLEASE PERFORM
TC BANKCALL # CHECKLIST 203 TURN ON PGNCS ETC.
TCF GOTOP00H # V34E TERMINATE
TCF P40A/P # RECYCLE
GOBACK CA TEMPR60
TC BANKJUMP # GOODBYE. COME AGAIN SOON.
In the file called :
LUNAR_LANDING_GUIDANCE_EQUATIONS.s, it appears that two lines of code meant to be temporary ended up being permanent, against the hopes of one programmer:
TC BANKCALL # TEMPORARY, I HOPE HOPE HOPE
CADR STOPRATE # TEMPORARY, I HOPE HOPE HOPE
In the same file, there’s also code that appears to instruct an astronaut to “crank the silly thing around.”
CAF CODE500 # ASTRONAUT: PLEASE CRANK THE
TC BANKCALL # SILLY THING AROUND
TCF GOTOP00H # TERMINATE
TCF P63SPOT3 # PROCEED SEE IF HE’S LYING
P63SPOT4 TC BANKCALL # ENTER INITIALIZE LANDING RADAR
TC POSTJUMP # OFF TO SEE THE WIZARD …
“That code is all about positioning the antenna for the LR (landing radar),” Burkey explained. “I presume that it’s displaying a code to warn the astronaut to reposition it.”
And in the PINBALL_GAME_BUTTONS_AND_LIGHTS.s file, which is described as “the keyboard and display system program … exchanged between the AGC and the computer operator,” there’s a peculiar Shakespeare quote:
# THE FOLLOWING QUOTATION IS PROVIDED THROUGH THE COURTESY OF THE AUTHORS.
# “IT WILL BE PROVED TO THY FACE THAT THOU HAST MEN ABOUT THEE THAT
# USUALLY TALK OF A NOUN AND A VERB, AND SUCH ABOMINABLE WORDS AS NO
# CHRISTIAN EAR CAN ENDURE TO HEAR.”
# HENRY 6, ACT 2, SCENE 4
This is likely a reference to the AGC programming language itself, as one Reddit user pointed out. The language used predetermined “nouns” and “verbs” to execute operations. The verb 37, for example, means “Run program,” while the noun 33 means “Time to ignition.”
Now that the code is on GitHub, programmers can actually suggest changes and file issues. And, of course, they have.