Source code for the Apollo 11 Guidance Computer
ibiblio.org
ibiblio.org
ALARM_AND_ABORT.agc - http://www.ibiblio.org/apollo/listings/Comanche055/ALARM_AND...
TC WHIMPER -1 # YES. DON'T DO POODOO. DO BAILOUT.
From the Guidance Computer Data Cards -http://www.ibiblio.org/apollo/CMC_data_cards_15_Fabrizio_Ber..."POODOO abort, does software restart (ENEMA) and "GO TO POOH" (flashing Verb 37) unless "AVERAGE G" is running then only software restart"
From THE_LUNAR_LANDING.agc - http://www.ibiblio.org/apollo/listings/Luminary099/THE_LUNAR...
033911,000064: 32,3017 06037 FLAGORGY TC INTPRET # DIONYSIAN FLAG WAVING
034090,000243: 32,3241 13247 BZF P63SPOT4 # BRANCH IF ANTENNA ALREADY IN POSITION 1
034091,000244:
034092,000245: 32,3242 33254 CAF CODE500 # ASTRONAUT: PLEASE CRANK THE
034093,000246: 32,3243 04616 TC BANKCALL # SILLY THING AROUND
034094,000247: 32,3244 20623 CADR GOPERF1
034095,000248: 32,3245 16001 TCF GOTOP00H # TERMINATE
034096,000249: 32,3246 13235 TCF P63SPOT3 # PROCEED SEE IF HE'S LYING
034101,000254: 32,3251 04635 TC POSTJUMP # OFF TO SEE THE WIZARD ...
034102,000255: 32,3252 74126 CADR BURNBABYAt 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.
Edit: see subthread below.
To me, the appeal of the original link was that, with one click, I could see the entire annotated-with-original-comments source of any part of the AGC. That was really exciting. A simulator (to me at least) is a lot less interesting ... and it's certainly an objectively very different kind of thing. (I for one wouldn't have even bothered clicking the current headline if I hadn't been looking for the original post's comments, which I had seen earlier.)
I'm not against curation in general -- it's a crucial aspect of HN, perhaps the crucial aspect. But I do think this particular case was a bit odd.
http://www.ibiblio.org/apollo/
There's some more information here: http://googlecode.blogspot.co.uk/2009/07/apollo-11-missions-...
By the way, last night I read the radio transcript from the time Neil and Buzz exited the lunar module: http://www.hq.nasa.gov/alsj/a11/a11.step.html (that site has loads of other Apollo transcripts too). It's annotated and has links to pics and videos. Fascinating.
I've read that one of the problems a new moon-or-beyond space program would have is that we are so far removed from the Apollo program that all institutional knowledge that was gained is gone because most of the engineers on those projects have passed away.
What I meant is described in slightly more detail at http://arstechnica.com/science/2013/04/how-nasa-brought-the-... , in the section "3D printing goes to space"
> Using state of the art manufacturing processes where possible actually reduces cost—even if a newer manufacturing method is more expensive, the cost reductions gained from the design simplifications more than tip the scales. In particular, Dynetics and PWR are using techniques like selective laser melting and hot isostatic pressing (HIP) to "grow" entire complex engine parts out of metal powders. The Dynetics team is focusing as much as possible on reducing welds and joins, and therefore reducing assembly and manufacturing.
'NASA engineer here. I think it's actually kind of ludicrous to claim that we have somehow "lost" the technology of the Apollo program.'
Edit: persuaded to change it back. See https://news.ycombinator.com/item?id=8066666.
TC BANKCALL # TEMPORARY, I HOPE HOPE HOPE
CADR STOPRATE # TEMPORARY, I HOPE HOPE HOPEDescriptions of instructions, opcodes, number encoding, etc
That's my wife's boss; the source material is still sitting on my wife's desk!
Those error codes mean "No VAC Areas" and "No Core Sets", respectively. Core sets were the basic task control blocks, including each task's entry point, priority, flags, some memory for temporary variables, and a few other things. VAC (Vector Accumulator) areas were a bit more interesting. Most of the real guidance code was not actually written in AGC assembly because it was so primitive and limiting. So, they created the "Interpreter" (INTERPRETER.agc) that's essentially a little virtual machine, that had its own assembly language (complete with mathematical and vector operations). Interpreted tasks needed more than the 7 words of temporary variables provided by the core sets, so they also allocated these VAC areas for more storage.
Those error codes showed up on Apollo 11 because of a weird electrical power phasing bug, essentially causing the radar to generate thousands of "interrupts" (actually cycle stealing operations) every second. With all of this additional work, the AGC didn't have enough time to finish its low priority tasks. And since those tasks hadn't exited by the time they were expected to, when the executive attempted to kick off new tasks, it found that no core sets or VAC areas were available, and sounded those program alarms.
http://www.dailykos.com/story/2012/08/25/1124164/-Neil-Armst...
# IDLING AND COMPUTER ACTIVITY (GREEN) LIGHT MAINTENANCE. THE IDLING ROUTIEN IS NOT A JOB IN ITSELF,
# BUT RATHER A SUBROUTINE OF THE EXECUTIVE.
I'm cursed to see spelling errors immediately, and obvious bugs only after hours of frustration.
>Filename: PINBALL_GAME_BUTTONS_AND_LIGHTS.agc
Can someone explain what this is? I doubt they had an actual game of pinball in their guidance computer.
# THE KEYBOARD AND DISPLAY SYSTEM PROGRAM OPERATES UNDER EXECUTIVE
# CONTROL AND PROCESSES INFORMATION EXCHANGED BETWEEN THE AGC AND THE
# COMPUTER OPERATOR. THE INPUTS TO THE PROGRAM ARE FROM THE KEYBOARD,
# FROM INTERNAL PROGRAM, AND FROM THE UPLINK.
I think it's just someone with a sense of humor.
Yeah I think that's the only explanation for it literally saying "GAME".
"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."[1]
https://en.wikipedia.org/wiki/Apollo_Guidance_Computer#Softw...
A set of interrupt-driven user interface routines called Pinball provided keyboard and
display services for the jobs and tasks running on the AGC. A rich set of user-accessible
routines were provided to let the operator (astronaut) display the contents of various
memory locations in octal or decimal in groups of 1, 2, or 3 registers at a time.
Monitor routines were provided so the operator could initiate a task to
periodically redisplay the contents of certain memory locations. Jobs could be
initiated. The Pinball routines performed the (very rough) equivalent of the
UNIX shell.This is well commented code, for assembly.
We should encourage software to be written as if it will one day fly in space.
Maybe that is too much, causing those writing the next "date finding" app to feel incompetent after reading this.
But at least we will know we are standing on shoulders of giants.
https://github.com/search?l=c&q=%22PROBABLY+UNNECESSARY%22&r...
However, these LoC have been written almost 50 years ago! That's truly fascinating.
http://www.ibiblio.org/apollo/listings/Comanche055/AUTOMATIC...
- Today's processors and capabilities run circles around those of the Apollo. It might be interesting to know how they calculate a square root, not today.
- They have more sensors and inputs and have to think of new and advanced ways of making it all work together
This source code, for example, contains the very first Kalman filter ever used - Kalman was invited over to Moffett field to give talks about his paper, which led to his theory was used in LM code. But I think everyone is very aware of the state of the art at the time, and things have advanced a lot since then. It is impressive to see them cramming that into such a limited processor. But, 'whatever' as to that aspect of it. This is a historical artifact of an amazing feat based on cutting edge research in mathematics/control theory.
So far as I can tell, the AGC maintained the state vectors for the KF. Ground control would run batch mode least squares solutions, and pass it on to the LM, where the updates to the state vector would be applied by hand. I freely admit to not having worked through the code, but I believe the state vector update computations occur here: http://www.ibiblio.org/apollo/listings/Comanche055/MEASUREME...
sources: http://www.ieeecss.org/CSM/library/2010/june10/11-Historical...
http://en.wikipedia.org/wiki/Apollo_Guidance_Computer
http://en.wikipedia.org/wiki/Apollo_PGNCS http://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/2009001...
Edit: I think it was actually the PGNCS that was made back-up [1]. Sorry the comment about Kalman filter had me confused. Apparently PGNCS was still used for maintaining orientation, controlling rockets, and navigation during planned outages.
The hardware limitations! The incredibly low bug count! The memory hand-woven by ladies in a factory! I was blown away by the capabilities of the Apollo computer systems. The craft could have been practically unmanned.
Even more impressive, the computers could fly the craft while ALSO being interrupted by and adjusting to human intervention at nearly every step of the process. The pilots and the engineers practically battled over who would be in control of the craft. Fascinating stuff!
edit: Here's a video https://www.youtube.com/watch?v=7VDV6Gdxakc
On Googling, it seems to be something to do with a checksum value?
(Much of the Apollo Guidance Computer and software was developed by the MIT Instrumentation Lab, the predecessor to Draper Lab.)
TALES FROM THE LUNAR MODULE GUIDANCE COMPUTER http://www.doneyles.com/LM/Tales.html
I place my bet on static-type :D ( joke )
I think they should use COBOL, it's built in :)
http://www.ibiblio.org/apollo/listings/Comanche055/MAIN.agc....
;)