Moonjs: An Online Apollo Guidance Computer (AGC) Simulator


Launch checklist
NO ATT
STBY
KEY REL
OPR ERR
 
 
TEMP
GIMBALL
LOCK
PROG
RESTART
TRACKER
ALT
VEL
COMP
ACTY
PROG
00
VERB
00
NOUN
00
+00000
+00000
+00000
ST
00:00:00
MET
00:00:00
OGA
00
IGA
00
MGA
00
ROLL
00
PITCH
00
YAW
00
S-IC
S-II
S-IVB
Moonjs is an online Apollo Guidance Computer (AGC) simulator. It is a port of Virtual AGC by Ronald Burkey from C to javascript/asm.js using the Emscripten compiler.

AGC was the main computer system of the Apollo program that successfully landed 12 astronauts on Moon. There was one AGC on each of the Apollo Command Modules and another one on each Lunar Module. There was also a second backup computer system called Abort Guidance System (AGS) on the Lunar Modules, which is simulated by Virtual AGC, but not the current version of Moonjs.

Astronauts interacted with AGC by using DSKY, a combination of 7-segment numerical displays, indicator lights and a simple keypad, which is simulated on this page.

The simulated DSKY communicates with a simulated AGC, which in turn runs a copy of Colossus 249, the flight software that flew on the Apollo 9 Command Module. DSKY human interface was built around the concept of Verbs and Nouns. For example, Verb 06 can be used to display the value of near 100 different memory locations selected based on the given Noun.

Some Examples Codes:

For many more examples and details about AGC, its programming and operation, two great sources are the excellent Virtual AGC website by Ronald Burkey and "The Apollo guidance computer : architecture and operation" by Frank O'Brien. The Wikipedia page for AGC also contains lots of useful information and a comprehensive bibliography.

Why Javascript?

Recent advances in the javascript language - such as optimized engines, ahead-of-time (AOT) compilation, and asm.js - make it possible to write computationally extensive applications in javascript. My previous experience with online javascript-based simulation (svtsim and hemosim) was very positive and convinced me of the suitablity of the HTML5/javascript combination in writing portable, easy-to-use simulators. Moonjs is the logical next step that uses Emscripten compiler to convert existing C code into asm.js, a highly-optimizable subset of javascript.