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. |
034703,000002: ## Copyright: Public domain.
034704,000003: ## Filename: THE_LUNAR_LANDING.agc
034705,000004: ## Purpose: Part of the reconstructed source code for LMY99 Rev 0,
034706,000005: ## otherwise known as Luminary Rev 99, the second release
034707,000006: ## of the Apollo Guidance Computer (AGC) software for Apollo 11.
034708,000007: ## It differs from LMY99 Rev 1 (the flown version) only in the
034709,000008: ## placement of a single label. The corrections shown here have
034710,000009: ## been verified to have the same bank checksums as AGC developer
034711,000010: ## Allan Klumpp's copy of Luminary Rev 99, and so are believed
034712,000011: ## to be accurate. This file is intended to be a faithful
034713,000012: ## recreation, except that the code format has been changed to
034714,000013: ## conform to the requirements of the yaYUL assembler rather than
034715,000014: ## the original YUL assembler.
034716,000015: ##
034717,000016: ## Assembler: yaYUL
034718,000017: ## Contact: Hartmuth Gutsche<hgutsche@xplornet.com>.
034719,000018: ## Website: www.ibiblio.org/apollo.
034720,000019: ## Pages: 785-792
034721,000020: ## Mod history: 2009-05-20 HG Transcribed from page images.
034722,000021: ## 2016-12-13 RSB GOTOP00H -> GOTOPOOH
034723,000022: ## 2016-12-16 RSB Proofed text comments with octopus/ProoferComments
034724,000023: ## and corrected the errors found.
034725,000024: ## 2017-03-13 RSB Comment-text fixes noted in proofing Luminary 116.
034726,000025: ## 2017-03-16 RSB Comment-text fixes identified in 5-way
034727,000026: ## side-by-side diff of Luminary 69/99/116/131/210.
034728,000027: ## 2017-08-01 MAS Created from LMY99 Rev 1.
034729,000028:
034730,000029: ## This source code has been transcribed or otherwise adapted from
034731,000030: ## digitized images of a hardcopy from the MIT Museum. The digitization
034732,000031: ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
034733,000032: ## the Museum. Many thanks to both. The images (with suitable reduction
034734,000033: ## in storage size and consequent reduction in image quality as well) are
034735,000034: ## available online at www.ibiblio.org/apollo. If for some reason you
034736,000035: ## find that the images are illegible, contact me at info@sandroid.org
034737,000036: ## about getting access to the (much) higher-quality images which Paul
034738,000037: ## actually created.
034739,000038: ##
034740,000039: ## The code has been modified to match LMY99 Revision 0, otherwise
034741,000040: ## known as Luminary Revision 99, the Apollo 11 software release preceeding
034742,000041: ## the listing from which it was transcribed. It has been verified to
034743,000042: ## contain the same bank checksums as AGC developer Allan Klumpp's listing
034744,000043: ## of Luminary Revision 99 (for which we do not have scans).
034745,000044: ##
034746,000045: ## Notations on Allan Klumpp's listing read, in part:
034747,000046: ##
034748,000047: ## ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-51
034749,000048:
![]() |
Page 785 |
034751,000050: 32,2776 BANK 32
034752,000051: 32,2000 SETLOC F2DPS*32
034753,000052: 32,2000 BANK
034754,000053:
034755,000054: 32,2776 E7,1621 EBANK= E2DPS
034756,000055:
034757,000056: # ****************************************
034758,000057: # P63: THE LUNAR LANDING, BRAKING PHASE
034759,000058: # ****************************************
034760,000059:
034761,000060: 32,2776 COUNT* $$/P63
034762,000061:
034763,000062: 32,2776 05353 P63LM TC PHASCHNG
034764,000063: 32,2777 04024 OCT 04024
034765,000064:
034766,000065: 32,3000 04616 TC BANKCALL # DO IMU STATUS CHECK ROUTINE R02
034767,000066: 32,3001 11254 CADR R02BOTH
034768,000067:
034769,000068: 32,3002 33253 CAF P63ADRES # INITIALIZE WHICH FOR BURNBABY
034770,000069: 32,3003 55455 TS WHICH
034771,000070:
034772,000071: 32,3004 32000 CAF DPSTHRSH # INITIALIZE DVMON
034773,000072: 32,3005 55251 TS DVTHRUSH
034774,000073: 32,3006 34751 CAF FOUR
034775,000074: 32,3007 55515 TS DVCNTR
034776,000075:
034777,000076: 32,3010 44753 CS ONE # INITIALIZE WCHPHASE AND FLPASSO
034778,000077: 32,3011 55351 TS WCHPHASE
034779,000078:
034780,000079: 32,3012 34755 CA ZERO
034781,000080: 32,3013 55623 TS FLPASS0
034782,000081:
034783,000082: 32,3014 44736 CS BIT14
034784,000083: 32,3015 00006 EXTEND
034785,000084: 32,3016 03012 WAND CHAN12 # REMOVE TRACK-ENABLE DISCRETE.
034786,000085:
034787,000086: 32,3017 06037 FLAGORGY TC INTPRET # DIONYSIAN FLAG WAVING
034788,000087: 32,3020 43014 CLEAR CLEAR
034789,000088: 32,3021 02663 NOTHROTL
034790,000089: 32,3022 03271 REDFLAG
034791,000090: 32,3023 43014 CLEAR SET
034792,000091: 32,3024 05660 LRBYPASS
034793,000092: 32,3025 03067 MUNFLAG
034794,000093: 32,3026 43014 CLEAR CLEAR
034795,000094: 32,3027 00266 P25FLAG # TERMINATE P25 IF IT IS RUNNING.
034796,000095: 32,3030 00270 RNDVZFLG # TERMINATE P20 IF IT IS RUNNING
034797,000096:
034798,000097: # ****************************************
034799,000098:
034800,000099: 32,3031 77201 IGNALG SETPD VLOAD # FIRST SET UP INPUTS FOR RP-TO-R:-
![]() |
Page 786 |
034802,000101: 32,3032 00001 0 # AT 0D LANDING SITE IN MOON FIXED FRAME
034803,000102: 32,3033 02023 RLS # AT 6D ESTIMATED TIME OF LANDING
034804,000103: 32,3034 41525 PDDL PUSH # MPAC NON-ZERO TO INDICATE LUNAR CASE
034805,000104: 32,3035 02401 TLAND
034806,000105: 32,3036 37625 STCALL TPIP # ALSO SET TPIP FOR FIRST GUIDANCE PASS
034807,000106: 32,3037 55716 RP-TO-R
034808,000107: 32,3040 64312 VSL4 MXV
034809,000108: 32,3041 01734 REFSMMAT
034810,000109: 32,3042 37635 STCALL LAND
034811,000110: 32,3043 46432 GUIDINIT # GUIDINIT INITIALIZES WM AND /LAND/
034812,000111: 32,3044 45345 DLOAD DSU
034813,000112: 32,3045 02401 TLAND
034814,000113: 32,3046 25260 GUIDDURN
034815,000114: 32,3047 34041 STCALL TDEC1 # INTEGRATE STATE FORWARD TO THAT TIME
034816,000115: 32,3050 27057 LEMPREC
034817,000116: 32,3051 77331 SSP VLOAD
034818,000117: 32,3052 03647 NIGNLOOP
034819,000118: 32,3053 00050 40D
034820,000119: 32,3054 06520 UNITX
034821,000120: 32,3055 26603 STOVL CG
034822,000121: 32,3056 06516 UNITY
034823,000122: 32,3057 26611 STOVL CG +6
034824,000123: 32,3060 06514 UNITZ
034825,000124: 32,3061 16617 STODL CG +14
034826,000125: 32,3062 25256 99999CON
034827,000126: 32,3063 27665 STOVL DELTAH # INITIALIZE DELTAH FOR V16N68 DISPLAY
034828,000127: 32,3064 06522 ZEROVECS
034829,000128: 32,3065 17254 STODL UNFC/2 # INITIALIZE TRIM VELOCITY CORRECTION TERM
034830,000129: 32,3066 06522 HI6ZEROS
034831,000130: 32,3067 03643 STORE TTF/8
034832,000131:
034833,000132: 32,3070 77745 IGNALOOP DLOAD
034834,000133: 32,3071 00015 TAT
034835,000134: 32,3072 27561 STOVL PIPTIME1
034836,000135: 32,3073 00017 RATT1
034837,000136: 32,3074 64312 VSL4 MXV
034838,000137: 32,3075 01734 REFSMMAT
034839,000138: 32,3076 37521 STCALL R
034840,000139: 32,3077 67130 MUNGRAV
034841,000140: 32,3100 35237 STCALL GDT/2
034842,000141: 32,3101 62454 ?GUIDSUB # WHICH DELIVERS N PASSES OF GUIDANCE
034843,000142:
034844,000143: # DDUMCALC IS PROGRAMMED AS FOLLOWS:-
034845,000144: # 2 -
034846,000145: # (RIGNZ - RGU )/16 + 16(RGU )KIGNY/B8 + (RGU - RIGNX)KIGNX/B4 + (ABVAL(VGU) - VIGN)KIGNV/B4
034847,000146: # 2 1 0
034848,000147: # DDUM = -------------------------------------------------------------------------------------------
034849,000148: # 10
034850,000149: # 2 (VGU - 16 VGU KIGNX/B4)
![]() |
Page 787 |
034852,000151: # 2 0
034853,000152: # THE NUMERATOR IS SCALED IN METERS AT 2(28). THE DENOMINATOR IS A VELOCITY IN UNITS OF 2(10) M/CS.
034854,000153: # THE QUOTIENT IS THUS A TIME IN UNITS OF 2(18) CENTISECONDS. THE FINAL SHIFT RESCALES TO UNITS OF 2(28) CS.
034855,000154: # THERE IS NO DAMPING FACTOR. THE CONSTANTS KIGNX/B4, KIGNY/B8 AND KIGNV/B4 ARE ALL NEGATIVE IN SIGN.
034856,000155:
034857,000156: 32,3102 55646 DDUMCALC TS NIGNLOOP
034858,000157: 32,3103 06037 TC INTPRET
034859,000158: 32,3104 57345 DLOAD DMPR # FORM DENOMINATOR FIRST
034860,000159: 32,3105 03627 VGU
034861,000160: 32,3106 02501 KIGNX/B4
034862,000161: 32,3107 44232 SL4R BDSU
034863,000162: 32,3110 03633 VGU +4
034864,000163: 32,3111 45325 PDDL DSU
034865,000164: 32,3112 02477 RIGNZ
034866,000165: 32,3113 02643 RGU +4
034867,000166: 32,3114 65222 SR4R PDDL
034868,000167: 32,3115 02641 RGU +2
034869,000168: 32,3116 57316 DSQ DMPR
034870,000169: 32,3117 02503 KIGNY/B8
034871,000170: 32,3120 65232 SL4R PDDL
034872,000171: 32,3121 02637 RGU
034873,000172: 32,3122 57225 DSU DMPR
034874,000173: 32,3123 02475 RIGNX
034875,000174: 32,3124 02501 KIGNX/B4
034876,000175: 32,3125 51515 PDVL ABVAL
034877,000176: 32,3126 03627 VGU
034878,000177: 32,3127 57225 DSU DMPR
034879,000178: 32,3130 02473 VIGN
034880,000179: 32,3131 02505 KIGNV/B4
034881,000180: 32,3132 43215 DAD DAD
034882,000181: 32,3133 56215 DAD DDV
034883,000182: 32,3134 77661 SRR
034884,000183: 32,3135 21613 10D
034885,000184:
034886,000185: 32,3136 43206 PUSH DAD
034887,000186: 32,3137 03561 PIPTIME1
034888,000187: 32,3140 14041 STODL TDEC1 # STORE NEW GUESS FOR NEXT INTEGRATION
034889,000188: 32,3141 45246 ABS DSU
034890,000189: 32,3142 25262 DDUMCRIT
034891,000190: 32,3143 45040 BMN CALL
034892,000191: 32,3144 65163 DDUMGOOD
034893,000192: 32,3145 27414 INTSTALL
034894,000193: 32,3146 43014 SET SET
034895,000194: 32,3147 01473 INTYPFLG
034896,000195: 32,3150 00063 MOONFLAG
034897,000196: 32,3151 77745 DLOAD
034898,000197: 32,3152 03561 PIPTIME1
034899,000198: 32,3153 25517 STOVL TET # HOPEFULLY ?GUIDSUB DID NOT
034900,000199: 32,3154 00017 RATT1 # CLOBBER RATT1 AND VATT1
![]() |
Page 788 |
034902,000201: 32,3155 25535 STOVL RCV
034903,000202: 32,3156 00025 VATT1
034904,000203: 32,3157 35543 STCALL VCV
034905,000204: 32,3160 27107 INTEGRVS
034906,000205: 32,3161 77650 GOTO
034907,000206: 32,3162 65070 IGNALOOP
034908,000207:
034909,000208: 32,3163 54335 DDUMGOOD SLOAD SR
034910,000209: 32,3164 03423 ZOOMTIME
034911,000210: 32,3165 20617 14D
034912,000211: 32,3166 77621 BDSU
034913,000212: 32,3167 00041 TDEC1
034914,000213: 32,3170 27442 STOVL TIG # COMPUTE DISTANCE LANDING SITE WILL BE
034915,000214: 32,3171 03527 V # OUT OF LM'S ORBITAL PLANE AT IGNITION:
034916,000215: 32,3172 53435 VXV UNIT # SIGN IS + IF LANDING SITE IS TO THE
034917,000216: 32,3173 03521 R # RIGHT, NORTH; - IF TO THE LEFT, SOUTH.
034918,000217: 32,3174 72441 DOT SL1
034919,000218: 32,3175 03635 LAND
034920,000219: 32,3176 26627 R60INIT STOVL OUTOFPLN # INITIALIZATION FOR CALCMANU
034921,000220: 32,3177 03254 UNFC/2
034922,000221: 32,3200 02631 STORE R60VSAVE # STORE UNFC/2 TEMPORARILY IN R60SAVE
034923,000222: 32,3201 77776 EXIT
034924,000223: # ****************************************
034925,000224:
034926,000225: 32,3202 05353 IGNALGRT TC PHASCHNG # PREVENT REPEATING IGNALG
034927,000226: 32,3203 04024 OCT 04024
034928,000227:
034929,000228: 32,3204 44362 ASTNCLOK CS ASTNDEX
034930,000229: 32,3205 04616 TC BANKCALL
034931,000230: 32,3206 74664 CADR STCLOK2
034932,000231: 32,3207 15155 TCF ENDOFJOB # RETURN IN NEW JOB AND IN EBANK FIVE
034933,000232:
034934,000233: 32,3210 06037 ASTNRET TC INTPRET
034935,000234: 32,3211 47131 SSP RTB # GO PICK UP DISPLAY AT END OF R51:
034936,000235: 32,3212 02747 QMAJ # "PROCEED" WILL DO A FINE ALIGNMENT
034937,000236: 32,3213 65215 FCADR P63SPOT2 # "ENTER" WILL RETURN TO P63SPOT2
034938,000237: 32,3214 31135 R51P63
034939,000238: 32,3215 53575 P63SPOT2 VLOAD UNIT # INITIALIZE KALCMANU FOR BURN ATTITUDE
034940,000239: 32,3216 02631 R60VSAVE
034941,000240: 32,3217 27773 STOVL POINTVSM
034942,000241: 32,3220 06520 UNITX
034943,000242: 32,3221 03765 STORE SCAXIS
034944,000243: 32,3222 77776 EXIT
034945,000244:
034946,000245: 32,3223 35016 CAF EBANK7
034947,000246: 32,3224 54003 TS EBANK
034948,000247:
034949,000248: 32,3225 00004 INHINT
034950,000249: 32,3226 04674 TC IBNKCALL
034951,000250: 32,3227 40142 CADR PFLITEDB
![]() |
Page 789 |
034953,000252: 32,3230 00003 RELINT
034954,000253:
034955,000254: 32,3231 04616 TC BANKCALL
034956,000255: 32,3232 54123 CADR R60LEM
034957,000256:
034958,000257: 32,3233 05353 TC PHASCHNG # PREVENT RECALLING R60
034959,000258: 32,3234 04024 OCT 04024
034960,000259:
034961,000260: 32,3235 34746 P63SPOT3 CA BIT6 # IS THE LR ANTENNA IN POSITION 1 YET
034962,000261: 32,3236 00006 EXTEND
034963,000262: 32,3237 02033 RAND CHAN33
034964,000263: 32,3240 00006 EXTEND
034965,000264: 32,3241 13247 BZF P63SPOT4 # BRANCH IF ANTENNA ALREADY IN POSITION 1
034966,000265:
034967,000266: 32,3242 33254 CAF CODE500 # ASTRONAUT: PLEASE CRANK THE
034968,000267: 32,3243 04616 TC BANKCALL # SILLY THING AROUND
034969,000268: 32,3244 20623 CADR GOPERF1
034970,000269: 32,3245 16001 TCF GOTOPOOH # TERMINATE
034971,000270: 32,3246 13235 TCF P63SPOT3 # PROCEED SEE IF HE'S LYING
034972,000271:
034973,000272: 32,3247 04616 P63SPOT4 TC BANKCALL # ENTER INITIALIZE LANDING RADAR
034974,000273: 32,3250 67721 CADR SETPOS1
034975,000274:
034976,000275: 32,3251 04635 TC POSTJUMP # OFF TO SEE THE WIZARD ...
034977,000276: 32,3252 74126 CADR BURNBABY
034978,000277:
034979,000278: # ----------------------------------------
034980,000279:
034981,000280: # CONSTANTS FOR P63LM AND IGNALG
034982,000281:
034983,000282: 32,3253 02076 P63ADRES GENADR P63TABLE
034984,000283:
034985,000284: 32,3254 4362 ASTNDEX = MD1 # OCT 25; INDEX FOR CLOKTASK
034986,000285:
034987,000286: 32,3254 00500 CODE500 OCT 00500
034988,000287:
034989,000288: 32,3255 00035 30373 99999CON 2DEC 30479.7 B-24
034990,000289:
034991,000290: 32,3257 00004 01610 GUIDDURN 2DEC +66440 B-28 # GUIDDURN +6.64400314 E+2
034992,000291: 32,3261 00000 00010 DDUMCRIT 2DEC +8 B-28 # CRITERION FOR IGNALG CONVERGENCE
034993,000292:
![]() |
Page 790 |
034995,000294: # ----------------------------------------
034996,000295:
![]() |
Page 791 |
034998,000297: # ****************************************
034999,000298: # P68: LANDING CONFIRMATION
035000,000299: # ****************************************
035001,000300:
035002,000301: 31,2144 BANK 31
035003,000302: 31,2000 SETLOC F2DPS*31
035004,000303: 31,2000 BANK
035005,000304:
035006,000305: 31,2144 COUNT* $$/P6567
035007,000306:
035008,000307: 31,2144 05353 LANDJUNK TC PHASCHNG
035009,000308: 31,2145 04024 OCT 04024
035010,000309:
035011,000310: 31,2146 00004 INHINT
035012,000311: 31,2147 04616 TC BANKCALL # ZERO ATTITUDE ERROR
035013,000312: 31,2150 40153 CADR ZATTEROR
035014,000313:
035015,000314: 31,2151 04616 TC BANKCALL # SET 5 DEGREE DEADBAND
035016,000315: 31,2152 40127 CADR SETMAXDB
035017,000316:
035018,000317: 31,2153 06037 TC INTPRET # TO INTERPRETIVE AS TIME IS NOT CRITICAL
035019,000318: 31,2154 43014 SET CLEAR
035020,000319: 31,2155 04067 SURFFLAG
035021,000320: 31,2156 04666 LETABORT
035022,000321: 31,2157 77214 SET VLOAD
035023,000322: 31,2160 05062 APSFLAG
035024,000323: 31,2161 01221 RN
035025,000324: 31,2162 16032 STODL ALPHAV
035026,000325: 31,2163 01235 PIPTIME
035027,000326: 31,2164 45014 SET CALL
035028,000327: 31,2165 01463 LUNAFLAG
035029,000328: 31,2166 26351 LAT-LONG
035030,000329: 31,2167 77201 SETPD VLOAD # COMPUTE RLS AND STORE IT AWAY
035031,000330: 31,2170 00001 0
035032,000331: 31,2171 01221 RN
035033,000332: 31,2172 65352 VSL2 PDDL
035034,000333: 31,2173 01235 PIPTIME
035035,000334: 31,2174 45006 PUSH CALL
035036,000335: 31,2175 51670 R-TO-RP
035037,000336: 31,2176 02023 STORE RLS
035038,000337: 31,2177 77776 EXIT
035039,000338: 31,2200 32215 CAF V06N43* # ASTRONAUT: NOW LOOK WHERE YOU ENDED UP
035040,000339: 31,2201 04616 TC BANKCALL
035041,000340: 31,2202 20476 CADR GOFLASH
035042,000341: 31,2203 16001 TCF GOTOPOOH # TERMINATE
035043,000342: 31,2204 12206 TCF +2 # PROCEED
035044,000343: 31,2205 12200 TCF -5 # RECYCLE
035045,000344:
035046,000345: 31,2206 06037 TC INTPRET
![]() |
Page 792 |
035048,000347: 31,2207 77775 VLOAD # INITIALIZE GSAV AND (USING REFMF)
035049,000348: 31,2210 06520 UNITX # YNBSAV, ZNBSAV AND ATTFLAG FOR P57
035050,000349: 31,2211 36231 STCALL GSAV
035051,000350: 31,2212 33506 REFMF
035052,000351: 31,2213 77776 EXIT
035053,000352:
035054,000353: 31,2214 16001 TCF GOTOPOOH # ASTRONAUT: PLEASE SELECT P57
035055,000354:
035056,000355: 31,2215 01453 V06N43* VN 0643
035057,000356:
End of include-file THE_LUNAR_LANDING.agc. Parent file is MAIN.agc