Source Code

These source-code files are part of a reconstructed copy of Luminary 173, the second (unflown) release of the Apollo 14 Lunar Module (LM) Apollo Guidance Computer (AGC) software.

The reconstruction began with reconstructed source code for Luminary 178. Changes between revision 173 and 178 were backed out, as described by Luminary memo 167 (revision 1). The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152N. Note that page numbers in the reconstructed code match those for the baseline log section mentioned in each file's changelog; the page numbers for a real Luminary 173 listing would be different.

Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository.

036218,000002:                                                                                                  ## Copyright:   Public domain.
036219,000003:                                                                                                  ## Filename:    P12.agc
036220,000004:                                                                                                  ## Purpose:     A section of Luminary revision 173.
036221,000005:                                                                                                  ##              It is part of the reconstructed source code for the second
036222,000006:                                                                                                  ##              (unflown) release of the flight software for the Lunar
036223,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 14.
036224,000008:                                                                                                  ##              The code has been recreated from a reconstructed copy of
036225,000009:                                                                                                  ##              Luminary 178, as well as Luminary memo 167 (revision 1).
036226,000010:                                                                                                  ##              It has been adapted such that the resulting bugger words
036227,000011:                                                                                                  ##              exactly match those specified for Luminary 173 in NASA
036228,000012:                                                                                                  ##              drawing 2021152N, which gives relatively high confidence
036229,000013:                                                                                                  ##              that the reconstruction is correct.
036230,000014:                                                                                                  ## Reference:   pp. 829-833
036231,000015:                                                                                                  ## Assembler:   yaYUL
036232,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
036233,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
036234,000018:                                                                                                  ## Mod history: 2019-09-18 MAS  Created from Luminary 178.
036235,000019:                                                                                                  ##              2019-09-21 MAS  Added back initialization of ZAXIS1.
036236,000020: 

Page 829

036238,000022: 24,3642                                           BANK     24                                    
036239,000023: 30,2000                                           SETLOC   P12                                   
036240,000024: 30,2000                                           BANK                                           
036241,000025: 
036242,000026: 30,2061  E7,1515                                  EBANK=   DVCNTR                                
036243,000027: 30,2061                                           COUNT*   $$/P12                                
036244,000028: 
036245,000029: 30,2061           05364        P12LM              TC       PHASCHNG                              
036246,000030: 30,2062           04024                           OCT      04024                                 
036247,000031: 
036248,000032: 30,2063           04616                           TC       BANKCALL                              
036249,000033: 30,2064           11241                           CADR     R02BOTH                               #  CHECK THE STATUS OF THE IMU.
036250,000034: 
036251,000035: 30,2065           36000                           CAF      THRESH2                               #  INITIALIZE DVMON
036252,000036: 30,2066           55250                           TS       DVTHRUSH                              
036253,000037: 30,2067           34751                           CAF      FOUR                                  
036254,000038: 30,2070           55515                           TS       DVCNTR                                
036255,000039: 
036256,000040: 30,2071           33014                           CAF      V06N33A                               
036257,000041: 30,2072           04616                           TC       BANKCALL                              #  FLASH TIG
036258,000042: 30,2073           20477                           CADR     GOFLASH                               
036259,000043: 30,2074           16001                           TCF      GOTOPOOH                              
036260,000044: 30,2075           12077                           TCF      +2                                    #  PROCEED
036261,000045: 30,2076           12071                           TCF      -5                                    #  ENTER
036262,000046: 
036263,000047: 30,2077           05364                           TC       PHASCHNG                              
036264,000048: 30,2100           04024                           OCT      04024                                 
036265,000049: 
036266,000050: 30,2101           06042                           TC       INTPRET                               
036267,000051: 30,2102           43014                           SET      SET                                   
036268,000052: 30,2103           03067                                    MUNFLAG                               
036269,000053: 30,2104           06464                                    ACC4-2FL                              
036270,000054: 30,2105           43014                           SET      CLEAR                                 
036271,000055: 30,2106           00075                                    R10FLAG                               
036272,000056: 30,2107           00270                                    RNDVZFLG                              
036273,000057: 30,2110           43014                           SET      SET                                   
036274,000058: 30,2111           04464                                    FLPI                                  
036275,000059: 30,2112           04461                                    FLVR                                  
036276,000060: 30,2113           77624                           CALL                                           
036277,000061: 30,2114           71346                                    GUIDINIT                              
036278,000062: 30,2115           77624                           CALL                                           
036279,000063: 30,2116           60246                                    P12INIT                               
036280,000064: 30,2117           77745        P12LMB             DLOAD                                          
036281,000065: 30,2120           25641                                    (TGO)A                                #  SET TGO TO AN INITIAL NOMINAL VALUE.
036282,000066: 30,2121           17517                           STODL    TGO                                   
036283,000067: 30,2122           03442                                    TIG                                   
036284,000068: 30,2123           34041                           STCALL   TDEC1                                 
036285,000069: 30,2124           27056                                    LEMPREC                               #  ROTATE THE STATE VECTORS TO THE
036286,000070: 30,2125           64375                           VLOAD    MXV                                   #  IGNITION TIME.

