Source Code

These source-code files are part of a reconstructed copy of Luminary 69/2, the flown, final release of the Apollo 10 Lunar Module (LM) Apollo Guidance Computer (AGC) software.

The reconstruction is based on the source code of Luminary 69 — i.e., the initial, unflown version, "revision 0" — of which a contemporary listing was available. The code was then updated by incorporating the differences between Luminary 69 and Luminary 69/2, known from other contemporary documentation. The only such difference is the implementation in Luminary 69/2 of the "R-2 Lunar Potential Model", the source code for which was taken from program Luminary 99/1 (Apollo 11 LM), of which a contemporary listing was also available. Finally, the now-reconstructed Luminary 69/2 was then validated by assembling it to executable form and verifying that its memory banks had the correct checksums, known from still other contemporary documentation.

Note that page numbers in the reconstructed code match those in the original Luminary 69 program listing, or in the ORBITAL INTEGRATION log section, in Luminary 99/1. Page numbers would certainly differ somewhat in a contemporary Luminary 69/2 listing. Moreover, annotations that were not present in the contemporary source code have been added to the reconstructed code to justify each change in Luminary 69/2 relative to Luminary 69. Here's a guide to the Apollo documentation referenced in those annotations:
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.

034501,000002:                                                                                                  ## Copyright:   Public domain.
034502,000003:                                                                                                  ## Filename:    THE_LUNAR_LANDING.agc
034503,000004:                                                                                                  ## Purpose:     A section of LUM69 revision 2.
034504,000005:                                                                                                  ##              It is part of the reconstructed source code for the flown
034505,000006:                                                                                                  ##              version of the flight software for the Lunar Module's (LM)
034506,000007:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 10. The code has
034507,000008:                                                                                                  ##              been recreated from a copy of Luminary revsion 069, using
034508,000009:                                                                                                  ##              changes present in Luminary 099 which were described in
034509,000010:                                                                                                  ##              Luminary memos 75 and 78. The code has been adapted such
034510,000011:                                                                                                  ##              that the resulting bugger words exactly match those specified
034511,000012:                                                                                                  ##              for LUM69 revision 2 in NASA drawing 2021152B, which gives
034512,000013:                                                                                                  ##              relatively high confidence that the reconstruction is correct.
034513,000014:                                                                                                  ## Reference:   pp. 789-796
034514,000015:                                                                                                  ## Assembler:   yaYUL
034515,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
034516,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
034517,000018:                                                                                                  ## Mod history: 2019-07-27 MAS  Created from Luminary 69.
034518,000019: 

Page 789

