Source Code

These source-code files are part of a reconstructed copy of Luminary 97, the second release of the Apollo 11 Lunar Module (LM) Apollo Guidance Computer (AGC) software. It was created to fix two incorrect ephemeris constants in Luminary 96, as described by anomaly report LNY-59.

The reconstruction began with source code of Luminary 99 revision 1 previously transcribed from a digitized copy of that program. The code was then updated by undoing changes described in original Luminary memos 83 and 85, using asterisks indicating changed lines in the listing as a guide. The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152D. Note that page numbers in the reconstructed code match those on the Luminary 099 revision 001 printout, although the added code would likely have changed page numbers for a real Luminary 97 listing.

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.

033538,000002:                                                                                                  ## Copyright:   Public domain.
033539,000003:                                                                                                  ## Filename:    THE_LUNAR_LANDING.agc
033540,000004:                                                                                                  ## Purpose:     A section of Luminary revision 97.
033541,000005:                                                                                                  ##              It is part of the reconstructed source code for the
033542,000006:                                                                                                  ##              second release of the flight software for the Lunar 
033543,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 11.
033544,000008:                                                                                                  ##              It was created to fix two incorrect ephemeris constants in
033545,000009:                                                                                                  ##              Luminary 96, as described by anomaly report LNY-59.
033546,000010:                                                                                                  ##              The code has been recreated from a copy of Luminary 99
033547,000011:                                                                                                  ##              revision 001, using asterisks indicating changed lines in
033548,000012:                                                                                                  ##              the listing and Luminary Memos #83 and #85, which list 
033549,000013:                                                                                                  ##              changes between Luminary 97 and 98, and 98 and 99. The
033550,000014:                                                                                                  ##              code has been adapted such that the resulting bugger words
033551,000015:                                                                                                  ##              exactly match those specified for Luminary 97 in NASA drawing
033552,000016:                                                                                                  ##              2021152D, which gives relatively high confidence that the
033553,000017:                                                                                                  ##              reconstruction is correct.
033554,000018:                                                                                                  ## Reference:   pp. 785-792
033555,000019:                                                                                                  ## Assembler:   yaYUL
033556,000020:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
033557,000021:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
033558,000022:                                                                                                  ## Mod history: 2019-07-28 MAS  Created from Luminary 99.
033559,000023: 

Page 785

033561,000025: 32,2776                                           BANK     32                                    
033562,000026: 32,2000                                           SETLOC   F2DPS*32                              
033563,000027: 32,2000                                           BANK                                           
033564,000028: 
033565,000029: 32,2776  E7,1621                                  EBANK=   E2DPS                                 
033566,000030: 
033567,000031:                                                                                                  #        ****************************************
033568,000032:                                                                                                  #        P63: THE LUNAR LANDING, BRAKING PHASE
033569,000033:                                                                                                  #        ****************************************
033570,000034: 
033571,000035: 32,2776                                           COUNT*   $$/P63                                
033572,000036: 
033573,000037: 32,2776           05353        P63LM              TC       PHASCHNG                              
033574,000038: 32,2777           04024                           OCT      04024                                 
033575,000039: 
033576,000040: 32,3000           04616                           TC       BANKCALL                              #  DO IMU STATUS CHECK ROUTINE R02
033577,000041: 32,3001           11254                           CADR     R02BOTH                               
033578,000042: 
033579,000043: 32,3002           33253                           CAF      P63ADRES                              #  INITIALIZE WHICH FOR BURNBABY
033580,000044: 32,3003           55455                           TS       WHICH                                 
033581,000045: 
033582,000046: 32,3004           32000                           CAF      DPSTHRSH                              #  INITIALIZE DVMON
033583,000047: 32,3005           55251                           TS       DVTHRUSH                              
033584,000048: 32,3006           34751                           CAF      FOUR                                  
033585,000049: 32,3007           55515                           TS       DVCNTR                                
033586,000050: 
033587,000051: 32,3010           44753                           CS       ONE                                   #  INITIALIZE WCHPHASE AND FLPASSO
033588,000052: 32,3011           55351                           TS       WCHPHASE                              
033589,000053: 
033590,000054: 32,3012           34755                           CA       ZERO                                  
033591,000055: 32,3013           55623                           TS       FLPASS0                               
033592,000056: 
033593,000057: 32,3014           44736                           CS       BIT14                                 
033594,000058: 32,3015           00006                           EXTEND                                         
033595,000059: 32,3016           03012                           WAND     CHAN12                                #  REMOVE TRACK-ENABLE DISCRETE.
033596,000060: 
033597,000061: 32,3017           06037        FLAGORGY           TC       INTPRET                               #  DIONYSIAN FLAG WAVING
033598,000062: 32,3020           43014                           CLEAR    CLEAR                                 
033599,000063: 32,3021           02663                                    NOTHROTL                              
033600,000064: 32,3022           03271                                    REDFLAG                               
033601,000065: 32,3023           43014                           CLEAR    SET                                   
033602,000066: 32,3024           05660                                    LRBYPASS                              
033603,000067: 32,3025           03067                                    MUNFLAG                               
033604,000068: 32,3026           43014                           CLEAR    CLEAR                                 
033605,000069: 32,3027           00266                                    P25FLAG                               #  TERMINATE P25 IF IT IS RUNNING.
033606,000070: 32,3030           00270                                    RNDVZFLG                              #  TERMINATE P20 IF IT IS RUNNING
033607,000071: 
033608,000072:                                                                                                  #  ****************************************
033609,000073: 
033610,000074: 32,3031           77201        IGNALG             SETPD    VLOAD                                 #  FIRST SET UP INPUTS FOR RP-TO-R:-

