Source Code

These source-code files are part of a reconstructed copy of Luminary 98, a development version of the Apollo 11 Lunar Module (LM) Apollo Guidance Computer (AGC) software.

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 memo 85, using asterisks indicating changed lines in the listing as a guide. While no listing of this version is known to exist, nor are the memory-bank checksums available, the reconstruction is believed to be correct because it was an an intermediate step in reconstructing Luminary 97 whose reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152G. 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 98 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.

033291,000002:                                                                                                  ## Copyright:   Public domain.
033292,000003:                                                                                                  ## Filename:    THE_LUNAR_LANDING.agc
033293,000004:                                                                                                  ## Purpose:     A section of Luminary revision 98.
033294,000005:                                                                                                  ##              It is part of the reconstructed source code for the a
033295,000006:                                                                                                  ##              development version of the flight software for the Lunar 
033296,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 11.
033297,000008:                                                                                                  ##              The code has been recreated from a copy of Luminary 99
033298,000009:                                                                                                  ##              revision 001, using asterisks indicating changed lines in
033299,000010:                                                                                                  ##              the listing and Luminary Memo #85, which lists changes between
033300,000011:                                                                                                  ##              Luminary 98 and 99.
033301,000012:                                                                                                  ## Reference:   pp. 785-792
033302,000013:                                                                                                  ## Assembler:   yaYUL
033303,000014:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
033304,000015:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
033305,000016:                                                                                                  ## Mod history: 2019-07-28 MAS  Created from Luminary 99.
033306,000017: 

Page 785

033308,000019: 32,2776                                           BANK     32                                    
033309,000020: 32,2000                                           SETLOC   F2DPS*32                              
033310,000021: 32,2000                                           BANK                                           
033311,000022: 
033312,000023: 32,2776  E7,1621                                  EBANK=   E2DPS                                 
033313,000024: 
033314,000025:                                                                                                  #        ****************************************
033315,000026:                                                                                                  #        P63: THE LUNAR LANDING, BRAKING PHASE
033316,000027:                                                                                                  #        ****************************************
033317,000028: 
033318,000029: 32,2776                                           COUNT*   $$/P63                                
033319,000030: 
033320,000031: 32,2776           05353        P63LM              TC       PHASCHNG                              
033321,000032: 32,2777           04024                           OCT      04024                                 
033322,000033: 
033323,000034: 32,3000           04616                           TC       BANKCALL                              #  DO IMU STATUS CHECK ROUTINE R02
033324,000035: 32,3001           11254                           CADR     R02BOTH                               
033325,000036: 
033326,000037: 32,3002           33253                           CAF      P63ADRES                              #  INITIALIZE WHICH FOR BURNBABY
033327,000038: 32,3003           55455                           TS       WHICH                                 
033328,000039: 
033329,000040: 32,3004           32000                           CAF      DPSTHRSH                              #  INITIALIZE DVMON
033330,000041: 32,3005           55251                           TS       DVTHRUSH                              
033331,000042: 32,3006           34751                           CAF      FOUR                                  
033332,000043: 32,3007           55515                           TS       DVCNTR                                
033333,000044: 
033334,000045: 32,3010           44753                           CS       ONE                                   #  INITIALIZE WCHPHASE AND FLPASSO
033335,000046: 32,3011           55351                           TS       WCHPHASE                              
033336,000047: 
033337,000048: 32,3012           34755                           CA       ZERO                                  
033338,000049: 32,3013           55623                           TS       FLPASS0                               
033339,000050: 
033340,000051: 32,3014           44736                           CS       BIT14                                 
033341,000052: 32,3015           00006                           EXTEND                                         
033342,000053: 32,3016           03012                           WAND     CHAN12                                #  REMOVE TRACK-ENABLE DISCRETE.
033343,000054: 
033344,000055: 32,3017           06037        FLAGORGY           TC       INTPRET                               #  DIONYSIAN FLAG WAVING
033345,000056: 32,3020           43014                           CLEAR    CLEAR                                 
033346,000057: 32,3021           02663                                    NOTHROTL                              
033347,000058: 32,3022           03271                                    REDFLAG                               
033348,000059: 32,3023           43014                           CLEAR    SET                                   
033349,000060: 32,3024           05660                                    LRBYPASS                              
033350,000061: 32,3025           03067                                    MUNFLAG                               
033351,000062: 32,3026           43014                           CLEAR    CLEAR                                 
033352,000063: 32,3027           00266                                    P25FLAG                               #  TERMINATE P25 IF IT IS RUNNING.
033353,000064: 32,3030           00270                                    RNDVZFLG                              #  TERMINATE P20 IF IT IS RUNNING
033354,000065: 
033355,000066:                                                                                                  #  ****************************************
033356,000067: 
033357,000068: 32,3031           77201        IGNALG             SETPD    VLOAD                                 #  FIRST SET UP INPUTS FOR RP-TO-R:-

