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.

036916,000002:                                                                                                  ## Copyright:   Public domain.
036917,000003:                                                                                                  ## Filename:    P12.agc
036918,000004:                                                                                                  ## Purpose:     A section of LUM69 revision 2.
036919,000005:                                                                                                  ##              It is part of the reconstructed source code for the flown
036920,000006:                                                                                                  ##              version of the flight software for the Lunar Module's (LM)
036921,000007:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 10. The code has
036922,000008:                                                                                                  ##              been recreated from a copy of Luminary revsion 069, using
036923,000009:                                                                                                  ##              changes present in Luminary 099 which were described in
036924,000010:                                                                                                  ##              Luminary memos 75 and 78. The code has been adapted such
036925,000011:                                                                                                  ##              that the resulting bugger words exactly match those specified
036926,000012:                                                                                                  ##              for LUM69 revision 2 in NASA drawing 2021152B, which gives
036927,000013:                                                                                                  ##              relatively high confidence that the reconstruction is correct.
036928,000014:                                                                                                  ## Reference:   pp. 839-843
036929,000015:                                                                                                  ## Assembler:   yaYUL
036930,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
036931,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
036932,000018:                                                                                                  ## Mod history: 2019-07-27 MAS  Created from Luminary 69.
036933,000019: 

Page 839

036935,000021: 24,3504                                           BANK     24                                    
036936,000022: 30,2000                                           SETLOC   P12                                   
036937,000023: 30,2000                                           BANK                                           
036938,000024: 
036939,000025: 30,2006  E7,1513                                  EBANK=   DVCNTR                                
036940,000026: 30,2006                                           COUNT*   $$/P12                                
036941,000027: 
036942,000028: 30,2006           05353        P12LM              TC       PHASCHNG                              
036943,000029: 30,2007           04024                           OCT      04024                                 
036944,000030: 
036945,000031: 30,2010           04616                           TC       BANKCALL                              
036946,000032: 30,2011           11175                           CADR     R02BOTH                               #  CHECK THE STATUS OF THE IMU.
036947,000033: 
036948,000034: 30,2012           05504                           TC       UPFLAG                                
036949,000035: 30,2013           00141                           ADRES    MUNFLAG                               
036950,000036: 
036951,000037: 30,2014           05504                           TC       UPFLAG                                #  INSURE 4-JET TRANSLATION CAPABILITY.
036952,000038: 30,2015           00307                           ADRES    ACC4-2FL                              
036953,000039: 
036954,000040: 30,2016           05504                           TC       UPFLAG                                #  PREVENT R10 FROM ISSUING CROSS-POINTER
036955,000041: 30,2017           00015                           ADRES    R10FLAG                               #  OUTPUTS.
036956,000042: 
036957,000043: 30,2020           05516                           TC       DOWNFLAG                              #  CLEAR RENDEZVOUS FLAG  FOR P22
036958,000044: 30,2021           00010                           ADRES    RNDVZFLG                              
036959,000045: 
036960,000046: 30,2022           36000                           CAF      THRESH2                               #  INITIALIZE DVMON
036961,000047: 30,2023           55251                           TS       DVTHRUSH                              
036962,000048: 30,2024           34751                           CAF      FOUR                                  
036963,000049: 30,2025           55513                           TS       DVCNTR                                
036964,000050: 
036965,000051: 30,2026           34755                           CA       ZERO                                  
036966,000052: 30,2027           55460                           TS       TRKMKCNT                              #  SHOW THAT R29 DOWNLINK DATA ISN'T READY.
036967,000053: 30,2030           33044                           CAF      V06N33A                               
036968,000054: 30,2031           04616                           TC       BANKCALL                              #  FLASH TIG
036969,000055: 30,2032           20351                           CADR     GOFLASH                               
036970,000056: 30,2033           16001                           TCF      GOTOPOOH                              
036971,000057: 30,2034           12036                           TCF      +2                                    #  PROCEED
036972,000058: 30,2035           12030                           TCF      -5                                    #  ENTER
036973,000059: 
036974,000060: 30,2036           05353                           TC       PHASCHNG                              
036975,000061: 30,2037           04024                           OCT      04024                                 
036976,000062: 
036977,000063: 30,2040           06036                           TC       INTPRET                               
036978,000064: 30,2041           77624                           CALL                                           #  INITIALIZE WM AND /LAND/
036979,000065: 30,2042           60264                                    GUIDINIT                              
036980,000066: 30,2043           45014                           SET      CALL                                  
036981,000067: 30,2044           04464                                    FLPI                                  
036982,000068: 30,2045           60204                                    P12INIT                               
036983,000069: 
036984,000070: 30,2046           77745        P12LMB             DLOAD                                          
036985,000071: 30,2047           25604                                    (TGO)A                                #  SET TGO TO AN INITIAL NOMINAL VALUE.

