Source Code

These source-code files derive from a printout of Luminary 210 (Apollo 15-17 Lunar Module guidance computer program), from the personal library of original AGC developer Don Eyles, digitally photographed at archive.org, financially sponsored by Jim Lawton, and transcribed to source code by a team of volunteers. This colorized, syntax-highlighted form was created by assembling that transcribed source code. Note that the full page images are available on the Virtual AGC project page at archive.org, while reduced-size images are presented at the VirtualAGC project website. Report or fix any transcription errors at the Virtual AGC project code repository.

Notations on the program listing read, in part:

	GAP: ASSEMBLE REVISION 210 OF AGC PROGRAM LUMINARY 
	BY NASA 2021112-161 17:11 MAR. 19,1971
Note that the date is the date of the printout, not the date of the program revision.

037073,000002:                                                                                                  ## Copyright:   Public domain.
037074,000003:                                                                                                  ## Filename:    P12.agc
037075,000004:                                                                                                  ## Purpose:     A section of Luminary revision 210.
037076,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
037077,000006:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 15-17.
037078,000007:                                                                                                  ##              This file is intended to be a faithful transcription, except
037079,000008:                                                                                                  ##              that the code format has been changed to conform to the
037080,000009:                                                                                                  ##              requirements of the yaYUL assembler rather than the
037081,000010:                                                                                                  ##              original YUL assembler.
037082,000011:                                                                                                  ## Reference:   pp. 839-843
037083,000012:                                                                                                  ## Assembler:   yaYUL
037084,000013:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
037085,000014:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
037086,000015:                                                                                                  ## Mod history: 2016-11-17 JL   Created from Luminary131 version.
037087,000016:                                                                                                  ##              2016-12-01 RSB  Completed transcription
037088,000017:                                                                                                  ##              2016-12-10 HG   Fix constant  VINJNOM -> 16.79299
037089,000018:                                                                                                  ##              2016-12-12 hg   Fix interpretive operator STOVL -> STCALL
037090,000019:                                                                                                  ##              2016-12-25 RSB  Comment-text proofed using ProoferComments
037091,000020:                                                                                                  ##                              and corrected errors found.
037092,000021:                                                                                                  ##              2017-01-28 RSB  Proofed comment text using octopus/prooferComments
037093,000022:                                                                                                  ##                              and fixed errors found.
037094,000023:                                                                                                  ##              2017-08-26 MAS  Fixed a comment-text error found while transcribing
037095,000024:                                                                                                  ##                              Zerlina 56.
037096,000025: 

Page 839

