Apollo 11 Code – Development Process for Apollo 11 Missions

assemblyhistoryimperative-programminglow-levelspace-technology

The Apollo missions had technology no more complicated than a pocket calculator.

From link here, there's an information about Apollo Guidance Computer (AGC)

The on-board Apollo Guidance Computer (AGC) was about 1 cubic foot with 2K of 16-bit RAM and 36K of hard-wired core-rope memory with copper wires threaded or not threaded through tiny magnetic cores. The 16-bit words were generally 14 bits of data (or two op-codes), 1 sign bit, and 1 parity bit. The cycle time was 11.7 micro-seconds. Programming was done in assembly language and in an interpretive language, in reverse Polish.

So, I've stumbled upon some source code when I researched what was up there, and I've noticed great comments (eg. TEMPORARY, I HOPE HOPE HOPE)

VRTSTART    TS  WCHVERT
# Page 801
        CAF TWO     # WCHPHASE = 2 ---> VERTICAL: P65,P66,P67
        TS  WCHPHOLD
        TS  WCHPHASE
        TC  BANKCALL    # TEMPORARY, I HOPE HOPE HOPE
        CADR    STOPRATE    # TEMPORARY, I HOPE HOPE HOPE
        TC  DOWNFLAG    # PERMIT X-AXIS OVERRIDE
        ADRES   XOVINFLG
        TC  DOWNFLAG
        ADRES   REDFLAG
        TCF VERTGUID

The actual programs in the spacecraft were stored in core rope memory, an ancient memory technology made by (literally) weaving a fabric/rope, where the bits were physical rings of ferrite material. "Core" memory is resistant to cosmic rays. The state of a core bit will not change when bombarded by radiation in Outer Space.

Virtual Apollo Guidance Computer (AGC) software is also on GITHUB!

Some part of documentation is here.

Another sample of source code with great comments.

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     BURNBABY

My question here is this:

  • How were the teams writing this much code able to make it functional given the tools at the time?

Because if you compile so much code that was used on Apollo 11… it'd take days, even weeks. I seriously doubt that programmers back then left everything to happen by chance.

Best Answer

There was a lovely documentary I'm trying to chase down about John 'Jack' Garman had to "invent" a "a priority-scheduled multiprogramming operating system". This may have been related to the lander module though. The story was that when you were landing the lander, you better give priority to guidance because other things, like the temperature in the cabin for the next 15 seconds, didn't really matter if you crashed and burned. On the first shot they overloaded the computer and alarms started happening because some subroutines were not getting executed. There were too many loaded, but thanks to the priority concept, which Garman foresaw and built in because he thought it was a good idea, the low priority routines didn't bog down the higher priority landing routine.

Watching the documentary at the time, I was struck about how it was like doing a major refactoring on the code without telling management and almost getting fired because you were late on what you were supposed to be working on. In this case however, the refactoring came to light when reason for the alarms was investigated. (And management was still pissed! :-)

Some links:

No, a “checklist error” did not almost derail the first moon landing

TALES FROM THE LUNAR MODULE GUIDANCE COMPUTER

How They Built it: The Software of Apollo 11

NASA Johnson Space Center Oral History Project Edited Oral History Transcript

Brief history of NASA´s Apollo Program Excerpt: Five minutes into the descent burn, and 1,800 m above the surface of the Moon, the LM navigation and guidance computer produced the first of several unexpected "1202" and "1201" program alarms. The computer engineer at Mission Control Center in Houston, Jack Garman, told guidance officer Steve Bales it was safe to continue the descent. These alarms were indications of " executive overflows" , meaning the guidance computer could not complete all of its tasks in real time and had to postpone some of them.

Recalling the 'Giant Leap' Excerpt: We knew what that was and that it should not be happening. But we had designed a system that tried hard to recover from any overload conditions. So I remember hearing [NASA computer engineer] Jack Garman shouting, "Go, go!" And on they went. Then we listened as Neil flew the LEM on and on trying to find a good spot to touchdown. Our new worry was lack of fuel remaining. But finally we heard the contact notice and then, "The Eagle has landed."

Jack Garman Interview

EDIT: Maybe this was the documentary: Apollo 11: The Untold Story (2006)

Cast: John R. Garman ...
Himself - Apollo 11 Computer Engineer (as Jack Garman)

(Among others).

Update: A Hacker From South Africa Just Rescued the First NASA Computer in Space