Page 786

033359,000070: 32,3032           00001                                    0                                     #        AT 0D LANDING SITE IN MOON FIXED FRAME
033360,000071: 32,3033           02023                                    RLS                                   #        AT 6D ESTIMATED TIME OF LANDING
033361,000072: 32,3034           41525                           PDDL     PUSH                                  #        MPAC NON-ZERO TO INDICATE LUNAR CASE
033362,000073: 32,3035           02401                                    TLAND                                 
033363,000074: 32,3036           37625                           STCALL   TPIP                                  #  ALSO SET TPIP FOR FIRST GUIDANCE PASS
033364,000075: 32,3037           55716                                    RP-TO-R                               
033365,000076: 32,3040           64312                           VSL4     MXV                                   
033366,000077: 32,3041           01734                                    REFSMMAT                              
033367,000078: 32,3042           37635                           STCALL   LAND                                  
033368,000079: 32,3043           46432                                    GUIDINIT                              #  GUIDINIT INITIALIZES WM AND /LAND/
033369,000080: 32,3044           45345                           DLOAD    DSU                                   
033370,000081: 32,3045           02401                                    TLAND                                 
033371,000082: 32,3046           25260                                    GUIDDURN                              
033372,000083: 32,3047           34041                           STCALL   TDEC1                                 #  INTEGRATE STATE FORWARD TO THAT TIME
033373,000084: 32,3050           27057                                    LEMPREC                               
033374,000085: 32,3051           77331                           SSP      VLOAD                                 
033375,000086: 32,3052           03647                                    NIGNLOOP                              
033376,000087: 32,3053           00050                                    40D                                   
033377,000088: 32,3054           06520                                    UNITX                                 
033378,000089: 32,3055           26603                           STOVL    CG                                    
033379,000090: 32,3056           06516                                    UNITY                                 
033380,000091: 32,3057           26611                           STOVL    CG         +6                         
033381,000092: 32,3060           06514                                    UNITZ                                 
033382,000093: 32,3061           16617                           STODL    CG         +14                        
033383,000094: 32,3062           25256                                    99999CON                              
033384,000095: 32,3063           27665                           STOVL    DELTAH                                #  INITIALIZE DELTAH FOR V16N68 DISPLAY
033385,000096: 32,3064           06522                                    ZEROVECS                              
033386,000097: 32,3065           17254                           STODL    UNFC/2                                #  INITIALIZE TRIM VELOCITY CORRECTION TERM
033387,000098: 32,3066           06522                                    HI6ZEROS                              
033388,000099: 32,3067           03643                           STORE    TTF/8                                 
033389,000100: 
033390,000101: 32,3070           77745        IGNALOOP           DLOAD                                          
033391,000102: 32,3071           00015                                    TAT                                   
033392,000103: 32,3072           27561                           STOVL    PIPTIME1                              
033393,000104: 32,3073           00017                                    RATT1                                 
033394,000105: 32,3074           64312                           VSL4     MXV                                   
033395,000106: 32,3075           01734                                    REFSMMAT                              
033396,000107: 32,3076           37521                           STCALL   R                                     
033397,000108: 32,3077           67130                                    MUNGRAV                               
033398,000109: 32,3100           35237                           STCALL   GDT/2                                 
033399,000110: 32,3101           62454                                    ?GUIDSUB                              #  WHICH DELIVERS N PASSES OF GUIDANCE
033400,000111: 
033401,000112:                                                                                                  #  DDUMCALC IS PROGRAMMED AS FOLLOWS:-
033402,000113:                                                                                                  #                                          2                                           -
033403,000114:                                                                                                  #               (RIGNZ - RGU )/16 + 16(RGU  )KIGNY/B8 + (RGU - RIGNX)KIGNX/B4 + (ABVAL(VGU) - VIGN)KIGNV/B4
033404,000115:                                                                                                  #                           2             1                 0
033405,000116:                                                                                                  #        DDUM = -------------------------------------------------------------------------------------------
033406,000117:                                                                                                  #                                                 10
033407,000118:                                                                                                  #                                                2   (VGU - 16 VGU KIGNX/B4)