Page 786

033612,000076: 32,3032           00001                                    0                                     #        AT 0D LANDING SITE IN MOON FIXED FRAME
033613,000077: 32,3033           02023                                    RLS                                   #        AT 6D ESTIMATED TIME OF LANDING
033614,000078: 32,3034           41525                           PDDL     PUSH                                  #        MPAC NON-ZERO TO INDICATE LUNAR CASE
033615,000079: 32,3035           02401                                    TLAND                                 
033616,000080: 32,3036           37625                           STCALL   TPIP                                  #  ALSO SET TPIP FOR FIRST GUIDANCE PASS
033617,000081: 32,3037           55716                                    RP-TO-R                               
033618,000082: 32,3040           64312                           VSL4     MXV                                   
033619,000083: 32,3041           01734                                    REFSMMAT                              
033620,000084: 32,3042           37635                           STCALL   LAND                                  
033621,000085: 32,3043           46432                                    GUIDINIT                              #  GUIDINIT INITIALIZES WM AND /LAND/
033622,000086: 32,3044           45345                           DLOAD    DSU                                   
033623,000087: 32,3045           02401                                    TLAND                                 
033624,000088: 32,3046           25260                                    GUIDDURN                              
033625,000089: 32,3047           34041                           STCALL   TDEC1                                 #  INTEGRATE STATE FORWARD TO THAT TIME
033626,000090: 32,3050           27057                                    LEMPREC                               
033627,000091: 32,3051           77331                           SSP      VLOAD                                 
033628,000092: 32,3052           03647                                    NIGNLOOP                              
033629,000093: 32,3053           00050                                    40D                                   
033630,000094: 32,3054           06520                                    UNITX                                 
033631,000095: 32,3055           26603                           STOVL    CG                                    
033632,000096: 32,3056           06516                                    UNITY                                 
033633,000097: 32,3057           26611                           STOVL    CG         +6                         
033634,000098: 32,3060           06514                                    UNITZ                                 
033635,000099: 32,3061           16617                           STODL    CG         +14                        
033636,000100: 32,3062           25256                                    99999CON                              
033637,000101: 32,3063           27665                           STOVL    DELTAH                                #  INITIALIZE DELTAH FOR V16N68 DISPLAY
033638,000102: 32,3064           06522                                    ZEROVECS                              
033639,000103: 32,3065           17254                           STODL    UNFC/2                                #  INITIALIZE TRIM VELOCITY CORRECTION TERM
033640,000104: 32,3066           06522                                    HI6ZEROS                              
033641,000105: 32,3067           03643                           STORE    TTF/8                                 
033642,000106: 
033643,000107: 32,3070           77745        IGNALOOP           DLOAD                                          
033644,000108: 32,3071           00015                                    TAT                                   
033645,000109: 32,3072           27561                           STOVL    PIPTIME1                              
033646,000110: 32,3073           00017                                    RATT1                                 
033647,000111: 32,3074           64312                           VSL4     MXV                                   
033648,000112: 32,3075           01734                                    REFSMMAT                              
033649,000113: 32,3076           37521                           STCALL   R                                     
033650,000114: 32,3077           67130                                    MUNGRAV                               
033651,000115: 32,3100           35237                           STCALL   GDT/2                                 
033652,000116: 32,3101           62454                                    ?GUIDSUB                              #  WHICH DELIVERS N PASSES OF GUIDANCE
033653,000117: 
033654,000118:                                                                                                  #  DDUMCALC IS PROGRAMMED AS FOLLOWS:-
033655,000119:                                                                                                  #                                          2                                           -
033656,000120:                                                                                                  #               (RIGNZ - RGU )/16 + 16(RGU  )KIGNY/B8 + (RGU - RIGNX)KIGNX/B4 + (ABVAL(VGU) - VIGN)KIGNV/B4
033657,000121:                                                                                                  #                           2             1                 0
033658,000122:                                                                                                  #        DDUM = -------------------------------------------------------------------------------------------
033659,000123:                                                                                                  #                                                 10
033660,000124:                                                                                                  #                                                2   (VGU - 16 VGU KIGNX/B4)