037098,000027: 24,3644                                           BANK     24                                    
037099,000028: 30,2000                                           SETLOC   P12                                   
037100,000029: 30,2000                                           BANK                                           
037101,000030: 
037102,000031: 30,2061  E7,1515                                  EBANK=   DVCNTR                                
037103,000032: 30,2061                                           COUNT*   $$/P12                                
037104,000033: 
037105,000034: 30,2061           05355        P12LM              TC       PHASCHNG                              
037106,000035: 30,2062           04024                           OCT      04024                                 
037107,000036: 
037108,000037: 30,2063           04607                           TC       BANKCALL                              
037109,000038: 30,2064           33757                           CADR     R02BOTH                               #  CHECK THE STATUS OF THE IMU.
037110,000039: 
037111,000040: 30,2065           36000                           CAF      THRESH2                               #  INITIALIZE DVMON
037112,000041: 30,2066           55250                           TS       DVTHRUSH                              
037113,000042: 30,2067           34742                           CAF      FOUR                                  
037114,000043: 30,2070           55515                           TS       DVCNTR                                
037115,000044: 
037116,000045: 30,2071           33014                           CAF      V06N33A                               
037117,000046: 30,2072           04607                           TC       BANKCALL                              #  FLASH TIG
037118,000047: 30,2073           20471                           CADR     GOFLASH                               
037119,000048: 30,2074           16001                           TCF      GOTOPOOH                              
037120,000049: 30,2075           12077                           TCF      +2                                    #  PROCEED
037121,000050: 30,2076           12071                           TCF      -5                                    #  ENTER
037122,000051: 
037123,000052: 30,2077           05355                           TC       PHASCHNG                              
037124,000053: 30,2100           04024                           OCT      04024                                 
037125,000054: 
037126,000055: 30,2101           06060                           TC       INTPRET                               
037127,000056: 30,2102           43014                           SET      SET                                   
037128,000057: 30,2103           03067                                    MUNFLAG                               
037129,000058: 30,2104           06464                                    ACC4-2FL                              
037130,000059: 30,2105           43014                           SET      CLEAR                                 
037131,000060: 30,2106           00075                                    R10FLAG                               
037132,000061: 30,2107           00270                                    RNDVZFLG                              
037133,000062: 30,2110           43014                           SET      SET                                   
037134,000063: 30,2111           04464                                    FLPI                                  
037135,000064: 30,2112           04461                                    FLVR                                  
037136,000065: 30,2113           45014                           CLEAR    CALL                                  
037137,000066: 30,2114           04665                                    FLRCS                                 
037138,000067: 30,2115           71346                                    GUIDINIT                              
037139,000068: 30,2116           77624                           CALL                                           
037140,000069: 30,2117           60243                                    P12INIT                               
037141,000070: 30,2120           77745        P12LMB             DLOAD                                          
037142,000071: 30,2121           25650                                    (TGO)A                                #  SET TGO TO AN INITIAL NOMINAL VALUE.
037143,000072: 30,2122           17517                           STODL    TGO                                   
037144,000073: 30,2123           03442                                    TIG                                   
037145,000074: 30,2124           34041                           STCALL   TDEC1                                 
037146,000075: 30,2125           27115                                    LEMPREC                               #  ROTATE THE STATE VECTORS TO THE
037147,000076: 30,2126           64375                           VLOAD    MXV                                   #  IGNITION TIME.

Page 840

037149,000078: 30,2127           00007                                    VATT                                  
037150,000079: 30,2130           01732                                    REFSMMAT                              
037151,000080: 30,2131           77772                           VSL1                                           
037152,000081: 30,2132           27601                           STOVL    V1S                                   #  COMPUTE V1S = VEL(TIG)*2(-7) M/CS.
037153,000082: 30,2133           00001                                    RATT                                  
037154,000083: 30,2134           52521                           MXV      VSL6                                  
037155,000084: 30,2135           01732                                    REFSMMAT                              
037156,000085: 30,2136           37521                           STCALL   R                                     #  COMPUTE R = POS(TIG)*2(-24) M.
037157,000086: 30,2137           67037                                    MUNGRAV                               #  COMPUTE GDT1/2(TIG)*2(-7)M/CS.
037158,000087: 30,2140           53575                           VLOAD    UNIT                                  
037159,000088: 30,2141           03521                                    R                                     
037160,000089: 30,2142           37537                           STCALL   UNIT/R/                               #  COMPUTE UNIT/R/ FOR YCOMP.
037161,000090: 30,2143           57315                                    YCOMP                                 
037162,000091: 30,2144           57461                           SR       DCOMP                                 
037163,000092: 30,2145           20606                                    5D                                    
037164,000093: 30,2146           17643                           STODL    XRANGE                                #  INITIALIZE XRANGE FOR NOUN 76.
037165,000094: 30,2147           31372                                    VINJNOM                               
037166,000095: 30,2150           16270                           STODL    ZDOTD                                 
037167,000096: 30,2151           31374                                    RDOTDNOM                              
037168,000097: 30,2152           02264                           STORE    RDOTD                                 
037169,000098: 30,2153           77776                           EXIT                                           
037170,000099: 
037171,000100: 30,2154           05355                           TC       PHASCHNG                              
037172,000101: 30,2155           04024                           OCT      04024                                 
037173,000102: 
037174,000103: 30,2156           33013        NEWLOAD            CAF      V06N76                                #  FLASH CROSS-RANGE AND APOLUNE VALUES.
037175,000104: 30,2157           04607                           TC       BANKCALL                              
037176,000105: 30,2160           20471                           CADR     GOFLASH                               
037177,000106: 30,2161           16001                           TCF      GOTOPOOH                              
037178,000107: 30,2162           12164                           TCF      +2                                    #  PROCEED
037179,000108: 30,2163           12156                           TCF      NEWLOAD                               #  ENTER NEW DATA.
037180,000109: 
037181,000110: 30,2164           32306                           CAF      P12ADRES                              
037182,000111: 30,2165           55455                           TS       WHICH                                 
037183,000112: 
037184,000113: 30,2166           05355                           TC       PHASCHNG                              
037185,000114: 30,2167           04024                           OCT      04024                                 
037186,000115: 
037187,000116: 30,2170           06060                           TC       INTPRET                               
037188,000117: 30,2171           54345                           DLOAD    SL                                    
037189,000118: 30,2172           03643                                    XRANGE                                
037190,000119: 30,2173           20206                                    5D                                    
037191,000120: 30,2174           77615                           DAD                                            
037192,000121: 30,2175           02326                                    Y                                     
037193,000122: 30,2176           27633                           STOVL    YCO                                   
037194,000123: 30,2177           03537                                    UNIT/R/                               
037195,000124: 30,2200           53361                           VXSC     VAD                                   
037196,000125: 30,2201           31370                                    49FPS                                 
037197,000126: 30,2202           03601                                    V1S                                   
037198,000127: 30,2203           03527                           STORE    V                                     #  V(TIPOVER) = V(IGN) + 57FPS (UNIT/R/)

