TC BANKCALL # TEMPORARY, I HOPE HOPE HOPE
July 12, 2016 11:54 AM   Subscribe

Margaret Hamilton's source code for Apollo 11 on Github! The extraordinary code from the original Apollo 11 guidance computer has been converted to .s files for syntax highlighting and posted to Github. The project was undertaken by Virtual AGC and the MIT Museum.

The code is a marvel of economy, using about 2 MB of precious computer memory (fwiw, I can't even *find* an SD card that has that little memory). Even though the programming language is unknown to me, the commenting and naming of the modules comes through loud and clear.

It includes modules with names like:
LUNAR_LANDING_GUIDANCE_EQUATIONS.s (from whence the post title comment"#TEMPORARY,I HOPE HOPE HOPE" comes), and
BURN_BABY_BURN--MASTER_IGNITION_ROUTINE.s , which incorporates the code:

TC NOULLAGE # TURN OFF ULLAGE ...
TC KILLTASK # DON'T LET IT COME ON, EITHER ...
CADR ULLGTASK
TC PHASCHNG # NOT EVEN IF THERE'S A RESTART.

via Paul Smith at Slate
posted by jasper411 (22 comments total) 61 users marked this as a favorite
 
Hmmm, now that I have this code, some old aluminum siding, an arduino and a couple of old paint cans I could fill with gasoline....
posted by BigHeartedGuy at 12:08 PM on July 12, 2016 [8 favorites]


Even though the programming language is unknown to me

It's assembly language for the Apollo Guidance Computer. If you'd like to dig in, here are the manuals.
posted by zamboni at 12:17 PM on July 12, 2016 [4 favorites]


The Latin quote at the head of the BURN_BABY_BURN file is (probably) a typo for noli me tangere, or “don’t touch me”. In the original Koine Greek it was Μή μου ἅπτου which better translates as “Cease holding on to me” according to Wikipedia. How very appropriate :)
posted by pharm at 12:18 PM on July 12, 2016 [2 favorites]


Before using this code, users should be aware that there is a potentially critical issue that the vendor has refused to fix.

Check continuity on O2 cryogenic tanks before allowing stir #3.
posted by fragmede at 12:20 PM on July 12, 2016 [11 favorites]




HONI SOIT QUI MAL Y PENSE

I'm totally sticking this at the top of all of my source files from now on.
posted by enn at 12:21 PM on July 12, 2016 [13 favorites]


One thing that will help you understand the source code is that it runs in a specific kind of multitasking environment in which a monitor (executive) lets scheduled tasks run for certain slices of time and abort or skip low-priority tasks, and even restart either unexpectedly or intentionally. (TC are the task control instructions). The Slate article mentions how Apollo 11 could land even though the computer was being flooded by bad data from a radar receiver that had been accidentally left on .... more detail on the linked ars technica article which explains it very well. Very smart design and somewhat visionary for the times I think?
If you're wondering how a bunch of early computer scientists and engineers from MIT and a newfangled computer ended up being far more central to the moon landing than people thought it would be, read David Mindell's "Digital Apollo"
posted by thefool at 12:23 PM on July 12, 2016 [12 favorites]


Peviously
posted by ChurchHatesTucker at 12:53 PM on July 12, 2016 [2 favorites]