Page 787

033409,000120:                                                                                                  #                                                        2        0
033410,000121:                                                                                                  #  THE NUMERATOR IS SCALED IN METERS AT 2(28).  THE DENOMINATOR IS A VELOCITY IN UNITS OF 2(10) M/CS.
033411,000122:                                                                                                  #  THE QUOTIENT IS THUS A TIME IN UNITS OF 2(18) CENTISECONDS.  THE FINAL SHIFT RESCALES TO UNITS OF 2(28) CS.
033412,000123:                                                                                                  #  THERE IS NO DAMPING FACTOR.  THE CONSTANTS KIGNX/B4, KIGNY/B8 AND KIGNV/B4 ARE ALL NEGATIVE IN SIGN.
033413,000124: 
033414,000125: 32,3102           55646        DDUMCALC           TS       NIGNLOOP                              
033415,000126: 32,3103           06037                           TC       INTPRET                               
033416,000127: 32,3104           57345                           DLOAD    DMPR                                  #  FORM DENOMINATOR FIRST
033417,000128: 32,3105           03627                                    VGU                                   
033418,000129: 32,3106           02501                                    KIGNX/B4                              
033419,000130: 32,3107           44232                           SL4R     BDSU                                  
033420,000131: 32,3110           03633                                    VGU        +4                         
033421,000132: 32,3111           45325                           PDDL     DSU                                   
033422,000133: 32,3112           02477                                    RIGNZ                                 
033423,000134: 32,3113           02643                                    RGU        +4                         
033424,000135: 32,3114           65222                           SR4R     PDDL                                  
033425,000136: 32,3115           02641                                    RGU        +2                         
033426,000137: 32,3116           57316                           DSQ      DMPR                                  
033427,000138: 32,3117           02503                                    KIGNY/B8                              
033428,000139: 32,3120           65232                           SL4R     PDDL                                  
033429,000140: 32,3121           02637                                    RGU                                   
033430,000141: 32,3122           57225                           DSU      DMPR                                  
033431,000142: 32,3123           02475                                    RIGNX                                 
033432,000143: 32,3124           02501                                    KIGNX/B4                              
033433,000144: 32,3125           51515                           PDVL     ABVAL                                 
033434,000145: 32,3126           03627                                    VGU                                   
033435,000146: 32,3127           57225                           DSU      DMPR                                  
033436,000147: 32,3130           02473                                    VIGN                                  
033437,000148: 32,3131           02505                                    KIGNV/B4                              
033438,000149: 32,3132           43215                           DAD      DAD                                   
033439,000150: 32,3133           56215                           DAD      DDV                                   
033440,000151: 32,3134           77661                           SRR                                            
033441,000152: 32,3135           21613                                    10D                                   
033442,000153: 
033443,000154: 32,3136           43206                           PUSH     DAD                                   
033444,000155: 32,3137           03561                                    PIPTIME1                              
033445,000156: 32,3140           14041                           STODL    TDEC1                                 #  STORE NEW GUESS FOR NEXT INTEGRATION
033446,000157: 32,3141           45246                           ABS      DSU                                   
033447,000158: 32,3142           25262                                    DDUMCRIT                              
033448,000159: 32,3143           45040                           BMN      CALL                                  
033449,000160: 32,3144           65163                                    DDUMGOOD                              
033450,000161: 32,3145           27414                                    INTSTALL                              
033451,000162: 32,3146           43014                           SET      SET                                   
033452,000163: 32,3147           01473                                    INTYPFLG                              
033453,000164: 32,3150           00063                                    MOONFLAG                              
033454,000165: 32,3151           77745                           DLOAD                                          
033455,000166: 32,3152           03561                                    PIPTIME1                              
033456,000167: 32,3153           25517                           STOVL    TET                                   #  HOPEFULLY ?GUIDSUB DID NOT
033457,000168: 32,3154           00017                                    RATT1                                 #        CLOBBER RATT1 AND VATT1