034520,000021: 32,2772                                           BANK     32                                    
034521,000022: 32,2000                                           SETLOC   F2DPS*32                              
034522,000023: 32,2000                                           BANK                                           
034523,000024: 
034524,000025: 32,2772  E7,1617                                  EBANK=   E2DPS                                 
034525,000026: 
034526,000027:                                                                                                  #        ****************************************
034527,000028:                                                                                                  #        P63: THE LUNAR LANDING, BRAKING PHASE
034528,000029:                                                                                                  #        ****************************************
034529,000030: 
034530,000031: 32,2772                                           COUNT*   $$/P63                                
034531,000032: 
034532,000033: 32,2772           05353        P63LM              TC       PHASCHNG                              
034533,000034: 32,2773           04024                           OCT      04024                                 
034534,000035: 
034535,000036: 32,2774           04616                           TC       BANKCALL                              #  DO IMU STATUS CHECK ROUTINE R02
034536,000037: 32,2775           11175                           CADR     R02BOTH                               
034537,000038: 
034538,000039: 32,2776           33246                           CAF      P63ADRES                              #  INITIALIZE WHICH FOR BURNBABY
034539,000040: 32,2777           55453                           TS       WHICH                                 
034540,000041: 
034541,000042: 32,3000           32010                           CAF      DPSTHRSH                              #  INITIALIZE DVMON
034542,000043: 32,3001           55251                           TS       DVTHRUSH                              
034543,000044: 32,3002           34751                           CAF      FOUR                                  
034544,000045: 32,3003           55513                           TS       DVCNTR                                
034545,000046: 
034546,000047: 32,3004           44753                           CS       ONE                                   #  INITIALIZE WCHPHASE AND FLPASSO
034547,000048: 32,3005           22007                           ZL                                             #    FOR IGNITION ALGORITHM
034548,000049: 32,3006           53621                           DXCH     WCHPHASE                              
034549,000050: 
034550,000051: 
034551,000052: 32,3007           44736                           CS       BIT14                                 
034552,000053: 32,3010           00006                           EXTEND                                         
034553,000054: 32,3011           03012                           WAND     CHAN12                                #  REMOVE TRACK-ENABLE DISCRETE.
034554,000055: 
034555,000056: 32,3012           06036        FLAGORGY           TC       INTPRET                               #  DIONYSIAN FLAG WAVING
034556,000057: 32,3013           43014                           CLEAR    CLEAR                                 
034557,000058: 32,3014           02663                                    NOTHROTL                              
034558,000059: 32,3015           03271                                    REDFLAG                               
034559,000060: 32,3016           43014                           CLEAR    SET                                   
034560,000061: 32,3017           05660                                    LRBYPASS                              
034561,000062: 32,3020           03067                                    MUNFLAG                               
034562,000063: 32,3021           43014                           CLEAR    CLEAR                                 
034563,000064: 32,3022           00266                                    P25FLAG                               #  TERMINATE P25 IF IT IS RUNNING.
034564,000065: 32,3023           00270                                    RNDVZFLG                              #  TERMINATE P20 IF IT IS RUNNING
034565,000066: 
034566,000067:                                                                                                  #  ****************************************
034567,000068: 
034568,000069: 32,3024           77201        IGNALG             SETPD    VLOAD                                 #  FIRST SET UP INPUTS FOR RP-TO-R:-
034569,000070: 32,3025           00001                                    0                                     #        AT 0D LANDING SITE IN MOON FIXED FRAME
034570,000071: 32,3026           02023                                    RLS                                   #        AT 6D ESTIMATED TIME OF LANDING

Page 790

034572,000073: 32,3027           41525                           PDDL     PUSH                                  #        MPAC NON-ZERO TO INDICATE LUNAR CASE
034573,000074: 32,3030           02401                                    TLAND                                 
034574,000075: 32,3031           37623                           STCALL   TPIP                                  #  ALSO SET TPIP FOR FIRST GUIDANCE PASS
034575,000076: 32,3032           51504                                    RP-TO-R                               
034576,000077: 32,3033           64312                           VSL4     MXV                                   
034577,000078: 32,3034           01734                                    REFSMMAT                              
034578,000079: 32,3035           37633                           STCALL   LAND                                  
034579,000080: 32,3036           60264                                    GUIDINIT                              #  GUIDINIT INITIALIZES WM AND /LAND/
034580,000081: 32,3037           45345                           DLOAD    DSU                                   
034581,000082: 32,3040           02401                                    TLAND                                 
034582,000083: 32,3041           25254                                    GUIDDURN                              
034583,000084: 32,3042           34041                           STCALL   TDEC1                                 #  INTEGRATE STATE FORWARD TO THAT TIME
034584,000085: 32,3043           27057                                    LEMPREC                               
034585,000086: 32,3044           77331                           SSP      VLOAD                                 
034586,000087: 32,3045           03645                                    NIGNLOOP                              
034587,000088: 32,3046           00050                                    40D                                   
034588,000089: 32,3047           06422                                    UNITX                                 
034589,000090: 32,3050           26510                           STOVL    CG                                    
034590,000091: 32,3051           06420                                    UNITY                                 
034591,000092: 32,3052           26516                           STOVL    CG         +6                         
034592,000093: 32,3053           06416                                    UNITZ                                 
034593,000094: 32,3054           16524                           STODL    CG         +14                        
034594,000095: 32,3055           25252                                    99999CON                              
034595,000096: 32,3056           27663                           STOVL    DELTAH                                #  INITIALIZE DELTAH FOR V16N68 DISPLAY
034596,000097: 32,3057           06424                                    ZEROVECS                              
034597,000098: 32,3060           17252                           STODL    UNFC/2                                #  INITIALIZE TRIM VELOCITY CORRECTION TERM
034598,000099: 32,3061           06424                                    HI6ZEROS                              
034599,000100: 32,3062           03641                           STORE    TTF/8                                 
034600,000101: 
034601,000102: 32,3063           77745        IGNALOOP           DLOAD                                          
034602,000103: 32,3064           00015                                    TAT                                   
034603,000104: 32,3065           27557                           STOVL    PIPTIME1                              
034604,000105: 32,3066           00017                                    RATT1                                 
034605,000106: 32,3067           64312                           VSL4     MXV                                   
034606,000107: 32,3070           01734                                    REFSMMAT                              
034607,000108: 32,3071           37517                           STCALL   R                                     
034608,000109: 32,3072           67162                                    MUNGRAV                               
034609,000110: 32,3073           35237                           STCALL   GDT/2                                 
034610,000111: 32,3074           62514                                    ?GUIDSUB                              #  WHICH DELIVERS N PASSES OF GUIDANCE
034611,000112: 
034612,000113:                                                                                                  #  DDUMCALC IS PROGRAMMED AS FOLLOWS:-
034613,000114:                                                                                                  #                                          2                                           -
034614,000115:                                                                                                  #               (RIGNZ - RGU )/16 + 16(RGU  )KIGNY/B8 + (RGU - RIGNX)KIGNX/B4 + (ABVAL(VGU) - VIGN)KIGNV/B4
034615,000116:                                                                                                  #                           2             1                 0
034616,000117:                                                                                                  #        DDUM = -------------------------------------------------------------------------------------------
034617,000118:                                                                                                  #                                                 10
034618,000119:                                                                                                  #                                                2   (VGU - 16 VGU KIGNX/B4)
034619,000120:                                                                                                  #                                                        2        0