Page 830

036288,000072: 30,2126           00007                                    VATT                                  
036289,000073: 30,2127           01732                                    REFSMMAT                              
036290,000074: 30,2130           77772                           VSL1                                           
036291,000075: 30,2131           27601                           STOVL    V1S                                   #  COMPUTE V1S = VEL(TIG)*2(-7)M/CS.
036292,000076: 30,2132           00001                                    RATT                                  
036293,000077: 30,2133           52521                           MXV      VSL6                                  
036294,000078: 30,2134           01732                                    REFSMMAT                              
036295,000079: 30,2135           37521                           STCALL   R                                     #  COMPUTE R = POS(TIG)*2(-24) M.
036296,000080: 30,2136           67000                                    MUNGRAV                               #  COMPUTE GDT1/2(TIG)*2(-7)M/CS.
036297,000081: 30,2137           53575                           VLOAD    UNIT                                  
036298,000082: 30,2140           03521                                    R                                     
036299,000083: 30,2141           37537                           STCALL   UNIT/R/                               #  COMPUTE UNIT/R/ FOR YCOMP.
036300,000084: 30,2142           57311                                    YCOMP                                 
036301,000085: 30,2143           57461                           SR       DCOMP                                 
036302,000086: 30,2144           20606                                    5D                                    
036303,000087: 30,2145           17643                           STODL    XRANGE                                #  INITIALIZE XRANGE FOR NOUN 76.
036304,000088: 30,2146           31372                                    VINJNOM                               
036305,000089: 30,2147           16277                           STODL    ZDOTD                                 
036306,000090: 30,2150           31374                                    RDOTDNOM                              
036307,000091: 30,2151           02273                           STORE    RDOTD                                 
036308,000092: 30,2152           77776                           EXIT                                           
036309,000093: 
036310,000094: 30,2153           05364                           TC       PHASCHNG                              
036311,000095: 30,2154           04024                           OCT      04024                                 
036312,000096: 
036313,000097: 30,2155           33013        NEWLOAD            CAF      V06N76                                #  FLASH CROSS-RANGE AND APOLUNE VALUES.
036314,000098: 30,2156           04616                           TC       BANKCALL                              
036315,000099: 30,2157           20477                           CADR     GOFLASH                               
036316,000100: 30,2160           16001                           TCF      GOTOPOOH                              
036317,000101: 30,2161           12163                           TCF      +2                                    #  PROCEED
036318,000102: 30,2162           12155                           TCF      NEWLOAD                               #  ENTER NEW DATA.
036319,000103: 
036320,000104: 30,2163           32311                           CAF      P12ADRES                              
036321,000105: 30,2164           55455                           TS       WHICH                                 
036322,000106: 
036323,000107: 30,2165           05364                           TC       PHASCHNG                              
036324,000108: 30,2166           04024                           OCT      04024                                 
036325,000109: 
036326,000110: 30,2167           06042                           TC       INTPRET                               
036327,000111: 30,2170           54345                           DLOAD    SL                                    
036328,000112: 30,2171           03643                                    XRANGE                                
036329,000113: 30,2172           20206                                    5D                                    
036330,000114: 30,2173           77615                           DAD                                            
036331,000115: 30,2174           02335                                    Y                                     
036332,000116: 30,2175           27633                           STOVL    YCO                                   
036333,000117: 30,2176           03537                                    UNIT/R/                               
036334,000118: 30,2177           53361                           VXSC     VAD                                   
036335,000119: 30,2200           31370                                    49FPS                                 
036336,000120: 30,2201           03601                                    V1S                                   
036337,000121: 30,2202           03527                           STORE    V                                     #  V(TIPOVER) = V(IGN) + 57FPS (UNIT/R/)

