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