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