Page 788

033459,000170: 32,3155           25535                           STOVL    RCV                                   
033460,000171: 32,3156           00025                                    VATT1                                 
033461,000172: 32,3157           35543                           STCALL   VCV                                   
033462,000173: 32,3160           27107                                    INTEGRVS                              
033463,000174: 32,3161           77650                           GOTO                                           
033464,000175: 32,3162           65070                                    IGNALOOP                              
033465,000176: 
033466,000177: 32,3163           54335        DDUMGOOD           SLOAD    SR                                    
033467,000178: 32,3164           03423                                    ZOOMTIME                              
033468,000179: 32,3165           20617                                    14D                                   
033469,000180: 32,3166           77621                           BDSU                                           
033470,000181: 32,3167           00041                                    TDEC1                                 
033471,000182: 32,3170           27442                           STOVL    TIG                                   #  COMPUTE DISTANCE LANDING SITE WILL BE
033472,000183: 32,3171           03527                                    V                                     #        OUT OF LM'S ORBITAL PLANE AT IGNITION:
033473,000184: 32,3172           53435                           VXV      UNIT                                  #        SIGN IS + IF LANDING SITE IS TO THE
033474,000185: 32,3173           03521                                    R                                     #        RIGHT, NORTH; - IF TO THE LEFT, SOUTH.
033475,000186: 32,3174           72441                           DOT      SL1                                   
033476,000187: 32,3175           03635                                    LAND                                  
033477,000188: 32,3176           26627        R60INIT            STOVL    OUTOFPLN                              #  INITIALIZATION FOR CALCMANU
033478,000189: 32,3177           03254                                    UNFC/2                                
033479,000190: 32,3200           02631                           STORE    R60VSAVE                              #  STORE UNFC/2 TEMPORARILY IN R60SAVE
033480,000191: 32,3201           77776                           EXIT                                           
033481,000192:                                                                                                  #  ****************************************
033482,000193: 
033483,000194: 32,3202           05353        IGNALGRT           TC       PHASCHNG                              #  PREVENT REPEATING IGNALG
033484,000195: 32,3203           04024                           OCT      04024                                 
033485,000196: 
033486,000197: 32,3204           44362        ASTNCLOK           CS       ASTNDEX                               
033487,000198: 32,3205           04616                           TC       BANKCALL                              
033488,000199: 32,3206           74664                           CADR     STCLOK2                               
033489,000200: 32,3207           15155                           TCF      ENDOFJOB                              #  RETURN IN NEW JOB AND IN EBANK FIVE
033490,000201: 
033491,000202: 32,3210           06037        ASTNRET            TC       INTPRET                               
033492,000203: 32,3211           47131                           SSP      RTB                                   #  GO PICK UP DISPLAY AT END OF R51:
033493,000204: 32,3212           02747                                    QMAJ                                  #        "PROCEED" WILL DO A FINE ALIGNMENT
033494,000205: 32,3213           65215                           FCADR    P63SPOT2                              #        "ENTER" WILL RETURN TO P63SPOT2
033495,000206: 32,3214           31135                                    R51P63                                
033496,000207: 32,3215           53575        P63SPOT2           VLOAD    UNIT                                  #  INITIALIZE KALCMANU FOR BURN ATTITUDE
033497,000208: 32,3216           02631                                    R60VSAVE                              
033498,000209: 32,3217           27773                           STOVL    POINTVSM                              
033499,000210: 32,3220           06520                                    UNITX                                 
033500,000211: 32,3221           03765                           STORE    SCAXIS                                
033501,000212: 32,3222           77776                           EXIT                                           
033502,000213: 
033503,000214: 32,3223           35016                           CAF      EBANK7                                
033504,000215: 32,3224           54003                           TS       EBANK                                 
033505,000216: 
033506,000217: 32,3225           00004                           INHINT                                         
033507,000218: 32,3226           04674                           TC       IBNKCALL                              
033508,000219: 32,3227           40142                           CADR     PFLITEDB                              

