Source Code
![]() |
This is a reconstruction of the AGC program Luminary 99 Rev 0. It was the
second release of the Lunar Module flight software targeted for use in Apollo 11, after Luminary 97.
A bug (which had been around since at least Apollo 10, Luminary 69) was
discovered in Rev 0 shortly before the Apollo 11 flight, resulting in a last minute
revision into Rev 1,
which is what actually flew rather than
the Rev 0 presented here. A hardcopy of Rev 0 is known to
exist — it belonged to AGC developer Allan Klumpp for many years — but
unfortunately the Virtual AGC Project has not had access to that hardcopy. Thus
the code you see here had been reconstructed (we believe accurately) rather than
transcribed. The first step of the reconstruction of the Rev 0 source code was
the transcription of the Rev 1 source code from a hardcopy in the MIT Museum collection.
The process of reverting the active portion of the source code (i.e., other than
program comments) from Rev 1 to Rev 0 was very minor, consisting
only of moving the position of the STARTSB1 label in
FRESH START AND RESTART. Allan had previously given
us the checksums of the memory banks of Rev 0, and we have verified the program presented here has checksums
identical to all banks of Allan's listing of Rev 0. The notations on Allan's Rev 0 program listing read,
in part:GAP: ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-051 A single program comment is known to differ between Rev 0 and Rev 1, but these are harder to reconstruct and verify than changes to the active portion of the code. Thus it is possible that there are additional differences between the program comments in Rev 0 and Rev 1 that are unknown to us, and therefore are not reflected in the code presented here. |
015553,000002: ## Copyright: Public domain.
015554,000003: ## Filename: GIMBAL_LOCK_AVOIDANCE.agc
015555,000004: ## Purpose: Part of the reconstructed source code for LMY99 Rev 0,
015556,000005: ## otherwise known as Luminary Rev 99, the second release
015557,000006: ## of the Apollo Guidance Computer (AGC) software for Apollo 11.
015558,000007: ## It differs from LMY99 Rev 1 (the flown version) only in the
015559,000008: ## placement of a single label. The corrections shown here have
015560,000009: ## been verified to have the same bank checksums as AGC developer
015561,000010: ## Allan Klumpp's copy of Luminary Rev 99, and so are believed
015562,000011: ## to be accurate. This file is intended to be a faithful
015563,000012: ## recreation, except that the code format has been changed to
015564,000013: ## conform to the requirements of the yaYUL assembler rather than
015565,000014: ## the original YUL assembler.
015566,000015: ##
015567,000016: ## Assembler: yaYUL
015568,000017: ## Contact: Ron Burkey <info@sandroid.org>.
015569,000018: ## Website: www.ibiblio.org/apollo.
015570,000019: ## Pages: 364
015571,000020: ## Mod history: 2009-05-17 RSB Adapted from the corresponding
015572,000021: ## Luminary131 file, using page
015573,000022: ## images from Luminary 1A.
015574,000023: ## 2010-12-31 JL Fixed page number comment.
015575,000024: ## 2016-12-14 RSB Proofed text comments with octopus/ProoferComments
015576,000025: ## but no errors found.
015577,000026: ## 2017-08-01 MAS Created from LMY99 Rev 1.
015578,000027: ## 2017-08-22 RSB Fixed comment-text typo identified in ZERLINA 56.
015579,000028:
015580,000029: ## This source code has been transcribed or otherwise adapted from
015581,000030: ## digitized images of a hardcopy from the MIT Museum. The digitization
015582,000031: ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
015583,000032: ## the Museum. Many thanks to both. The images (with suitable reduction
015584,000033: ## in storage size and consequent reduction in image quality as well) are
015585,000034: ## available online at www.ibiblio.org/apollo. If for some reason you
015586,000035: ## find that the images are illegible, contact me at info@sandroid.org
015587,000036: ## about getting access to the (much) higher-quality images which Paul
015588,000037: ## actually created.
015589,000038: ##
015590,000039: ## The code has been modified to match LMY99 Revision 0, otherwise
015591,000040: ## known as Luminary Revision 99, the Apollo 11 software release preceeding
015592,000041: ## the listing from which it was transcribed. It has been verified to
015593,000042: ## contain the same bank checksums as AGC developer Allan Klumpp's listing
015594,000043: ## of Luminary Revision 99 (for which we do not have scans).
015595,000044: ##
015596,000045: ## Notations on Allan Klumpp's listing read, in part:
015597,000046: ##
015598,000047: ## ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-51
015599,000048:
![]() |
Page 364 |
015601,000050: 15,2050 BANK 15
015602,000051:
015603,000052: 22,2000 SETLOC KALCMON1
015604,000053: 22,2000 BANK
015605,000054:
015606,000055: # DETECTING GIMBAL LOCK
015607,000056: 22,2744 22,2744 LOCSKIRT EQUALS NOGIMLOC
015608,000057:
015609,000058: 22,2744 77614 NOGIMLOC SET
015610,000059: 22,2745 01074 CALCMAN3
015611,000060: 22,2746 70740 WCALC LXC,1 DLOAD*
015612,000061: 22,2747 01325 RATEINDX # CHOOSE THE DESIRED MANEUVER RATE
015613,000062: 22,2750 04772 ARATE,1 # FROM A LIST OF FOUR
015614,000063: 22,2751 45002 SR4 CALL # COMPUTE THE INCREMENTAL ROTATION MATRIX
015615,000064: 22,2752 44527 DELCOMP # DEL CORRESPONDING TO A 1 SEC ROTATION
015616,000065: # ABOUT COF
015617,000066: 22,2753 74343 DLOAD* VXSC
015618,000067: 22,2754 04772 ARATE,1
015619,000068: 22,2755 03271 COF
015620,000069: 22,2756 17326 STODL BRATE # COMPONENT MANEUVER RATES 45 DEG/SEC
015621,000070: 22,2757 03336 AM
015622,000071: 22,2760 55605 DMP DDV*
015623,000072: 22,2761 05002 ANGLTIME
015624,000073: 22,2762 04772 ARATE,1
015625,000074: 22,2763 77661 SR
015626,000075: 22,2764 20606 5
015627,000076: 22,2765 03334 STORE TM # MANEUVER EXECUTION TIME SCALED AS T2
015628,000077: 22,2766 77614 SETGO
015629,000078: 22,2767 01035 CALCMAN2 # 0(OFF) = CONTINUE MANEUVER
015630,000079: 22,2770 45010 NEWANGL +1 # 1(ON) = START MANEUVER
015631,000080:
015632,000081: # THE FOUR SELECTABLE FREE FALL MANEUVER RATES SELECTED BY
015633,000082: # LOADING RATEINDX WITH 0, 2, 4, 6, RESPECTIVELY
015634,000083:
015635,000084: 22,2771 00221 24255 ARATE 2DEC .0088888888 # = 0.2 DEG/SEC $ 22.5 DEG/SEC
015636,000085:
015637,000086: 22,2773 00554 02660 2DEC .0222222222 # = 0.5 DEG/SEC $ 22.5 DEG/SEC
015638,000087:
015639,000088: 22,2775 02660 13301 2DEC .0888888888 # = 2.0 DEG/SEC $ 22.5 DEG/SEC
015640,000089:
015641,000090: 22,2777 16161 30707 2DEC .4444444444 # = 10.0 DEG/SEC $ 22.5 DEG/SEC
015642,000091:
015643,000092: 22,3001 00003 04000 ANGLTIME 2DEC .0001907349 # = 100B-19 FUDGE FACTOR TO CONVERT
015644,000093: # MANEUVER ANGLE TO MANEUVER TIME
015645,000094:
015646,000095:
End of include-file GIMBAL_LOCK_AVOIDANCE.agc. Parent file is MAIN.agc