Page 791

034621,000122:                                                                                                  #  THE NUMERATOR IS SCALED IN METERS AT 2(28).  THE DENOMINATOR IS A VELOCITY IN UNITS OF 2(10) M/CS.
034622,000123:                                                                                                  #  THE QUOTIENT IS THUS A TIME IN UNITS OF 2(18) CENTISECONDS.  THE FINAL SHIFT RESCALES TO UNITS OF 2(28) CS.
034623,000124:                                                                                                  #  THERE IS NO DAMPING FACTOR.  THE CONSTANTS KIGNX/B4, KIGNY/B8 AND KIGNV/B4 ARE ALL NEGATIVE IN SIGN.
034624,000125: 
034625,000126: 32,3075           55644        DDUMCALC           TS       NIGNLOOP                              
034626,000127: 32,3076           06036                           TC       INTPRET                               
034627,000128: 32,3077           57345                           DLOAD    DMPR                                  #  FORM DENOMINATOR FIRST
034628,000129: 32,3100           03625                                    VGU                                   
034629,000130: 32,3101           02471                                    KIGNX/B4                              
034630,000131: 32,3102           44232                           SL4R     BDSU                                  
034631,000132: 32,3103           03631                                    VGU        +4                         
034632,000133: 32,3104           45325                           PDDL     DSU                                   
034633,000134: 32,3105           02467                                    RIGNZ                                 
034634,000135: 32,3106           02550                                    RGU        +4                         
034635,000136: 32,3107           65222                           SR4R     PDDL                                  
034636,000137: 32,3110           02546                                    RGU        +2                         
034637,000138: 32,3111           57316                           DSQ      DMPR                                  
034638,000139: 32,3112           02473                                    KIGNY/B8                              
034639,000140: 32,3113           65232                           SL4R     PDDL                                  
034640,000141: 32,3114           02544                                    RGU                                   
034641,000142: 32,3115           57225                           DSU      DMPR                                  
034642,000143: 32,3116           02465                                    RIGNX                                 
034643,000144: 32,3117           02471                                    KIGNX/B4                              
034644,000145: 32,3120           51515                           PDVL     ABVAL                                 
034645,000146: 32,3121           03625                                    VGU                                   
034646,000147: 32,3122           57225                           DSU      DMPR                                  
034647,000148: 32,3123           02463                                    VIGN                                  
034648,000149: 32,3124           02475                                    KIGNV/B4                              
034649,000150: 32,3125           43215                           DAD      DAD                                   
034650,000151: 32,3126           56215                           DAD      DDV                                   
034651,000152: 32,3127           77661                           SRR                                            
034652,000153: 32,3130           21613                                    10D                                   
034653,000154: 
034654,000155: 32,3131           43206                           PUSH     DAD                                   
034655,000156: 32,3132           03557                                    PIPTIME1                              
034656,000157: 32,3133           14041                           STODL    TDEC1                                 #  STORE NEW GUESS FOR NEXT INTEGRATION
034657,000158: 32,3134           45246                           ABS      DSU                                   
034658,000159: 32,3135           25256                                    DDUMCRIT                              
034659,000160: 32,3136           45040                           BMN      CALL                                  
034660,000161: 32,3137           65156                                    DDUMGOOD                              
034661,000162: 32,3140           27412                                    INTSTALL                              
034662,000163: 32,3141           43014                           SET      SET                                   
034663,000164: 32,3142           01473                                    INTYPFLG                              
034664,000165: 32,3143           00063                                    MOONFLAG                              
034665,000166: 32,3144           77745                           DLOAD                                          
034666,000167: 32,3145           03557                                    PIPTIME1                              
034667,000168: 32,3146           25517                           STOVL    TET                                   #  HOPEFULLY ?GUIDSUB DID NOT
034668,000169: 32,3147           00017                                    RATT1                                 #        CLOBBER RATT1 AND VATT1
034669,000170: 32,3150           25535                           STOVL    RCV                                   
034670,000171: 32,3151           00025                                    VATT1                                 