Page 789

033510,000221: 32,3230           00003                           RELINT                                         
033511,000222: 
033512,000223: 32,3231           04616                           TC       BANKCALL                              
033513,000224: 32,3232           54123                           CADR     R60LEM                                
033514,000225: 
033515,000226: 32,3233           05353                           TC       PHASCHNG                              #  PREVENT RECALLING R60
033516,000227: 32,3234           04024                           OCT      04024                                 
033517,000228: 
033518,000229: 32,3235           34746        P63SPOT3           CA       BIT6                                  #  IS THE LR ANTENNA IN POSITION 1 YET
033519,000230: 32,3236           00006                           EXTEND                                         
033520,000231: 32,3237           02033                           RAND     CHAN33                                
033521,000232: 32,3240           00006                           EXTEND                                         
033522,000233: 32,3241           13247                           BZF      P63SPOT4                              #  BRANCH IF ANTENNA ALREADY IN POSITION 1
033523,000234: 
033524,000235: 32,3242           33254                           CAF      CODE500                               #  ASTRONAUT:    PLEASE CRANK THE
033525,000236: 32,3243           04616                           TC       BANKCALL                              #                SILLY THING AROUND
033526,000237: 32,3244           20623                           CADR     GOPERF1                               
033527,000238: 32,3245           16001                           TCF      GOTOPOOH                              #  TERMINATE
033528,000239: 32,3246           13235                           TCF      P63SPOT3                              #  PROCEED       SEE IF HE'S LYING
033529,000240: 
033530,000241: 32,3247           04616        P63SPOT4           TC       BANKCALL                              #  ENTER         INITIALIZE LANDING RADAR
033531,000242: 32,3250           67701                           CADR     SETPOS1                               
033532,000243: 
033533,000244: 32,3251           04635                           TC       POSTJUMP                              #  OFF TO SEE THE WIZARD ...
033534,000245: 32,3252           74126                           CADR     BURNBABY                              
033535,000246: 
033536,000247:                                                                                                  #        ----------------------------------------
033537,000248: 
033538,000249:                                                                                                  #  CONSTANTS FOR P63LM AND IGNALG
033539,000250: 
033540,000251: 32,3253           02076        P63ADRES           GENADR   P63TABLE                              
033541,000252: 
033542,000253: 32,3254     4362               ASTNDEX            =        MD1                                   #  OCT 25; INDEX FOR CLOKTASK
033543,000254: 
033544,000255: 32,3254           00500        CODE500            OCT      00500                                 
033545,000256: 
033546,000257: 32,3255           00035 30373  99999CON           2DEC     30479.7    B-24                       
033547,000258: 
033548,000259: 32,3257           00004 01610  GUIDDURN           2DEC     +66440     B-28                       #  GUIDDURN +6.64400314 E+2
033549,000260: 32,3261           00000 00010  DDUMCRIT           2DEC     +8         B-28                       #  CRITERION FOR IGNALG CONVERGENCE
033550,000261: 

Page 790

033552,000263:                                                                                                  #        ----------------------------------------
033553,000264: 

Page 791