Page 841

037200,000129: 30,2204           72441                           DOT      SL1                                   
037201,000130: 30,2205           03537                                    UNIT/R/                               
037202,000131: 30,2206           37474                           STCALL   RDOT                                  #  RDOT * 2(-7)
037203,000132: 30,2207           60307                                    ASCENT                                
037204,000133: 30,2210           77745        P12RET             DLOAD                                          
037205,000134: 30,2211           02352                                    ATP                                   #  ATP(2)*2(18)
037206,000135: 30,2212           65316                           DSQ      PDDL                                  
037207,000136: 30,2213           02346                                    ATY                                   #  ATY(2)*2(18)
037208,000137: 30,2214           43316                           DSQ      DAD                                   
037209,000138: 30,2215           75454                           BZE      SQRT                                  
037210,000139: 30,2216           60222                                    YAWDUN                                
037211,000140: 30,2217           55352                           SL1      BDDV                                  
037212,000141: 30,2220           02346                                    ATY                                   
037213,000142: 30,2221           77736                           ARCSIN                                         
037214,000143: 30,2222           26354        YAWDUN             STOVL    YAW                                   
037215,000144: 30,2223           03252                                    UNFC/2                                
037216,000145: 30,2224           50256                           UNIT     DOT                                   
037217,000146: 30,2225           03537                                    UNIT/R/                               
037218,000147: 30,2226           65552                           SL1      ARCCOS                                
037219,000148: 30,2227           77676                           DCOMP                                          
037220,000149: 30,2230           02356                           STORE    PITCH                                 
037221,000150: 30,2231           77776                           EXIT                                           
037222,000151: 30,2232           05355                           TC       PHASCHNG                              
037223,000152: 30,2233           04024                           OCT      04024                                 
037224,000153: 
037225,000154: 30,2234           00004                           INHINT                                         
037226,000155: 30,2235           04665                           TC       IBNKCALL                              
037227,000156: 30,2236           40143                           CADR     PFLITEDB                              
037228,000157: 30,2237           05520                           TC       DOWNFLAG                              
037229,000158: 30,2240           00213                           ADRES    FLPI                                  
037230,000159: 
037231,000160: 30,2241           04626                           TC       POSTJUMP                              
037232,000161: 30,2242           74130                           CADR     BURNBABY                              
037233,000162: 
037234,000163: 30,2243           77745        P12INIT            DLOAD                                          #  INITIALIZE ENGINE DATA. USED FOR P12 AND
037235,000164: 30,2244           16013                                    (1/DV)A                               #  P71.
037236,000165: 30,2245           03641                           STORE    1/DV3                                 
037237,000166: 30,2246           03637                           STORE    1/DV2                                 
037238,000167: 30,2247           17635                           STODL    1/DV1                                 
037239,000168: 30,2250           16017                                    (AT)A                                 
037240,000169: 30,2251           16254                           STODL    AT                                    
037241,000170: 30,2252           16021                                    (TBUP)A                               
037242,000171: 30,2253           16262                           STODL    TBUP                                  
037243,000172: 30,2254           34013                                    ATDECAY                               
037244,000173: 30,2255           54276                           DCOMP    SL                                    
037245,000174: 30,2256           20214                                    11D                                   
037246,000175: 30,2257           02260                           STORE    TTO                                   
037247,000176: 30,2260           57535                           SLOAD    DCOMP                                 
037248,000177: 30,2261           26001                                    APSVEX                                
037249,000178: 30,2262           77702                           SR2                                            