Page 792

034672,000173: 32,3152           35543                           STCALL   VCV                                   
034673,000174: 32,3153           27107                                    INTEGRVS                              
034674,000175: 32,3154           77650                           GOTO                                           
034675,000176: 32,3155           65063                                    IGNALOOP                              
034676,000177: 
034677,000178: 32,3156           54335        DDUMGOOD           SLOAD    SR                                    
034678,000179: 32,3157           03425                                    ZOOMTIME                              
034679,000180: 32,3160           20617                                    14D                                   
034680,000181: 32,3161           77621                           BDSU                                           
034681,000182: 32,3162           00041                                    TDEC1                                 
034682,000183: 32,3163           27440                           STOVL    TIG                                   #  COMPUTE DISTANCE LANDING SITE WILL BE
034683,000184: 32,3164           03525                                    V                                     #        OUT OF LM'S ORBITAL PLANE AT IGNITION:
034684,000185: 32,3165           53435                           VXV      UNIT                                  #        SIGN IS + IF LANDING SITE IS TO THE
034685,000186: 32,3166           03517                                    R                                     #        RIGHT, NORTH; - IF TO THE LEFT, SOUTH.
034686,000187: 32,3167           72441                           DOT      SL1                                   
034687,000188: 32,3170           03633                                    LAND                                  
034688,000189: 32,3171           26534        R60INIT            STOVL    OUTOFPLN                              #  INITIALIZATION FOR CALCMANU
034689,000190: 32,3172           03252                                    UNFC/2                                
034690,000191: 32,3173           02536                           STORE    R60VSAVE                              #  STORE UNFC/2 TEMPORARILY IN R60SAVE
034691,000192: 32,3174           77776                           EXIT                                           
034692,000193:                                                                                                  #  ****************************************
034693,000194: 
034694,000195: 32,3175           05353        IGNALGRT           TC       PHASCHNG                              #  PREVENT REPEATING IGNALG
034695,000196: 32,3176           04024                           OCT      04024                                 
034696,000197: 
034697,000198: 32,3177           43247        ASTNCLOK           CS       ASTNDEX                               
034698,000199: 32,3200           04616                           TC       BANKCALL                              
034699,000200: 32,3201           74667                           CADR     STCLOK2                               
034700,000201: 32,3202           15155                           TCF      ENDOFJOB                              #  RETURN IN NEW JOB AND IN EBANK FIVE
034701,000202: 
034702,000203: 32,3203           06036        ASTNRET            TC       INTPRET                               
034703,000204: 32,3204           47131                           SSP      RTB                                   #  GO PICK UP DISPLAY AT END OF R51:
034704,000205: 32,3205           02747                                    QMAJ                                  #        "PROCEED" WILL DO A FINE ALIGNMENT
034705,000206: 32,3206           65210                           FCADR    P63SPOT2                              #        "ENTER" WILL RETURN TO P63SPOT2
034706,000207: 32,3207           30776                                    R51P63                                
034707,000208: 32,3210           53575        P63SPOT2           VLOAD    UNIT                                  #  INITIALIZE KALCMANU FOR BURN ATTITUDE
034708,000209: 32,3211           02536                                    R60VSAVE                              
034709,000210: 32,3212           27767                           STOVL    POINTVSM                              
034710,000211: 32,3213           06422                                    UNITX                                 
034711,000212: 32,3214           03761                           STORE    SCAXIS                                
034712,000213: 32,3215           77776                           EXIT                                           
034713,000214: 
034714,000215: 32,3216           35016                           CAF      EBANK7                                
034715,000216: 32,3217           54003                           TS       EBANK                                 
034716,000217: 
034717,000218: 32,3220           00004                           INHINT                                         
034718,000219: 32,3221           04674                           TC       IBNKCALL                              
034719,000220: 32,3222           40142                           CADR     PFLITEDB                              
034720,000221: 32,3223           00003                           RELINT                                         
034721,000222: 