Page 787

033662,000126:                                                                                                  #                                                        2        0
033663,000127:                                                                                                  #  THE NUMERATOR IS SCALED IN METERS AT 2(28).  THE DENOMINATOR IS A VELOCITY IN UNITS OF 2(10) M/CS.
033664,000128:                                                                                                  #  THE QUOTIENT IS THUS A TIME IN UNITS OF 2(18) CENTISECONDS.  THE FINAL SHIFT RESCALES TO UNITS OF 2(28) CS.
033665,000129:                                                                                                  #  THERE IS NO DAMPING FACTOR.  THE CONSTANTS KIGNX/B4, KIGNY/B8 AND KIGNV/B4 ARE ALL NEGATIVE IN SIGN.
033666,000130: 
033667,000131: 32,3102           55646        DDUMCALC           TS       NIGNLOOP                              
033668,000132: 32,3103           06037                           TC       INTPRET                               
033669,000133: 32,3104           57345                           DLOAD    DMPR                                  #  FORM DENOMINATOR FIRST
033670,000134: 32,3105           03627                                    VGU                                   
033671,000135: 32,3106           02501                                    KIGNX/B4                              
033672,000136: 32,3107           44232                           SL4R     BDSU                                  
033673,000137: 32,3110           03633                                    VGU        +4                         
033674,000138: 32,3111           45325                           PDDL     DSU                                   
033675,000139: 32,3112           02477                                    RIGNZ                                 
033676,000140: 32,3113           02643                                    RGU        +4                         
033677,000141: 32,3114           65222                           SR4R     PDDL                                  
033678,000142: 32,3115           02641                                    RGU        +2                         
033679,000143: 32,3116           57316                           DSQ      DMPR                                  
033680,000144: 32,3117           02503                                    KIGNY/B8                              
033681,000145: 32,3120           65232                           SL4R     PDDL                                  
033682,000146: 32,3121           02637                                    RGU                                   
033683,000147: 32,3122           57225                           DSU      DMPR                                  
033684,000148: 32,3123           02475                                    RIGNX                                 
033685,000149: 32,3124           02501                                    KIGNX/B4                              
033686,000150: 32,3125           51515                           PDVL     ABVAL                                 
033687,000151: 32,3126           03627                                    VGU                                   
033688,000152: 32,3127           57225                           DSU      DMPR                                  
033689,000153: 32,3130           02473                                    VIGN                                  
033690,000154: 32,3131           02505                                    KIGNV/B4                              
033691,000155: 32,3132           43215                           DAD      DAD                                   
033692,000156: 32,3133           56215                           DAD      DDV                                   
033693,000157: 32,3134           77661                           SRR                                            
033694,000158: 32,3135           21613                                    10D                                   
033695,000159: 
033696,000160: 32,3136           43206                           PUSH     DAD                                   
033697,000161: 32,3137           03561                                    PIPTIME1                              
033698,000162: 32,3140           14041                           STODL    TDEC1                                 #  STORE NEW GUESS FOR NEXT INTEGRATION
033699,000163: 32,3141           45246                           ABS      DSU                                   
033700,000164: 32,3142           25262                                    DDUMCRIT                              
033701,000165: 32,3143           45040                           BMN      CALL                                  
033702,000166: 32,3144           65163                                    DDUMGOOD                              
033703,000167: 32,3145           27414                                    INTSTALL                              
033704,000168: 32,3146           43014                           SET      SET                                   
033705,000169: 32,3147           01473                                    INTYPFLG                              
033706,000170: 32,3150           00063                                    MOONFLAG                              
033707,000171: 32,3151           77745                           DLOAD                                          
033708,000172: 32,3152           03561                                    PIPTIME1                              
033709,000173: 32,3153           25517                           STOVL    TET                                   #  HOPEFULLY ?GUIDSUB DID NOT
033710,000174: 32,3154           00017                                    RATT1                                 #        CLOBBER RATT1 AND VATT1

