dark mode light mode Search Menu
Search

Coding the Apollo Guidance Computer (AGC)

When we think of history, we might think of famous politicians or military leaders or athletes. Programming has been around long enough, since the 1930s and 1940s, to have its own history. However, most people don’t think to save their code beyond, at most, saving the code to a repository.

The Apollo moon landing missions used a lot of programming code to guide each mission. As computers and digital storage have evolved (do you remember the 5 inch floppy disk?), for decades the Apollo code was locked in paper printouts. For the 40th anniversary of the first moon landing, in 2009, Google made available online AGC code which Ron Burkey and others had transcribed into digital code from these printouts. The Apollo code can be studied online and run within a virtual Apollo Guicance Computer (AGC) emulator.

How the AGC Worked

The AGC had two parts, a front end device with buttons and a backend processing computer which processed data from the front end device as well as data from various devices within the Apollo command module and lunar lander. For example, the flight data for speed, altitude, and other metrics. While the command module and lunar lander each had an AGC, the software on them was different because each spacecraft had a different purpose.

The front end with buttons was called DSKY, shorthand for display and keyboard, and pronounced dis-key. It had status lights, a display for data, and buttons to enter commands. The backend computer processed the commands entered with buttons and returned data to the display screen.

Here’s an old NASA video which shows how the DSKY worked, about 6 minutes into the program:

This video also provides an overview of the guidance-related problems the AGC had to solve in real time as the astronauts flew to the moon and back. Also note that, while men are everywhere in this video and Dr. Widnall’s lecture video linked below, women made critical contributions to many parts of the AGC program.

notebook-nasa-agc-dsky-display

Here is a NASA illustration of the Apollo AGC, which differs a little from the AGC in the video above.

Warning and status lights are on the top left while the activity displays on the top right. For example, the No ATT warning light is lit when the inertial subsystem, which tracks the location of the spacecraft, could not provide an attitude reference. The PROG status light lit when the DSKY needed additional information from the crew to complete the requested program, for example, to enter position data for the telescope used to navigate.

AGC Software

The AGC software had several parts. The operating system was called Exec and it managed jobs based on priority. Exec could run up to eight tasks at a time with each task periodically checking back with the Exec to see if a task with a higher priority was waiting to run. The Waitlist held tasks waiting for the Exec to have capacity to run them.

The Exec always had one lowest priority job to run, called the dummy job, to check the system status. When the dummy job ran, it meant the AGC software had nothing better to do and the green computer activity status light was turned off.

The AGC also included a software intrepreter to handle complex calculations and data processing. The interpreter was created at MIT by a team led by Margaret Hamilton. The software made the most of the hardware memory limits of the AGC while doing often complicated tasks. The software also was written in AGC Assembly language, a variant of the Assembly language.

If you want to look at the AGC code or learn more about programming Apollo computers, explore the Github and other links below. Google Earth also lets you explore the moon and the Apollo landing sites.

Learn More

Virtual AGC – AGS – LVDC – Gemini Website

Details about the AGC with instructions for the AGC emulator and a link to ownload the emulator software.
http://www.ibiblio.org/apollo/

Virtual AGC Github

The original Google code has moved from Google servers to Github. Others have created Virtual AGCs which can be found searching Github.
https://github.com/rburkey2005/virtualagc
https://github.com/rburkey2005/virtualagc/search?utf8=%E2%9C%93&q=virtualagc

Apollo Guidance Computer (AGC)

https://en.wikipedia.org/wiki/Apollo_Guidance_Computer

Computers in Spaceflight: Computers On Board the Apollo Spacecraft

http://history.nasa.gov/computers/Ch2-7.html

AGC Assembly Language Programmer’s Manual

http://www.ibiblio.org/apollo/assembly_language_manual.html
http://www.ibiblio.org/apollo/NARA-SW/E-2052.pdf

Dr. Widnall on Apollo’s Guidance, Navigation, and Control

A lecture he gave to an MIT class which describes the problems the AGC had to solve.
http://mit.tv/z2q0Lr

David SF Portree’s Spaceflight History Blog

An amazing and exhaustive exploration of human spaceflight, from the obvious to missions that were never executed.
http://spaceflighthistory.blogspot.com/
http://www.wired.com/category/science/science-blogs/beyondapollo/

Google Earth

Download their software to visit the moon and the Apollo landing sites.
http://www.google.com/earth/