Page 840

036987,000073: 30,2050           17515                           STODL    TGO                                   
036988,000074: 30,2051           03440                                    TIG                                   
036989,000075: 30,2052           34041                           STCALL   TDEC1                                 
036990,000076: 30,2053           27057                                    LEMPREC                               #  ROTATE THE STATE VECTORS TO THE
036991,000077: 30,2054           64375                           VLOAD    MXV                                   #  IGNITION TIME.
036992,000078: 30,2055           00007                                    VATT                                  
036993,000079: 30,2056           01734                                    REFSMMAT                              
036994,000080: 30,2057           77772                           VSL1                                           
036995,000081: 30,2060           27577                           STOVL    V1S                                   #  COMPUTE V1S = VEL(TIG)*2(-7) M/CS.
036996,000082: 30,2061           00001                                    RATT                                  
036997,000083: 30,2062           52521                           MXV      VSL6                                  
036998,000084: 30,2063           01734                                    REFSMMAT                              
036999,000085: 30,2064           37517                           STCALL   R                                     #  COMPUTE R = POS(TIG)*2(-24) M.
037000,000086: 30,2065           67162                                    MUNGRAV                               #  COMPUTE GDT1/2(TIG)*2(-7)M/CS.
037001,000087: 30,2066           53575                           VLOAD    UNIT                                  
037002,000088: 30,2067           03517                                    R                                     
037003,000089: 30,2070           37535                           STCALL   UNIT/R/                               #  COMPUTE UNIT/R/ FOR YCOMP.
037004,000090: 30,2071           57316                                    YCOMP                                 
037005,000091: 30,2072           57461                           SR       DCOMP                                 
037006,000092: 30,2073           20606                                    5D                                    
037007,000093: 30,2074           17641                           STODL    XRANGE                                #  INITIALIZE XRANGE FOR NOUN 76.
037008,000094: 30,2075           20312                                    (APO)                                 
037009,000095: 30,2076           03643                           STORE    APO                                   #  INITIALIZE APO FOR NOUN 76.
037010,000096: 30,2077           77776                           EXIT                                           
037011,000097: 
037012,000098: 30,2100           05353                           TC       PHASCHNG                              
037013,000099: 30,2101           04024                           OCT      04024                                 
037014,000100: 
037015,000101: 30,2102           33043        NEWLOAD            CAF      V06N76                                #  FLASH CROSS-RANGE AND APOLUNE VALUES.
037016,000102: 30,2103           04616                           TC       BANKCALL                              
037017,000103: 30,2104           20351                           CADR     GOFLASH                               
037018,000104: 30,2105           16001                           TCF      GOTOPOOH                              
037019,000105: 30,2106           12110                           TCF      +2                                    #  PROCEED
037020,000106: 30,2107           12102                           TCF      NEWLOAD                               #  ENTER NEW DATA.
037021,000107: 
037022,000108: 30,2110           32306                           CAF      P12ADRES                              
037023,000109: 30,2111           55453                           TS       WHICH                                 
037024,000110: 
037025,000111: 30,2112           05353                           TC       PHASCHNG                              
037026,000112: 30,2113           04024                           OCT      04024                                 
037027,000113: 
037028,000114: 30,2114           06036                           TC       INTPRET                               
037029,000115: 30,2115           54345                           DLOAD    SL                                    
037030,000116: 30,2116           03641                                    XRANGE                                
037031,000117: 30,2117           20206                                    5D                                    
037032,000118: 30,2120           77615                           DAD                                            
037033,000119: 30,2121           02341                                    Y                                     
037034,000120: 30,2122           17631                           STODL    YCO                                   
037035,000121: 30,2123           03643                                    APO                                   #  RA = APO + /LAND/
037036,000122: 30,2124           77661                           SL                                             

Page 841