Page 788

033712,000176: 32,3155           25535                           STOVL    RCV                                   
033713,000177: 32,3156           00025                                    VATT1                                 
033714,000178: 32,3157           35543                           STCALL   VCV                                   
033715,000179: 32,3160           27107                                    INTEGRVS                              
033716,000180: 32,3161           77650                           GOTO                                           
033717,000181: 32,3162           65070                                    IGNALOOP                              
033718,000182: 
033719,000183: 32,3163           54335        DDUMGOOD           SLOAD    SR                                    
033720,000184: 32,3164           03423                                    ZOOMTIME                              
033721,000185: 32,3165           20617                                    14D                                   
033722,000186: 32,3166           77621                           BDSU                                           
033723,000187: 32,3167           00041                                    TDEC1                                 
033724,000188: 32,3170           27442                           STOVL    TIG                                   #  COMPUTE DISTANCE LANDING SITE WILL BE
033725,000189: 32,3171           03527                                    V                                     #        OUT OF LM'S ORBITAL PLANE AT IGNITION:
033726,000190: 32,3172           53435                           VXV      UNIT                                  #        SIGN IS + IF LANDING SITE IS TO THE
033727,000191: 32,3173           03521                                    R                                     #        RIGHT, NORTH; - IF TO THE LEFT, SOUTH.
033728,000192: 32,3174           72441                           DOT      SL1                                   
033729,000193: 32,3175           03635                                    LAND                                  
033730,000194: 32,3176           26627        R60INIT            STOVL    OUTOFPLN                              #  INITIALIZATION FOR CALCMANU
033731,000195: 32,3177           03254                                    UNFC/2                                
033732,000196: 32,3200           02631                           STORE    R60VSAVE                              #  STORE UNFC/2 TEMPORARILY IN R60SAVE
033733,000197: 32,3201           77776                           EXIT                                           
033734,000198:                                                                                                  #  ****************************************
033735,000199: 
033736,000200: 32,3202           05353        IGNALGRT           TC       PHASCHNG                              #  PREVENT REPEATING IGNALG
033737,000201: 32,3203           04024                           OCT      04024                                 
033738,000202: 
033739,000203: 32,3204           44362        ASTNCLOK           CS       ASTNDEX                               
033740,000204: 32,3205           04616                           TC       BANKCALL                              
033741,000205: 32,3206           74664                           CADR     STCLOK2                               
033742,000206: 32,3207           15155                           TCF      ENDOFJOB                              #  RETURN IN NEW JOB AND IN EBANK FIVE
033743,000207: 
033744,000208: 32,3210           06037        ASTNRET            TC       INTPRET                               
033745,000209: 32,3211           47131                           SSP      RTB                                   #  GO PICK UP DISPLAY AT END OF R51:
033746,000210: 32,3212           02747                                    QMAJ                                  #        "PROCEED" WILL DO A FINE ALIGNMENT
033747,000211: 32,3213           65215                           FCADR    P63SPOT2                              #        "ENTER" WILL RETURN TO P63SPOT2
033748,000212: 32,3214           31135                                    R51P63                                
033749,000213: 32,3215           53575        P63SPOT2           VLOAD    UNIT                                  #  INITIALIZE KALCMANU FOR BURN ATTITUDE
033750,000214: 32,3216           02631                                    R60VSAVE                              
033751,000215: 32,3217           27773                           STOVL    POINTVSM                              
033752,000216: 32,3220           06520                                    UNITX                                 
033753,000217: 32,3221           03765                           STORE    SCAXIS                                
033754,000218: 32,3222           77776                           EXIT                                           
033755,000219: 
033756,000220: 32,3223           35016                           CAF      EBANK7                                
033757,000221: 32,3224           54003                           TS       EBANK                                 
033758,000222: 
033759,000223: 32,3225           00004                           INHINT                                         
033760,000224: 32,3226           04674                           TC       IBNKCALL                              
033761,000225: 32,3227           40142                           CADR     PFLITEDB                              