Page 793

034723,000224: 32,3224           04616                           TC       BANKCALL                              
034724,000225: 32,3225           54101                           CADR     R60LEM                                
034725,000226: 
034726,000227: 32,3226           05353                           TC       PHASCHNG                              #  PREVENT RECALLING R60
034727,000228: 32,3227           04024                           OCT      04024                                 
034728,000229: 
034729,000230: 32,3230           34746        P63SPOT3           CA       BIT6                                  #  IS THE LR ANTENNA IN POSITION 1 YET
034730,000231: 32,3231           00006                           EXTEND                                         
034731,000232: 32,3232           02033                           RAND     CHAN33                                
034732,000233: 32,3233           00006                           EXTEND                                         
034733,000234: 32,3234           13242                           BZF      P63SPOT4                              #  BRANCH IF ANTENNA ALREADY IN POSITION 1
034734,000235: 
034735,000236: 32,3235           33250                           CAF      CODE500                               #  ASTRONAUT:    PLEASE CRANK THE
034736,000237: 32,3236           04616                           TC       BANKCALL                              #                SILLY THING AROUND
034737,000238: 32,3237           20476                           CADR     GOPERF1                               
034738,000239: 32,3240           16001                           TCF      GOTOPOOH                              #  TERMINATE
034739,000240: 32,3241           13230                           TCF      P63SPOT3                              #  PROCEED       SEE IF HE'S LYING
034740,000241: 
034741,000242: 32,3242           04616        P63SPOT4           TC       BANKCALL                              #  ENTER         INITIALIZE LANDING RADAR
034742,000243: 32,3243           67704                           CADR     SETPOS1                               
034743,000244: 
034744,000245: 32,3244           04635                           TC       POSTJUMP                              #  OFF TO SEE THE WIZARD ...
034745,000246: 32,3245           74124                           CADR     BURNBABY                              
034746,000247: 
034747,000248:                                                                                                  #        ----------------------------------------
034748,000249: 
034749,000250:                                                                                                  #  CONSTANTS FOR P63LM AND IGNALG
034750,000251: 
034751,000252: 32,3246           02074        P63ADRES           GENADR   P63TABLE                              
034752,000253: 
034753,000254: 32,3247           00027        ASTNDEX            OCT      00027                                 #  INDEX FOR CLOKTASK
034754,000255: 
034755,000256: 32,3250           00500        CODE500            OCT      00500                                 
034756,000257: 
034757,000258: 32,3251           00035 30373  99999CON           2DEC     30479.7    B-24                       
034758,000259: 
034759,000260: 32,3253           00003 37214  GUIDDURN           2DEC     +65164     B-28                       
034760,000261: 32,3255           00000 00010  DDUMCRIT           2DEC     +8         B-28                       #  CRITERION FOR IGNALG CONVERGENCE
034761,000262: 

Page 794

034763,000264:                                                                                                  #        ----------------------------------------
034764,000265: 

Page 795