037038,000124: 30,2125           20206                                    5D                                    
037039,000125: 30,2126           41415                           DAD      PUSH                                  #  RA*2(-24) IN MPAC AND PDL
037040,000126: 30,2127           02337                                    /LAND/                                
037041,000127: 30,2130           65205                           DMP      PDDL                                  #  2 RA MU*2(-62) IN PDL, LOAD RA
037042,000128: 30,2131           20003                                    MUM(-37)                              
037043,000129: 30,2132           41215                           DAD      DMP                                   #  (RA+RP)*2(-24)
037044,000130: 30,2133           03627                                    RCO                                   #  RP(RA+RP)*2(-48)
037045,000131: 30,2134           03627                                    RCO                                   
037046,000132: 30,2135           75465                           BDDV     SQRT                                  #  2 MU RA/RP(RA+RP)*2(-14)=ZDOTD(2)
037047,000133: 30,2136           77626                           STADR                                          
037048,000134: 30,2137           51504                           STOVL    ZDOTD                                 
037049,000135: 30,2140           03535                                    UNIT/R/                               
037050,000136: 30,2141           53361                           VXSC     VAD                                   
037051,000137: 30,2142           20310                                    49FPS                                 
037052,000138: 30,2143           03577                                    V1S                                   
037053,000139: 30,2144           03525                           STORE    V                                     #  V(TIPOVER) = V(IGN) + 57FPS (UNIT/R/)
037054,000140: 30,2145           77614                           SETGO                                          
037055,000141: 30,2146           04421                                    FLVR                                  
037056,000142: 30,2147           60313                                    ASCENT                                
037057,000143: 30,2150           77745        P12RET             DLOAD                                          
037058,000144: 30,2151           02365                                    ATP                                   #  ATP(2)*2(18)
037059,000145: 30,2152           65316                           DSQ      PDDL                                  
037060,000146: 30,2153           02361                                    ATY                                   #  ATY(2)*2(18)
037061,000147: 30,2154           43316                           DSQ      DAD                                   
037062,000148: 30,2155           75454                           BZE      SQRT                                  
037063,000149: 30,2156           60162                                    YAWDUN                                
037064,000150: 30,2157           55352                           SL1      BDDV                                  
037065,000151: 30,2160           02361                                    ATY                                   
037066,000152: 30,2161           77736                           ARCSIN                                         
037067,000153: 30,2162           26367        YAWDUN             STOVL    YAW                                   
037068,000154: 30,2163           03252                                    UNFC/2                                
037069,000155: 30,2164           50256                           UNIT     DOT                                   
037070,000156: 30,2165           03535                                    UNIT/R/                               
037071,000157: 30,2166           65552                           SL1      ARCCOS                                
037072,000158: 30,2167           77676                           DCOMP                                          
037073,000159: 30,2170           02371                           STORE    PITCH                                 
037074,000160: 30,2171           77776                           EXIT                                           
037075,000161: 30,2172           05353                           TC       PHASCHNG                              
037076,000162: 30,2173           04024                           OCT      04024                                 
037077,000163: 
037078,000164: 30,2174           05516                           TC       DOWNFLAG                              
037079,000165: 30,2175           00213                           ADRES    FLPI                                  
037080,000166: 
037081,000167: 30,2176           00004                           INHINT                                         
037082,000168: 30,2177           04674                           TC       IBNKCALL                              
037083,000169: 30,2200           40142                           CADR     PFLITEDB                              
037084,000170: 30,2201           00003                           RELINT                                         
037085,000171: 
037086,000172: 30,2202           04635                           TC       POSTJUMP                              
037087,000173: 30,2203           74124                           CADR     BURNBABY                              

Page 842