033555,000266:                                                                                                  #        ****************************************
033556,000267:                                                                                                  #        P68: LANDING CONFIRMATION
033557,000268:                                                                                                  #        ****************************************
033558,000269: 
033559,000270: 31,2144                                           BANK     31                                    
033560,000271: 31,2000                                           SETLOC   F2DPS*31                              
033561,000272: 31,2000                                           BANK                                           
033562,000273: 
033563,000274: 31,2144                                           COUNT*   $$/P6567                              
033564,000275: 
033565,000276: 31,2144           05353        LANDJUNK           TC       PHASCHNG                              
033566,000277: 31,2145           04024                           OCT      04024                                 
033567,000278: 
033568,000279: 31,2146           00004                           INHINT                                         
033569,000280: 31,2147           04616                           TC       BANKCALL                              #  ZERO ATTITUDE ERROR
033570,000281: 31,2150           40153                           CADR     ZATTEROR                              
033571,000282: 
033572,000283: 31,2151           04616                           TC       BANKCALL                              #  SET 5 DEGREE DEADBAND
033573,000284: 31,2152           40127                           CADR     SETMAXDB                              
033574,000285: 
033575,000286: 31,2153           06037                           TC       INTPRET                               #  TO INTERPRETIVE AS TIME IS NOT CRITICAL
033576,000287: 31,2154           43014                           SET      CLEAR                                 
033577,000288: 31,2155           04067                                    SURFFLAG                              
033578,000289: 31,2156           04666                                    LETABORT                              
033579,000290: 31,2157           77214                           SET      VLOAD                                 
033580,000291: 31,2160           05062                                    APSFLAG                               
033581,000292: 31,2161           01221                                    RN                                    
033582,000293: 31,2162           16032                           STODL    ALPHAV                                
033583,000294: 31,2163           01235                                    PIPTIME                               
033584,000295: 31,2164           45014                           SET      CALL                                  
033585,000296: 31,2165           01463                                    LUNAFLAG                              
033586,000297: 31,2166           26351                                    LAT-LONG                              
033587,000298: 31,2167           77201                           SETPD    VLOAD                                 #  COMPUTE RLS AND STORE IT AWAY
033588,000299: 31,2170           00001                                    0                                     
033589,000300: 31,2171           01221                                    RN                                    
033590,000301: 31,2172           65352                           VSL2     PDDL                                  
033591,000302: 31,2173           01235                                    PIPTIME                               
033592,000303: 31,2174           45006                           PUSH     CALL                                  
033593,000304: 31,2175           51670                                    R-TO-RP                               
033594,000305: 31,2176           02023                           STORE    RLS                                   
033595,000306: 31,2177           77776                           EXIT                                           
033596,000307: 31,2200           32215                           CAF      V06N43*                               #  ASTRONAUT:  NOW LOOK WHERE YOU ENDED UP
033597,000308: 31,2201           04616                           TC       BANKCALL                              
033598,000309: 31,2202           20476                           CADR     GOFLASH                               
033599,000310: 31,2203           16001                           TCF      GOTOPOOH                              #  TERMINATE
033600,000311: 31,2204           12206                           TCF      +2                                    #  PROCEED
033601,000312: 31,2205           12200                           TCF      -5                                    #  RECYCLE
033602,000313: 
033603,000314: 31,2206           06037                           TC       INTPRET                               

Page 792

033605,000316: 31,2207           77775                           VLOAD                                          #  INITIALIZE GSAV AND (USING REFMF)
033606,000317: 31,2210           06520                                    UNITX                                 #  YNBSAV, ZNBSAV AND ATTFLAG FOR P57
033607,000318: 31,2211           36231                           STCALL   GSAV                                  
033608,000319: 31,2212           33506                                    REFMF                                 
033609,000320: 31,2213           77776                           EXIT                                           
033610,000321: 
033611,000322: 31,2214           16001                           TCF      GOTOPOOH                              #  ASTRONAUT:  PLEASE SELECT P57
033612,000323: 
033613,000324: 31,2215           01453        V06N43*            VN       0643                                  
033614,000325: 

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