Page 831

036339,000123: 30,2203           72441                           DOT      SL1                                   
036340,000124: 30,2204           03537                                    UNIT/R/                               
036341,000125: 30,2205           27474                           STOVL    RDOT                                  #  RDOT * 2(-7)
036342,000126: 30,2206           03537                                    UNIT/R/                               
036343,000127: 30,2207           53435                           VXV      UNIT                                  
036344,000128: 30,2210           03720                                    QAXIS                                 
036345,000129: 30,2211           37726                           STCALL   ZAXIS1                                
036346,000130: 30,2212           60312                                    ASCENT                                
036347,000131: 30,2213           77745        P12RET             DLOAD                                          
036348,000132: 30,2214           02361                                    ATP                                   #  ATP(2)*2(18)
036349,000133: 30,2215           65316                           DSQ      PDDL                                  
036350,000134: 30,2216           02355                                    ATY                                   #  ATY(2)*2(18)
036351,000135: 30,2217           43316                           DSQ      DAD                                   
036352,000136: 30,2220           75454                           BZE      SQRT                                  
036353,000137: 30,2221           60225                                    YAWDUN                                
036354,000138: 30,2222           55352                           SL1      BDDV                                  
036355,000139: 30,2223           02355                                    ATY                                   
036356,000140: 30,2224           77736                           ARCSIN                                         
036357,000141: 30,2225           26363        YAWDUN             STOVL    YAW                                   
036358,000142: 30,2226           03253                                    UNFC/2                                
036359,000143: 30,2227           50256                           UNIT     DOT                                   
036360,000144: 30,2230           03537                                    UNIT/R/                               
036361,000145: 30,2231           65552                           SL1      ARCCOS                                
036362,000146: 30,2232           77676                           DCOMP                                          
036363,000147: 30,2233           02365                           STORE    PITCH                                 
036364,000148: 30,2234           77776                           EXIT                                           
036365,000149: 30,2235           05364                           TC       PHASCHNG                              
036366,000150: 30,2236           04024                           OCT      04024                                 
036367,000151: 
036368,000152: 30,2237           00004                           INHINT                                         
036369,000153: 30,2240           04674                           TC       IBNKCALL                              
036370,000154: 30,2241           40143                           CADR     PFLITEDB                              
036371,000155: 30,2242           05527                           TC       DOWNFLAG                              
036372,000156: 30,2243           00213                           ADRES    FLPI                                  
036373,000157: 
036374,000158: 30,2244           04635                           TC       POSTJUMP                              
036375,000159: 30,2245           74130                           CADR     BURNBABY                              
036376,000160: 
036377,000161: 30,2246           77745        P12INIT            DLOAD                                          #  INITIALIZE ENGINE DATA. USED FOR P12 AND
036378,000162: 30,2247           16013                                    (1/DV)A                               #  P71.
036379,000163: 30,2250           03641                           STORE    1/DV3                                 
036380,000164: 30,2251           03637                           STORE    1/DV2                                 
036381,000165: 30,2252           17635                           STODL    1/DV1                                 
036382,000166: 30,2253           16017                                    (AT)A                                 
036383,000167: 30,2254           16263                           STODL    AT                                    
036384,000168: 30,2255           16021                                    (TBUP)A                               
036385,000169: 30,2256           16271                           STODL    TBUP                                  
036386,000170: 30,2257           34013                                    ATDECAY                               
036387,000171: 30,2260           54276                           DCOMP    SL                                    
036388,000172: 30,2261           20214                                    11D                                   
036389,000173: 30,2262           02267                           STORE    TTO                                   
036390,000174: 30,2263           57535                           SLOAD    DCOMP                                 
036391,000175: 30,2264           26001                                    APSVEX                                
036392,000176: 30,2265           77702                           SR2                                            