Page 789

033763,000227: 32,3230           00003                           RELINT                                         
033764,000228: 
033765,000229: 32,3231           04616                           TC       BANKCALL                              
033766,000230: 32,3232           54123                           CADR     R60LEM                                
033767,000231: 
033768,000232: 32,3233           05353                           TC       PHASCHNG                              #  PREVENT RECALLING R60
033769,000233: 32,3234           04024                           OCT      04024                                 
033770,000234: 
033771,000235: 32,3235           34746        P63SPOT3           CA       BIT6                                  #  IS THE LR ANTENNA IN POSITION 1 YET
033772,000236: 32,3236           00006                           EXTEND                                         
033773,000237: 32,3237           02033                           RAND     CHAN33                                
033774,000238: 32,3240           00006                           EXTEND                                         
033775,000239: 32,3241           13247                           BZF      P63SPOT4                              #  BRANCH IF ANTENNA ALREADY IN POSITION 1
033776,000240: 
033777,000241: 32,3242           33254                           CAF      CODE500                               #  ASTRONAUT:    PLEASE CRANK THE
033778,000242: 32,3243           04616                           TC       BANKCALL                              #                SILLY THING AROUND
033779,000243: 32,3244           20623                           CADR     GOPERF1                               
033780,000244: 32,3245           16001                           TCF      GOTOPOOH                              #  TERMINATE
033781,000245: 32,3246           13235                           TCF      P63SPOT3                              #  PROCEED       SEE IF HE'S LYING
033782,000246: 
033783,000247: 32,3247           04616        P63SPOT4           TC       BANKCALL                              #  ENTER         INITIALIZE LANDING RADAR
033784,000248: 32,3250           67701                           CADR     SETPOS1                               
033785,000249: 
033786,000250: 32,3251           04635                           TC       POSTJUMP                              #  OFF TO SEE THE WIZARD ...
033787,000251: 32,3252           74126                           CADR     BURNBABY                              
033788,000252: 
033789,000253:                                                                                                  #        ----------------------------------------
033790,000254: 
033791,000255:                                                                                                  #  CONSTANTS FOR P63LM AND IGNALG
033792,000256: 
033793,000257: 32,3253           02076        P63ADRES           GENADR   P63TABLE                              
033794,000258: 
033795,000259: 32,3254     4362               ASTNDEX            =        MD1                                   #  OCT 25; INDEX FOR CLOKTASK
033796,000260: 
033797,000261: 32,3254           00500        CODE500            OCT      00500                                 
033798,000262: 
033799,000263: 32,3255           00035 30373  99999CON           2DEC     30479.7    B-24                       
033800,000264: 
033801,000265: 32,3257           00004 01610  GUIDDURN           2DEC     +66440     B-28                       #  GUIDDURN +6.64400314 E+2
033802,000266: 32,3261           00000 00010  DDUMCRIT           2DEC     +8         B-28                       #  CRITERION FOR IGNALG CONVERGENCE
033803,000267: 

Page 790

033805,000269:                                                                                                  #        ----------------------------------------
033806,000270: 

Page 791

