Source Code
![]() |
These source-code files are part of a reconstructed copy of Luminary 173, the
second (unflown) release of the Apollo 14 Lunar Module (LM) Apollo Guidance
Computer (AGC) software.
The reconstruction began with reconstructed source code for Luminary 178. Changes between revision 173 and 178 were backed out, as described by Luminary memo 167 (revision 1). The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152N. Note that page numbers in the reconstructed code match those for the baseline log section mentioned in each file's changelog; the page numbers for a real Luminary 173 listing would be different. Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository. |
033453,000002: ## Copyright: Public domain.
033454,000003: ## Filename: THE_LUNAR_LANDING.agc
033455,000004: ## Purpose: A section of Luminary revision 173.
033456,000005: ## It is part of the reconstructed source code for the second
033457,000006: ## (unflown) release of the flight software for the Lunar
033458,000007: ## Module's (LM) Apollo Guidance Computer (AGC) for Apollo 14.
033459,000008: ## The code has been recreated from a reconstructed copy of
033460,000009: ## Luminary 178, as well as Luminary memo 167 (revision 1).
033461,000010: ## It has been adapted such that the resulting bugger words
033462,000011: ## exactly match those specified for Luminary 173 in NASA
033463,000012: ## drawing 2021152N, which gives relatively high confidence
033464,000013: ## that the reconstruction is correct.
033465,000014: ## Reference: pp. 771-778
033466,000015: ## Assembler: yaYUL
033467,000016: ## Contact: Ron Burkey <info@sandroid.org>.
033468,000017: ## Website: www.ibiblio.org/apollo/index.html
033469,000018: ## Mod history: 2019-09-18 MAS Created from Luminary 178.
033470,000019:
![]() |
Page 771 |
033472,000021: 32,2562 BANK 32
033473,000022: 32,2000 SETLOC F2DPS*32
033474,000023: 32,2000 BANK
033475,000024:
033476,000025: 32,2562 E7,1621 EBANK= E2DPS
033477,000026:
033478,000027: # ****************************************
033479,000028: # P63: THE LUNAR LANDING, BRAKING PHASE
033480,000029: # ****************************************
033481,000030:
033482,000031: 32,2562 COUNT* $$/P63
033483,000032:
033484,000033: 32,2562 05364 P63LM TC PHASCHNG
033485,000034: 32,2563 04024 OCT 04024
033486,000035:
033487,000036: 32,2564 04616 TC BANKCALL # DO IMU STATUS CHECK ROUTINE R02
033488,000037: 32,2565 11241 CADR R02BOTH
033489,000038:
033490,000039: 32,2566 33056 CAF P63ADRES # INITIALIZE WHICH FOR BURNBABY
033491,000040: 32,2567 55455 TS WHICH
033492,000041:
033493,000042: 32,2570 32000 CAF DPSTHRSH # INITIALIZE DVMON
033494,000043: 32,2571 55250 TS DVTHRUSH
033495,000044: 32,2572 34751 CAF FOUR
033496,000045: 32,2573 55515 TS DVCNTR
033497,000046:
033498,000047: 32,2574 44753 CS ONE # INITIALIZE WCHPHASE AND FLPASSO
033499,000048: 32,2575 55346 TS WCHPHASE
033500,000049:
033501,000050: 32,2576 34755 CA ZERO
033502,000051: 32,2577 55623 TS FLPASS0
033503,000052:
033504,000053: 32,2600 44736 CS BIT14
033505,000054: 32,2601 00006 EXTEND
033506,000055: 32,2602 03012 WAND CHAN12 # REMOVE TRACK-ENABLE DISCRETE.
033507,000056:
033508,000057: 32,2603 06042 FLAGORGY TC INTPRET # DIONYSIAN FLAG WAVING
033509,000058: 32,2604 77614 CLEAR
033510,000059: 32,2605 00664 NOTERFLG # PERMIT TERRAIN MODEL
033511,000060: 32,2606 43014 CLEAR CLEAR
033512,000061: 32,2607 02663 NOTHROTL
033513,000062: 32,2610 03271 REDFLAG
033514,000063: 32,2611 43014 CLEAR SET
033515,000064: 32,2612 05660 LRBYPASS
033516,000065: 32,2613 03067 MUNFLAG
033517,000066: 32,2614 43014 CLEAR CLEAR
![]() |
Page 772 |
033519,000068: 32,2615 00266 P25FLAG # TERMINATE P25 IF IT IS RUNNING.
033520,000069: 32,2616 00270 RNDVZFLG # TERMINATE P20 IF IT IS RUNNING
033521,000070:
033522,000071: # ****************************************
033523,000072:
033524,000073: 32,2617 77201 IGNALG SETPD VLOAD # FIRST SET UP INPUTS FOR RP-TO-R:-
033525,000074: 32,2620 00001 0 # AT 0D LANDING SITE IN MOON FIXED FRAME
033526,000075: 32,2621 02021 RLS # AT 6D ESTIMATED TIME OF LANDING
033527,000076: 32,2622 41525 PDDL PUSH # MPAC NON-ZERO TO INDICATE LUNAR CASE
033528,000077: 32,2623 02027 TLAND
033529,000078: 32,2624 37625 STCALL TPIP # ALSO SET TPIP FOR FIRST GUIDANCE PASS
033530,000079: 32,2625 55720 RP-TO-R
033531,000080: 32,2626 64312 VSL4 MXV
033532,000081: 32,2627 01732 REFSMMAT
033533,000082: 32,2630 37635 STCALL LAND
033534,000083: 32,2631 71346 GUIDINIT # GUIDINIT INITIALIZES WM AND /LAND/
033535,000084: 32,2632 45345 DLOAD DSU
033536,000085: 32,2633 02027 TLAND
033537,000086: 32,2634 25063 GUIDDURN
033538,000087: 32,2635 34041 STCALL TDEC1 # INTEGRATE STATE FORWARD TO THAT TIME
033539,000088: 32,2636 27056 LEMPREC
033540,000089: 32,2637 77331 SSP VLOAD
033541,000090: 32,2640 03647 NIGNLOOP
033542,000091: 32,2641 00050 40D
033543,000092: 32,2642 06516 UNITX
033544,000093: 32,2643 26572 STOVL CG
033545,000094: 32,2644 06514 UNITY
033546,000095: 32,2645 26600 STOVL CG +6
033547,000096: 32,2646 06512 UNITZ
033548,000097: 32,2647 16606 STODL CG +14
033549,000098: 32,2650 25061 99999CON
033550,000099: 32,2651 27665 STOVL DELTAH # INITIALIZE DELTAH FOR V16N68 DISPLAY
033551,000100: 32,2652 06520 ZEROVECS
033552,000101: 32,2653 17253 STODL UNFC/2 # INITIALIZE TRIM VELOCITY CORRECTION TERM
033553,000102: 32,2654 06520 HI6ZEROS
033554,000103: 32,2655 17643 STODL TTF/8
033555,000104: 32,2656 25067 HLROFFF
033556,000105: 32,2657 03452 STORE HLROFF # LR CUTOFF ALTITUDE.
033557,000106:
033558,000107: 32,2660 77745 IGNALOOP DLOAD
033559,000108: 32,2661 00015 TAT
033560,000109: 32,2662 27561 STOVL PIPTIME1
033561,000110: 32,2663 00017 RATT1
033562,000111: 32,2664 64312 VSL4 MXV
![]() |
REFSMMAT below is circled in blue pen. |
033564,000113: 32,2665 01732 REFSMMAT
033565,000114: 32,2666 37521 STCALL R
033566,000115: 32,2667 67000 MUNGRAV
033567,000116: 32,2670 35236 STCALL GDT/2
033568,000117: 32,2671 62417 ?GUIDSUB # WHICH DELIVERS N PASSES OF GUIDANCE
033569,000118:
033570,000119: # DDUMCALC IS PROGRAMMED AS FOLLOWS:-
![]() |
Page 773 |
033572,000121: # 2 -
033573,000122: # (RIGNZ - RGU )/16 + 16(RGU )KIGNY/B8 + (RGU - RIGNX)KIGNX/B4 + (ABVAL(VGU) - VIGN)KIGNV/B4
033574,000123: # 2 1 0
033575,000124: # DDUM = -------------------------------------------------------------------------------------------
033576,000125: # 10
033577,000126: # 2 (VGU - 16 VGU KIGNX/B4)
033578,000127: # 2 0
033579,000128:
033580,000129: # THE NUMERATOR IS SCALED IN METERS AT 2(28). THE DENOMINATOR IS A VELOCITY IN UNITS OF 2(10)M/CS.
033581,000130: # THE QUOTIENT IS THUS A TIME IN UNITS OF 2(18) CENTISECONDS. THE FINAL SHIFT RESCALES TO UNITS OF 2(28) CS.
033582,000131: # THERE IS NO DAMPING FACTOR. THE CONSTANTS KIGNX/B4, KIGNY/B8 AND KIGNV/B4 ARE ALL NEGATIVE IN SIGN.
033583,000132:
033584,000133: 32,2672 55646 DDUMCALC TS NIGNLOOP
033585,000134: 32,2673 06042 TC INTPRET
033586,000135: 32,2674 57345 DLOAD DMPR # FORM DENOMINATOR FIRST
033587,000136: 32,2675 03627 VGU
033588,000137: 32,2676 02465 KIGNX/B4
033589,000138: 32,2677 44232 SL4R BDSU
033590,000139: 32,2700 03633 VGU +4
033591,000140: 32,2701 45325 PDDL DSU
![]() |
The value in the following line has a blue arrow drawn in pointing to it. |
033593,000142: 32,2702 02463 RIGNZ
033594,000143: 32,2703 02630 RGU +4
033595,000144: 32,2704 65222 SR4R PDDL
033596,000145: 32,2705 02626 RGU +2
033597,000146: 32,2706 57316 DSQ DMPR
![]() |
The value in the following line has a blue arrow drawn in pointing to it. |
033599,000148: 32,2707 02467 KIGNY/B8
033600,000149: 32,2710 65232 SL4R PDDL
033601,000150: 32,2711 02624 RGU
033602,000151: 32,2712 57225 DSU DMPR
![]() |
The values in the following two line have blue arrows drawn in pointing to them. |
033604,000153: 32,2713 02461 RIGNX
033605,000154: 32,2714 02465 KIGNX/B4
033606,000155: 32,2715 51515 PDVL ABVAL
033607,000156: 32,2716 03627 VGU
033608,000157: 32,2717 57225 DSU DMPR
![]() |
The values in the following two line have blue arrows drawn in pointing to them. |
033610,000159: 32,2720 02457 VIGN
033611,000160: 32,2721 02471 KIGNV/B4
033612,000161: 32,2722 43215 DAD DAD
033613,000162: 32,2723 56215 DAD DDV
033614,000163: 32,2724 77661 SRR
033615,000164: 32,2725 21613 10D
033616,000165:
033617,000166: 32,2726 43206 PUSH DAD
033618,000167: 32,2727 03561 PIPTIME1
033619,000168: 32,2730 14041 STODL TDEC1 # STORE NEW GUESS FOR NEXT INTEGRATION
033620,000169: 32,2731 45246 ABS DSU
033621,000170: 32,2732 25065 DDUMCRIT
033622,000171: 32,2733 45040 BMN CALL
033623,000172: 32,2734 64753 DDUMGOOD
033624,000173: 32,2735 27410 INTSTALL
033625,000174: 32,2736 43014 SET SET
![]() |
Page 774 |
033627,000176: 32,2737 01473 INTYPFLG
033628,000177: 32,2740 00063 MOONFLAG
033629,000178: 32,2741 77745 DLOAD
033630,000179: 32,2742 03561 PIPTIME1
033631,000180: 32,2743 25517 STOVL TET # HOPEFULLY ?GUIDSUB DID NOT
033632,000181: 32,2744 00017 RATT1 # CLOBBER RATT1 AND VATT1
033633,000182: 32,2745 25535 STOVL RCV
033634,000183: 32,2746 00025 VATT1
033635,000184: 32,2747 35543 STCALL VCV
033636,000185: 32,2750 27106 INTEGRVS
033637,000186: 32,2751 77650 GOTO
033638,000187: 32,2752 64660 IGNALOOP
033639,000188:
033640,000189: 32,2753 54335 DDUMGOOD SLOAD SR
033641,000190: 32,2754 03423 ZOOMTIME
033642,000191: 32,2755 20617 14D
033643,000192: 32,2756 77621 BDSU
033644,000193: 32,2757 00041 TDEC1
033645,000194: 32,2760 27442 STOVL TIG # COMPUTE DISTANCE LANDING SITE WILL BE
033646,000195: 32,2761 03527 V # OUT OF LM'S ORBITAL PLANE AT IGNITION:
033647,000196: 32,2762 53435 VXV UNIT # SIGN IS + IF LANDING SITE IS TO THE
033648,000197: 32,2763 03521 R # RIGHT, NORTH; - IF TO THE LEFT, SOUTH.
033649,000198: 32,2764 72441 DOT SL1
033650,000199: 32,2765 03635 LAND
033651,000200: 32,2766 26614 R60INIT STOVL OUTOFPLN # INITIALIZATION FOR CALCMANU
033652,000201: 32,2767 03253 UNFC/2
033653,000202: 32,2770 02616 STORE R60VSAVE # STORE UNFC/2 TEMPORARILY IN R60SAVE
033654,000203: 32,2771 77776 EXIT
033655,000204: # ****************************************
033656,000205:
033657,000206: 32,2772 05364 IGNALGRT TC PHASCHNG # PREVENT REPEATING IGNALG
033658,000207: 32,2773 04024 OCT 04024
033659,000208:
033660,000209: 32,2774 44362 ASTNCLOK CS ASTNDEX
033661,000210: 32,2775 04616 TC BANKCALL
033662,000211: 32,2776 74671 CADR STCLOK2
033663,000212: 32,2777 15155 TCF ENDOFJOB # RETURN IN NEW JOB AND IN EBANK FIVE
033664,000213:
033665,000214: 32,3000 06042 ASTNRET TC INTPRET
033666,000215: 32,3001 47131 SSP RTB # GO PICK UP DISPLAY AT END OF R51:
033667,000216: 32,3002 02747 QMAJ # "PROCEED" WILL DO A FINE ALIGNMENT
033668,000217: 32,3003 65005 FCADR P63SPOT2 # "ENTER" WILL RETURN TO P63SPOT2
033669,000218: 32,3004 31127 R51P63
033670,000219: 32,3005 53575 P63SPOT2 VLOAD UNIT # INITIALIZE KALCMANU FOR BURN ATTITUDE
033671,000220: 32,3006 02616 R60VSAVE
033672,000221: 32,3007 27773 STOVL POINTVSM
033673,000222: 32,3010 06516 UNITX
033674,000223: 32,3011 03765 STORE SCAXIS
033675,000224: 32,3012 77776 EXIT
033676,000225:
033677,000226: 32,3013 35016 CAF EBANK7
033678,000227: 32,3014 54003 TS EBANK
033679,000228:
033680,000229: 32,3015 00004 INHINT
033681,000230: 32,3016 04674 TC IBNKCALL
033682,000231: 32,3017 40143 CADR PFLITEDB
033683,000232: 32,3020 00003 RELINT
033684,000233:
033685,000234: 32,3021 04616 TC BANKCALL
033686,000235: 32,3022 54125 CADR R60LEM
033687,000236:
![]() |
Page 775 |
033689,000238: 32,3023 05364 TC PHASCHNG # PREVENT RECALLING R60
033690,000239: 32,3024 04024 OCT 04024
033691,000240:
033692,000241: 32,3025 34746 P63SPOT3 CA BIT6 # IS THE LR ANTENNA IN POSITION 1 YET
033693,000242: 32,3026 00006 EXTEND
033694,000243: 32,3027 02033 RAND CHAN33
033695,000244: 32,3030 00006 EXTEND
033696,000245: 32,3031 13037 BZF P63SPOT4 # BRANCH IF ANTENNA ALREADY IN POSITION 1
033697,000246:
033698,000247: 32,3032 33057 CAF CODE500 # ASTRONAUT: PLEASE CRANK THE
033699,000248: 32,3033 04616 TC BANKCALL # SILLY THING AROUND
033700,000249: 32,3034 20624 CADR GOPERF1
033701,000250: 32,3035 16001 TCF GOTOPOOH # TERMINATE
033702,000251: 32,3036 13025 TCF P63SPOT3 # PROCEED SEE IF HE'S LYING
033703,000252:
033704,000253: 32,3037 34752 P63SPOT4 CAF TWO # ENTER INITIALIZE LANDING RADAR
033705,000254: 32,3040 55674 TS STILBADH
033706,000255: 32,3041 55675 TS STILBADV
033707,000256: 32,3042 34755 CAF ZERO
033708,000257: 32,3043 55670 TS LRLCTR
033709,000258: 32,3044 55672 TS LRMCTR
033710,000259: 32,3045 55671 TS LRRCTR
033711,000260: 32,3046 55673 TS LRSCTR
033712,000261: 32,3047 55462 TS VSELECT
033713,000262:
033714,000263: 32,3050 34753 CAF ONE
033715,000264: 32,3051 55650 TS LRPOS
033716,000265:
033717,000266: 32,3052 34751 CA FOUR # INITIALIZE COUNTER TO ISSUE 511
033718,000267: 32,3053 55622 TS 511CTR # ALARM AFTER 10 SECONDS
033719,000268:
033720,000269: 32,3054 04635 TC POSTJUMP # OFF TO SEE THE WIZARD...
033721,000270: 32,3055 74130 CADR BURNBABY
033722,000271:
033723,000272:
033724,000273: # ----------------------------------------
033725,000274:
033726,000275: # CONSTANTS FOR P63LM AND IGNALG
033727,000276:
033728,000277:
033729,000278: 32,3056 02100 P63ADRES GENADR P63TABLE
033730,000279:
033731,000280:
033732,000281: 32,3057 4362 ASTNDEX = MD1 # OCT 25; INDEX FOR CLOKTASK
033733,000282:
033734,000283:
033735,000284: 32,3057 00500 CODE500 OCT 00500
033736,000285:
033737,000286:
033738,000287: 32,3060 00035 30373 99999CON 2DEC 30479.7 B-24
033739,000288:
![]() |
Page 776 |
033741,000290: 32,3062 00004 01610 GUIDDURN 2DEC +66440 B-28 # GUIDDURN +6.64400314E+ 2
033742,000291:
033743,000292: 32,3064 00000 00010 DDUMCRIT 2DEC +8 B-28 # CRITERION FOR IGNALG CONVERGENCE
033744,000293:
033745,000294:
033746,000295:
033747,000296: 32,3066 00364 HLROFFF DEC 15.24 B-10 # LOADED DP, BUT LOW ORDER DOESN'T MATTER
033748,000297:
033749,000298:
033750,000299: # ----------------------------------------
033751,000300:
![]() |
Page 777 |
033753,000302: # ****************************************
033754,000303: # P68: LANDING CONFIRMATION
033755,000304: # ****************************************
033756,000305:
033757,000306: 34,3271 BANK 34
033758,000307: 34,2000 SETLOC F2DPS*34
033759,000308: 34,2000 BANK
033760,000309:
033761,000310: 34,3271 COUNT* $$/P6567
033762,000311:
033763,000312: 34,3271 05364 LANDJUNK TC PHASCHNG
033764,000313: 34,3272 04024 OCT 04024
033765,000314:
033766,000315: 34,3273 00004 INHINT
033767,000316: 34,3274 04616 TC BANKCALL # ZERO ATTITUDE ERROR
033768,000317: 34,3275 40154 CADR ZATTEROR
033769,000318:
033770,000319: 34,3276 06042 TC INTPRET # TO INTERPRETIVE AS TIME IS NOT CRITICAL
033771,000320: 34,3277 77614 SET # PREVENT RCS JET FIRINGS IF MODE CONT IS
033772,000321: 34,3300 06460 PULSEFLG # IN ATT HOLD
033773,000322: 34,3301 43014 SET CLEAR
033774,000323: 34,3302 04067 SURFFLAG
033775,000324: 34,3303 04666 LETABORT
033776,000325: 34,3304 77214 SET VLOAD
033777,000326: 34,3305 05062 APSFLAG
033778,000327: 34,3306 01220 RN
033779,000328: 34,3307 16032 STODL ALPHAV
033780,000329: 34,3310 01234 PIPTIME
033781,000330: 34,3311 45014 SET CALL
033782,000331: 34,3312 01463 LUNAFLAG
033783,000332: 34,3313 26347 LAT-LONG
033784,000333: 34,3314 77201 SETPD VLOAD # COMPUTE RLS AND STORE IT AWAY
033785,000334: 34,3315 00001 0
033786,000335: 34,3316 01220 RN
033787,000336: 34,3317 65352 VSL2 PDDL
033788,000337: 34,3320 01234 PIPTIME
033789,000338: 34,3321 45006 PUSH CALL
033790,000339: 34,3322 51642 R-TO-RP
033791,000340: 34,3323 02021 STORE RLS
033792,000341: 34,3324 77776 EXIT
033793,000342: 34,3325 33345 CAF V06N43* # ASTRONAUT: NOW LOOK WHERE YOU ENDED UP
033794,000343: 34,3326 04616 TC BANKCALL
033795,000344: 34,3327 20477 CADR GOFLASH
033796,000345: 34,3330 16001 TCF GOTOPOOH # TERMINATE
033797,000346: 34,3331 13333 TCF +2 # PROCEED
033798,000347: 34,3332 13325 TCF -5 # RECYCLE
033799,000348:
033800,000349: 34,3333 06042 TC INTPRET
033801,000350: 34,3334 64375 VLOAD MXV # INITIALIZE GSAV AND (USING REFMF)
![]() |
Page 778 |
033803,000352: 34,3335 01220 RN # YNBSAV, ZNBSAV AND ATTFLAG FOR P57
033804,000353: 34,3336 01732 REFSMMAT
033805,000354: 34,3337 45056 UNIT CALL
033806,000355: 34,3340 47653 CDU*SMNB
033807,000356: 34,3341 36231 STCALL GSAV
033808,000357: 34,3342 33502 REFMF
033809,000358: 34,3343 77776 EXIT
033810,000359:
033811,000360: 34,3344 16001 TCF GOTOPOOH # ASTRONAUT: PLEASE SELECT P57
033812,000361:
033813,000362:
033814,000363: 34,3345 01453 V06N43* VN 0643
End of include-file THE_LUNAR_LANDING.agc. Parent file is MAIN.agc