Page 832

036394,000178: 30,2266           02265                           STORE    VE                                    
036395,000179: 30,2267           43414                           BOFF     RVQ                                   
036396,000180: 30,2270           04747                                    FLAP                                  
036397,000181: 30,2271           60272                                    COMMINIT                              
036398,000182: 30,2272           43345        COMMINIT           DLOAD    DAD                                   #  INITIALIZE TARGET DATA. USED BY P12, P70
036399,000183: 30,2273           25637                                    HINJECT                               #  AND P71 IF IT DOES NOT FOLLOW P70.
036400,000184: 30,2274           02333                                    /LAND/                                
036401,000185: 30,2275           17631                           STODL    RCO                                   
036402,000186: 30,2276           06520                                    HI6ZEROS                              
036403,000187: 30,2277           03654                           STORE    TXO                                   
036404,000188: 30,2300           03633                           STORE    YCO                                   
036405,000189: 30,2301           26275                           STOVL    YDOTD                                 
036406,000190: 30,2302           01563                                    VRECTCSM                              
036407,000191: 30,2303           64235                           VXV      MXV                                   
036408,000192: 30,2304           01555                                    RRECTCSM                              
036409,000193: 30,2305           01732                                    REFSMMAT                              
036410,000194: 30,2306           77656                           UNIT                                           
036411,000195: 30,2307           03720                           STORE    QAXIS                                 
036412,000196: 30,2310           77616                           RVQ                                            
036413,000197: 
036414,000198: 30,2311           02024        P12ADRES           REMADR   P12TABLE                              
036415,000199: 
036416,000200: 34,2000                                           SETLOC   ASENT8                                
036417,000201: 34,2000                                           BANK                                           
036418,000202: 34,3346                                           COUNT*   $$/P12                                
036419,000203: 
036420,000204: 34,3346           40220        GUIDINIT           STQ      SETPD                                 
036421,000205: 34,3347           01163                                    TEMPR60                               
036422,000206: 34,3350           00001                                    0D                                    
036423,000207: 34,3351           41575                           VLOAD    PUSH                                  
036424,000208: 34,3352           06512                                    UNITZ                                 
036425,000209: 34,3353           41434                           RTB      PUSH                                  
036426,000210: 34,3354           21574                                    LOADTIME                              
036427,000211: 34,3355           77624                           CALL                                           
036428,000212: 34,3356           55720                                    RP-TO-R                               
036429,000213: 34,3357           74321                           MXV      VXSC                                  
036430,000214: 34,3360           01732                                    REFSMMAT                              
036431,000215: 34,3361           16027                                    MOONRATE                              
036432,000216: 34,3362           26325                           STOVL    WM                                    
036433,000217: 34,3363           02021                                    RLS                                   
036434,000218: 34,3364           52446                           ABVAL    SL3                                   
036435,000219: 34,3365           36333                           STCALL   /LAND/                                
036436,000220: 34,3366           01163                                    TEMPR60                               
036437,000221: 
036438,000222: 34,3367           00046 07374  49FPS              2DEC     .149352    B-6                        #  EXPECTED RDOT AT TIPOVER
036439,000223: 
036440,000224: 34,3371           04145 15527  VINJNOM            2DEC     16.7924    B-7                        #  5509.5 FPS(APO=30NM WITH RDOT=19.5FPS)
036441,000225: 
036442,000226: 34,3373           00007 23346  RDOTDNOM           2DEC     .059436    B-7                        #  19.5 FPS
036443,000227: 

Page 833 This page is empty in the hardcopy of the original assembly listing.


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