033808,000272:                                                                                                  #        ****************************************
033809,000273:                                                                                                  #        P68: LANDING CONFIRMATION
033810,000274:                                                                                                  #        ****************************************
033811,000275: 
033812,000276: 31,2144                                           BANK     31                                    
033813,000277: 31,2000                                           SETLOC   F2DPS*31                              
033814,000278: 31,2000                                           BANK                                           
033815,000279: 
033816,000280: 31,2144                                           COUNT*   $$/P6567                              
033817,000281: 
033818,000282: 31,2144           05353        LANDJUNK           TC       PHASCHNG                              
033819,000283: 31,2145           04024                           OCT      04024                                 
033820,000284: 
033821,000285: 31,2146           00004                           INHINT                                         
033822,000286: 31,2147           04616                           TC       BANKCALL                              #  ZERO ATTITUDE ERROR
033823,000287: 31,2150           40153                           CADR     ZATTEROR                              
033824,000288: 
033825,000289: 31,2151           04616                           TC       BANKCALL                              #  SET 5 DEGREE DEADBAND
033826,000290: 31,2152           40127                           CADR     SETMAXDB                              
033827,000291: 
033828,000292: 31,2153           06037                           TC       INTPRET                               #  TO INTERPRETIVE AS TIME IS NOT CRITICAL
033829,000293: 31,2154           43014                           SET      CLEAR                                 
033830,000294: 31,2155           04067                                    SURFFLAG                              
033831,000295: 31,2156           04666                                    LETABORT                              
033832,000296: 31,2157           77214                           SET      VLOAD                                 
033833,000297: 31,2160           05062                                    APSFLAG                               
033834,000298: 31,2161           01221                                    RN                                    
033835,000299: 31,2162           16032                           STODL    ALPHAV                                
033836,000300: 31,2163           01235                                    PIPTIME                               
033837,000301: 31,2164           45014                           SET      CALL                                  
033838,000302: 31,2165           01463                                    LUNAFLAG                              
033839,000303: 31,2166           26351                                    LAT-LONG                              
033840,000304: 31,2167           77201                           SETPD    VLOAD                                 #  COMPUTE RLS AND STORE IT AWAY
033841,000305: 31,2170           00001                                    0                                     
033842,000306: 31,2171           01221                                    RN                                    
033843,000307: 31,2172           65352                           VSL2     PDDL                                  
033844,000308: 31,2173           01235                                    PIPTIME                               
033845,000309: 31,2174           45006                           PUSH     CALL                                  
033846,000310: 31,2175           51670                                    R-TO-RP                               
033847,000311: 31,2176           02023                           STORE    RLS                                   
033848,000312: 31,2177           77776                           EXIT                                           
033849,000313: 31,2200           32215                           CAF      V06N43*                               #  ASTRONAUT:  NOW LOOK WHERE YOU ENDED UP
033850,000314: 31,2201           04616                           TC       BANKCALL                              
033851,000315: 31,2202           20476                           CADR     GOFLASH                               
033852,000316: 31,2203           16001                           TCF      GOTOPOOH                              #  TERMINATE
033853,000317: 31,2204           12206                           TCF      +2                                    #  PROCEED
033854,000318: 31,2205           12200                           TCF      -5                                    #  RECYCLE
033855,000319: 
033856,000320: 31,2206           06037                           TC       INTPRET                               

Page 792

033858,000322: 31,2207           77775                           VLOAD                                          #  INITIALIZE GSAV AND (USING REFMF)
033859,000323: 31,2210           06520                                    UNITX                                 #  YNBSAV, ZNBSAV AND ATTFLAG FOR P57
033860,000324: 31,2211           36231                           STCALL   GSAV                                  
033861,000325: 31,2212           33506                                    REFMF                                 
033862,000326: 31,2213           77776                           EXIT                                           
033863,000327: 
033864,000328: 31,2214           16001                           TCF      GOTOPOOH                              #  ASTRONAUT:  PLEASE SELECT P57
033865,000329: 
033866,000330: 31,2215           01453        V06N43*            VN       0643                                  
033867,000331: 

End of include-file THE_LUNAR_LANDING.agc.  Parent file is MAIN.agc