Page 842

037251,000180: 30,2263           02256                           STORE    VE                                    
037252,000181: 30,2264           43414                           BOFF     RVQ                                   
037253,000182: 30,2265           04747                                    FLAP                                  
037254,000183: 30,2266           60267                                    COMMINIT                              
037255,000184: 30,2267           43345        COMMINIT           DLOAD    DAD                                   #  INITIALIZE TARGET DATA. USED BY P12, P70
037256,000185: 30,2270           25646                                    HINJECT                               #  AND P71 IF IT DOES NOT FOLLOW P70.
037257,000186: 30,2271           02324                                    /LAND/                                
037258,000187: 30,2272           17631                           STODL    RCO                                   
037259,000188: 30,2273           06505                                    HI6ZEROS                              
037260,000189: 30,2274           03654                           STORE    TXO                                   
037261,000190: 30,2275           03633                           STORE    YCO                                   
037262,000191: 30,2276           26266                           STOVL    YDOTD                                 
037263,000192: 30,2277           01563                                    VRECTCSM                              
037264,000193: 30,2300           64235                           VXV      MXV                                   
037265,000194: 30,2301           01555                                    RRECTCSM                              
037266,000195: 30,2302           01732                                    REFSMMAT                              
037267,000196: 30,2303           77656                           UNIT                                           
037268,000197: 30,2304           02600                           STORE    QAXIS                                 
037269,000198: 30,2305           77616                           RVQ                                            
037270,000199: 
037271,000200: 30,2306           02024        P12ADRES           REMADR   P12TABLE                              
037272,000201: 
037273,000202: 34,2000                                           SETLOC   ASENT8                                
037274,000203: 34,2000                                           BANK                                           
037275,000204: 34,3346                                           COUNT*   $$/P12                                
037276,000205: 
037277,000206: 34,3346           40220        GUIDINIT           STQ      SETPD                                 
037278,000207: 34,3347           01163                                    TEMPR60                               
037279,000208: 34,3350           00001                                    0D                                    
037280,000209: 34,3351           41575                           VLOAD    PUSH                                  
037281,000210: 34,3352           06477                                    UNITZ                                 
037282,000211: 34,3353           41434                           RTB      PUSH                                  
037283,000212: 34,3354           21603                                    LOADTIME                              
037284,000213: 34,3355           77624                           CALL                                           
037285,000214: 34,3356           55716                                    RP-TO-R                               
037286,000215: 34,3357           74321                           MXV      VXSC                                  
037287,000216: 34,3360           01732                                    REFSMMAT                              
037288,000217: 34,3361           16027                                    MOONRATE                              
037289,000218: 34,3362           26316                           STOVL    WM                                    
037290,000219: 34,3363           02021                                    RLS                                   
037291,000220: 34,3364           52446                           ABVAL    SL3                                   
037292,000221: 34,3365           36324                           STCALL   /LAND/                                
037293,000222: 34,3366           01163                                    TEMPR60                               
037294,000223: 
037295,000224: 34,3367           00046 07374  49FPS              2DEC     .149352    B-6                        #  EXPECTED RDOT AT TIPOVER
037296,000225: 
037297,000226: 34,3371           04145 20055  VINJNOM            2DEC     16.79299   B-7                        #  5509.5 FPS(APO=30NM WITH RDOT=19.5FPS)
037298,000227: 
037299,000228: 34,3373           00007 23346  RDOTDNOM           2DEC     .059436    B-7                        #  19.5 FPS
037300,000229: 

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


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