037089,000175: 30,2204           77745        P12INIT            DLOAD                                          #  INITIALIZE ENGINE DATA.  USED FOR P12 AND
037090,000176: 30,2205           24001                                    (1/DV)A                               #  P71.
037091,000177: 30,2206           03637                           STORE    1/DV3                                 
037092,000178: 30,2207           03635                           STORE    1/DV2                                 
037093,000179: 30,2210           17633                           STODL    1/DV1                                 
037094,000180: 30,2211           24005                                    (AT)A                                 
037095,000181: 30,2212           16257                           STODL    AT                                    
037096,000182: 30,2213           24007                                    (TBUP)A                               
037097,000183: 30,2214           16265                           STODL    TBUP                                  
037098,000184: 30,2215           34013                                    ATDECAY                               
037099,000185: 30,2216           54276                           DCOMP    SL                                    
037100,000186: 30,2217           20214                                    11D                                   
037101,000187: 30,2220           02263                           STORE    TTO                                   
037102,000188: 30,2221           57535                           SLOAD    DCOMP                                 
037103,000189: 30,2222           26001                                    APSVEX                                
037104,000190: 30,2223           77702                           SR2                                            
037105,000191: 30,2224           02261                           STORE    VE                                    
037106,000192: 30,2225           43414                           BOFF     RVQ                                   
037107,000193: 30,2226           04747                                    FLAP                                  
037108,000194: 30,2227           60230                                    COMMINIT                              
037109,000195: 30,2230           43345        COMMINIT           DLOAD    DAD                                   #  INITIALIZE TARGET DATA. USED BY P12, P70
037110,000196: 30,2231           25602                                    HINJECT                               #  AND P71 IF IT DOES NOT FOLLOW P70.
037111,000197: 30,2232           02337                                    /LAND/                                
037112,000198: 30,2233           17627                           STODL    RCO                                   
037113,000199: 30,2234           06424                                    HI6ZEROS                              
037114,000200: 30,2235           03654                           STORE    TXO                                   
037115,000201: 30,2236           03631                           STORE    YCO                                   
037116,000202: 30,2237           02267                           STORE    RDOTD                                 
037117,000203: 30,2240           26271                           STOVL    YDOTD                                 
037118,000204: 30,2241           01563                                    VRECTCSM                              
037119,000205: 30,2242           64235                           VXV      MXV                                   
037120,000206: 30,2243           01555                                    RRECTCSM                              
037121,000207: 30,2244           01734                                    REFSMMAT                              
037122,000208: 30,2245           77656                           UNIT                                           
037123,000209: 30,2246           17716                           STODL    QAXIS                                 
037124,000210: 30,2247           02506                                    ABTVINJ2                              #  TENTATIVELY STORE LOW INJECTION VELOCITY
037125,000211: 30,2250           02273                           STORE    ZDOTD                                 
037126,000212: 30,2251           77614                           BON                                            
037127,000213: 30,2252           04704                                    FLPI                                  
037128,000214: 30,2253           60263                                    LOVEL                                 
037129,000215: 30,2254           45335                           SLOAD    DSU                                   
037130,000216: 30,2255           02503                                    TBRKPNT                               #  TBRKPNT-TGO
037131,000217: 30,2256           03515                                    TGO                                   
037132,000218: 30,2257           71240                           BMN      DLOAD                                 #  IF TGO>TBRKPNT,LOW VINJECT IS OK;RETURN
037133,000219: 30,2260           60263                                    LOVEL                                 
037134,000220: 30,2261           02504                                    ABTVINJ1                              #  FOR TGO.TBRKPNT USE HI VELOCITY.
037135,000221: 30,2262           02273                           STORE    ZDOTD                                 
037136,000222: 30,2263           77616        LOVEL              RVQ                                            
037137,000223: 30,2264           40220        GUIDINIT           STQ      SETPD                                 
037138,000224: 30,2265           01164                                    TEMPR60                               

Page 843

037140,000226: 30,2266           00001                                    0D                                    
037141,000227: 30,2267           41575                           VLOAD    PUSH                                  
037142,000228: 30,2270           06416                                    UNITZ                                 
037143,000229: 30,2271           41434                           RTB      PUSH                                  
037144,000230: 30,2272           21462                                    LOADTIME                              
037145,000231: 30,2273           45135                           SLOAD    CALL                                  
037146,000232: 30,2274           20312                                    (APO)                                 
037147,000233: 30,2275           51504                                    RP-TO-R                               
037148,000234: 30,2276           74321                           MXV      VXSC                                  
037149,000235: 30,2277           01734                                    REFSMMAT                              
037150,000236: 30,2300           20005                                    MOONRATE                              
037151,000237: 30,2301           26331                           STOVL    WM                                    
037152,000238: 30,2302           02023                                    RLS                                   
037153,000239: 30,2303           52446                           ABVAL    SL3                                   
037154,000240: 30,2304           36337                           STCALL   /LAND/                                
037155,000241: 30,2305           01164                                    TEMPR60                               
037156,000242: 
037157,000243: 30,2306           02022        P12ADRES           REMADR   P12TABLE                              #  NOT IN SAME BANK.
037158,000244: 30,2307           00046 07374  49FPS              2DEC     .149352    B-6                        #  EXPECTED RDOT AT TIPOVER
037159,000245: 
037160,000246: 30,2311           00001 26227  (APO)              2DEC     55597.5    B-29                       #  30 N.M. EXPRESSED IN METERS.

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