034766,000267:                                                                                                  #        ****************************************
034767,000268:                                                                                                  #        P68: LANDING CONFIRMATION
034768,000269:                                                                                                  #        ****************************************
034769,000270: 
034770,000271: 31,2172                                           BANK     31                                    
034771,000272: 31,2000                                           SETLOC   F2DPS*31                              
034772,000273: 31,2000                                           BANK                                           
034773,000274: 
034774,000275: 31,2172                                           COUNT*   $$/P6567                              
034775,000276: 
034776,000277: 31,2172           05353        LANDJUNK           TC       PHASCHNG                              
034777,000278: 31,2173           04024                           OCT      04024                                 
034778,000279: 
034779,000280: 31,2174           00004                           INHINT                                         
034780,000281: 31,2175           04616                           TC       BANKCALL                              #  ZERO ATTITUDE ERROR
034781,000282: 31,2176           40153                           CADR     ZATTEROR                              
034782,000283: 
034783,000284: 31,2177           04616                           TC       BANKCALL                              #  SET 5 DEGREE DEADBAND
034784,000285: 31,2200           40127                           CADR     SETMAXDB                              
034785,000286: 
034786,000287: 31,2201           06036                           TC       INTPRET                               #  TO INTERPRETIVE AS TIME IS NOT CRITICAL
034787,000288: 31,2202           43014                           SET      CLEAR                                 
034788,000289: 31,2203           04067                                    SURFFLAG                              
034789,000290: 31,2204           04666                                    LETABORT                              
034790,000291: 31,2205           43014                           SET      CLEAR                                 
034791,000292: 31,2206           05062                                    APSFLAG                               
034792,000293: 31,2207           03664                                    SWANDISP                              
034793,000294: 31,2210           77214                           SET      VLOAD                                 
034794,000295: 31,2211           05460                                    LRBYPASS                              
034795,000296: 31,2212           01221                                    RN                                    
034796,000297: 31,2213           16032                           STODL    ALPHAV                                
034797,000298: 31,2214           01235                                    PIPTIME                               
034798,000299: 31,2215           45014                           SET      CALL                                  
034799,000300: 31,2216           01463                                    LUNAFLAG                              
034800,000301: 31,2217           26351                                    LAT-LONG                              
034801,000302: 31,2220           77201                           SETPD    VLOAD                                 #  COMPUTE RLS AND STORE IT AWAY
034802,000303: 31,2221           00001                                    0                                     
034803,000304: 31,2222           01221                                    RN                                    
034804,000305: 31,2223           65352                           VSL2     PDDL                                  
034805,000306: 31,2224           01235                                    PIPTIME                               
034806,000307: 31,2225           45006                           PUSH     CALL                                  
034807,000308: 31,2226           51531                                    R-TO-RP                               
034808,000309: 31,2227           02023                           STORE    RLS                                   
034809,000310: 31,2230           77776                           EXIT                                           
034810,000311: 31,2231           32246                           CAF      V06N43*                               #  ASTRONAUT:  NOW LOOK WHERE YOU ENDED UP
034811,000312: 31,2232           04616                           TC       BANKCALL                              
034812,000313: 31,2233           20351                           CADR     GOFLASH                               
034813,000314: 31,2234           16001                           TCF      GOTOPOOH                              #  TERMINATE
034814,000315: 31,2235           12237                           TCF      +2                                    #  PROCEED
034815,000316: 31,2236           12231                           TCF      -5                                    #  RECYCLE
034816,000317: 

Page 796

034818,000319: 31,2237           06036                           TC       INTPRET                               
034819,000320: 31,2240           77775                           VLOAD                                          #  INITIALIZE GSAV AND (USING REFMF)
034820,000321: 31,2241           06422                                    UNITX                                 #  YNBSAV, ZNBSAV AND ATTFLAG FOR P57
034821,000322: 31,2242           36235                           STCALL   GSAV                                  
034822,000323: 31,2243           33470                                    REFMF                                 
034823,000324: 31,2244           77776                           EXIT                                           
034824,000325: 
034825,000326: 31,2245           16001                           TCF      GOTOPOOH                              #  ASTRONAUT:  PLEASE SELECT P57
034826,000327: 
034827,000328: 31,2246           01453        V06N43*            VN       0643                                  
034828,000329: 

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