Software which was deployed as hand-woven rope memory! (Not strictly speaking all Hamilton's code but she lead the project and developed reliability and software engineering concepts that - probably a lot more people should have used throughout the history of computing!)
posted by atoxyl at 1:01 PM on July 12, 2016


HONI SOIT QUI MAL Y PENSE

> I'm totally sticking this at the top of all of my source files from now on.


Yeah, I first came across this as the Sydney Uni student newspaper (really!) and just enjoyed a nostalgic trip down the Order of the Garter wiki pages.

Definitely worth including in all raw source, starting with tex files on arXiv.
posted by RedOrGreen at 1:21 PM on July 12, 2016 [1 favorite]


Hmmm, now that I have this code, some old aluminum siding, an arduino and a couple of old paint cans I could fill with gasoline....

Man, we could totally use a Salvage 1 reboot right about now.
posted by JoeZydeco at 1:35 PM on July 12, 2016 [4 favorites]


time for a Salvage1 reboot?

jinx!
posted by j_curiouser at 1:37 PM on July 12, 2016


developed reliability and software engineering concepts

I guess she's credited as one of the first people to use the term "software engineering" in fact.
posted by atoxyl at 2:10 PM on July 12, 2016 [1 favorite]


I guess she's credited as one of the first people to use the term "software engineering" in fact.

She is indeed.

Margaret needs her own FPP. Her work on Apollo was amazing, and she did it at the age of (gulp) 33.
posted by JoeZydeco at 2:12 PM on July 12, 2016 [4 favorites]


I love that on one hand there is some very solid, careful software engineering going on here, but at the same time they were able to be cheeky enough to do things like name the keypad I/O library PINBALL_GAME_BUTTONS_AND_LIGHTS. If I ever get Infinite Time, I'd love to read through this stuff for real.
posted by phooky at 4:02 PM on July 12, 2016 [3 favorites]


Amazing to be able to click around and actually get a feel for it. Knowing the factoids was always impressive, but it's easy to feel a bit like these people were mythical heroes doing mythical tasks. To trudge through enough to follow even one part makes the actual reality so much more visceral.

The data representation detailed in the manual is really interesting, if I'm understanding it right. Is it a sort of manual floating point?
posted by lucidium at 4:23 PM on July 12, 2016 [2 favorites]


...but at the same time they were able to be cheeky enough to do things like name the keypad I/O library PINBALL_GAME_BUTTONS_AND_LIGHTS

Wanna hear a funny story? The DSKY (the keyboard/display unit) and PINBALL (the program that talked to the DSKY) were demonstrations that found their way into the mission:
"Apparently, nobody had yet arrived at any kind of software requirements for the AGC's user interface when the desire arose within the Instrumentation Laboratory to set up a demo guidance-computer unit with which to impress visitors to the lab. Of course, this demo would have to do something, if it was going to be at all impressive, and to do something it would need some software. In short order, some of the coders threw together a demo program, inventing and using the verb/noun user-interface concept, but without any idea that the verb/noun concept would somehow survive into the flight software. As time passed, and more and more people became familiar with the demo, nobody got around to inventing an improvement for the user interface, so the coders simply built it into the flight software without any specific requirements to do so."
posted by JoeZydeco at 7:25 PM on July 12, 2016 [6 favorites]


One thing to note:
a marvel of economy, using about 2 MB of precious computer memory
The AGS programmers would've killed for that much memory, though it would've been too heavy to launch. The entire AGS had 36 kwords (about 74 kilobytes) of ROM and 2 kwords (4 kilobytes) of RAM.

(The Saturn launch computer that rode along just long enough to get the thing into earth orbit insertion had another ~106 kbytes of code space.)

I've written code for processors with just a couplefew kB of ROM. It's always a super-fun exercise in economy.
posted by introp at 7:31 PM on July 12, 2016


The data representation detailed in the manual is really interesting, if I'm understanding it right. Is it a sort of manual floating point?
It looks like very traditional fixed-point math (still used in tons of control and signal processing today). That is, the software keeps track of the position of the decimal point.
posted by introp at 7:34 PM on July 12, 2016


My favourite comments:
ASTRONAUT: PLEASE CRANK THE SILLY THING AROUND

SEE IF HE'S LYING

OFF TO SEE THE WIZARD...
posted by wwwwolf at 8:14 AM on July 13, 2016 [1 favorite]


If you want a hard copy, there is apparently one left. Must've been some kinda party!
posted by MoTLD at 11:21 AM on July 13, 2016


The woven rope memory was unofficially called LOL memory - for 'little old lady', based on the people who'd been recruited for having the right skills to knit it together.

Also, I once wrote a multitasking executive for a networked file server, in the days before open source, where I stole the VERB/NOUN idea to describe the command/data model for the primitives the executive was handling (basically coping with low level disk and network buffer management). I thought it was cool, it was actually a good match to the problem, and I wanted a unique nomenclature to avoid ambiguity with the other uses of command/instruction/data in the system. From this I discovered that my fellow programmers, who were building the higher-level functions, didn't understand the difference between verbs and nouns.

(I also now realise I was ripping off Apollo only about fifteen years after the last time the code was run in anger, which is not entirely a good feeling.)
posted by Devonian at 4:55 PM on July 13, 2016


« Older Allegiance   |   Inside the World's Chicest Cult Newer »


This thread has been archived and is closed to new comments