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