Source Code

These source-code files were transcribed from scans made from Don Eyles's personal copy of Luminary 069. They were scanned at archive.org's Boston facility, and the scanning was sponsored by Onno Hommes. The code was transcribed from these scans by a team of volunteers who are referenced in the program comments. Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". In some cases, where similar code blocks exist in previously-transcribed AGC programs (primarily Luminary 99, from Apollo 11) those code blocks were used as a starting point and then corrected to agree with the Luminary 69 scans. The full scans are available at the Virtual AGC project's collection at archive.org, while more-convenient reduced-size (but reduced-quality) images are available at the main Virtual AGC website. Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository. Notations on the program listing read, in part:

	GAP:  ASSEMBLE REVISION 069 OF AGC PROGRAM LUMINARY BY NASA 2021112-011
	19:02 NOV. 25,1968
Note that the date is the date of the printout, not the date of the program revision.

037143,000002:                                                                                                  ## Copyright:   Public domain.
037144,000003:                                                                                                  ## Filename:    P12.agc
037145,000004:                                                                                                  ## Purpose:     The main source file for Luminary revision 069.
037146,000005:                                                                                                  ##              It is part of the source code for the original release
037147,000006:                                                                                                  ##              of the flight software for the Lunar Module's (LM) Apollo
037148,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 10. The actual flown
037149,000008:                                                                                                  ##              version was Luminary 69 revision 2, which included a
037150,000009:                                                                                                  ##              newer lunar gravity model and only affected module 2.
037151,000010:                                                                                                  ##              This file is intended to be a faithful transcription, except
037152,000011:                                                                                                  ##              that the code format has been changed to conform to the
037153,000012:                                                                                                  ##              requirements of the yaYUL assembler rather than the
037154,000013:                                                                                                  ##              original YUL assembler.
037155,000014:                                                                                                  ## Reference:   pp. 839-843
037156,000015:                                                                                                  ## Assembler:   yaYUL
037157,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
037158,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
037159,000018:                                                                                                  ## Mod history: 2016-12-13 MAS  Created from Luminary 99.
037160,000019:                                                                                                  ##              2016-12-18 MAS  Updated from comment-proofed Luminary 99 version.
037161,000020:                                                                                                  ##              2017-01-06 RRB  Updated for Luminary 69.
037162,000021:                                                                                                  ##              2017-01-07 HG   Fix interpretive operation STORE -> STODL
037163,000022:                                                                                                  ##                                               operand   FLP1 -> FLPI
037164,000023:                                                                                                  ##              2017-01-23 HG   Fix interpretive operation STOVL -> STODL
037165,000024:                                                                                                  ##              2017-01-28 RSB  Proofed comment text using octopus/prooferComments
037166,000025:                                                                                                  ##                              and fixed errors found.
037167,000026: 

Page 839

037169,000028: 24,3504                                           BANK     24                                    
037170,000029: 30,2000                                           SETLOC   P12                                   
037171,000030: 30,2000                                           BANK                                           
037172,000031: 
037173,000032: 30,2006  E7,1513                                  EBANK=   DVCNTR                                
037174,000033: 30,2006                                           COUNT*   $$/P12                                
037175,000034: 
037176,000035: 30,2006           05353        P12LM              TC       PHASCHNG                              
037177,000036: 30,2007           04024                           OCT      04024                                 
037178,000037: 
037179,000038: 30,2010           04616                           TC       BANKCALL                              
037180,000039: 30,2011           11175                           CADR     R02BOTH                               #  CHECK THE STATUS OF THE IMU.
037181,000040: 
037182,000041: 30,2012           05504                           TC       UPFLAG                                
037183,000042: 30,2013           00141                           ADRES    MUNFLAG                               
037184,000043: 
037185,000044: 30,2014           05504                           TC       UPFLAG                                #  INSURE 4-JET TRANSLATION CAPABILITY.
037186,000045: 30,2015           00307                           ADRES    ACC4-2FL                              
037187,000046: 
037188,000047: 30,2016           05504                           TC       UPFLAG                                #  PREVENT R10 FROM ISSUING CROSS-POINTER
037189,000048: 30,2017           00015                           ADRES    R10FLAG                               #  OUTPUTS.
037190,000049: 
037191,000050: 30,2020           05516                           TC       DOWNFLAG                              #  CLEAR RENDEZVOUS FLAG  FOR P22
037192,000051: 30,2021           00010                           ADRES    RNDVZFLG                              
037193,000052: 
037194,000053: 30,2022           36000                           CAF      THRESH2                               #  INITIALIZE DVMON
037195,000054: 30,2023           55251                           TS       DVTHRUSH                              
037196,000055: 30,2024           34751                           CAF      FOUR                                  
037197,000056: 30,2025           55513                           TS       DVCNTR                                
037198,000057: 
037199,000058: 30,2026           34755                           CA       ZERO                                  
037200,000059: 30,2027           55460                           TS       TRKMKCNT                              #  SHOW THAT R29 DOWNLINK DATA ISN'T READY.
037201,000060: 30,2030           33044                           CAF      V06N33A                               
037202,000061: 30,2031           04616                           TC       BANKCALL                              #  FLASH TIG
037203,000062: 30,2032           20351                           CADR     GOFLASH                               
037204,000063: 30,2033           16001                           TCF      GOTOPOOH                              
037205,000064: 30,2034           12036                           TCF      +2                                    #  PROCEED
037206,000065: 30,2035           12030                           TCF      -5                                    #  ENTER
037207,000066: 
037208,000067: 30,2036           05353                           TC       PHASCHNG                              
037209,000068: 30,2037           04024                           OCT      04024                                 
037210,000069: 
037211,000070: 30,2040           06036                           TC       INTPRET                               
037212,000071: 30,2041           77624                           CALL                                           #  INITIALIZE WM AND /LAND/
037213,000072: 30,2042           60264                                    GUIDINIT                              
037214,000073: 30,2043           45014                           SET      CALL                                  
037215,000074: 30,2044           04464                                    FLPI                                  
037216,000075: 30,2045           60204                                    P12INIT                               
037217,000076: 
037218,000077: 30,2046           77745        P12LMB             DLOAD                                          
037219,000078: 30,2047           25604                                    (TGO)A                                #  SET TGO TO AN INITIAL NOMINAL VALUE.

Page 840

037221,000080: 30,2050           17515                           STODL    TGO                                   
037222,000081: 30,2051           03440                                    TIG                                   
037223,000082: 30,2052           34041                           STCALL   TDEC1                                 
037224,000083: 30,2053           27057                                    LEMPREC                               #  ROTATE THE STATE VECTORS TO THE
037225,000084: 30,2054           64375                           VLOAD    MXV                                   #  IGNITION TIME.
037226,000085: 30,2055           00007                                    VATT                                  
037227,000086: 30,2056           01734                                    REFSMMAT                              
037228,000087: 30,2057           77772                           VSL1                                           
037229,000088: 30,2060           27577                           STOVL    V1S                                   #  COMPUTE V1S = VEL(TIG)*2(-7) M/CS.
037230,000089: 30,2061           00001                                    RATT                                  
037231,000090: 30,2062           52521                           MXV      VSL6                                  
037232,000091: 30,2063           01734                                    REFSMMAT                              
037233,000092: 30,2064           37517                           STCALL   R                                     #  COMPUTE R = POS(TIG)*2(-24) M.
037234,000093: 30,2065           67162                                    MUNGRAV                               #  COMPUTE GDT1/2(TIG)*2(-7)M/CS.
037235,000094: 30,2066           53575                           VLOAD    UNIT                                  
037236,000095: 30,2067           03517                                    R                                     
037237,000096: 30,2070           37535                           STCALL   UNIT/R/                               #  COMPUTE UNIT/R/ FOR YCOMP.
037238,000097: 30,2071           57316                                    YCOMP                                 
037239,000098: 30,2072           57461                           SR       DCOMP                                 
037240,000099: 30,2073           20606                                    5D                                    
037241,000100: 30,2074           17641                           STODL    XRANGE                                #  INITIALIZE XRANGE FOR NOUN 76.
037242,000101: 30,2075           20312                                    (APO)                                 
037243,000102: 30,2076           03643                           STORE    APO                                   #  INITIALIZE APO FOR NOUN 76.
037244,000103: 30,2077           77776                           EXIT                                           
037245,000104: 
037246,000105: 30,2100           05353                           TC       PHASCHNG                              
037247,000106: 30,2101           04024                           OCT      04024                                 
037248,000107: 
037249,000108: 30,2102           33043        NEWLOAD            CAF      V06N76                                #  FLASH CROSS-RANGE AND APOLUNE VALUES.
037250,000109: 30,2103           04616                           TC       BANKCALL                              
037251,000110: 30,2104           20351                           CADR     GOFLASH                               
037252,000111: 30,2105           16001                           TCF      GOTOPOOH                              
037253,000112: 30,2106           12110                           TCF      +2                                    #  PROCEED
037254,000113: 30,2107           12102                           TCF      NEWLOAD                               #  ENTER NEW DATA.
037255,000114: 
037256,000115: 30,2110           32306                           CAF      P12ADRES                              
037257,000116: 30,2111           55453                           TS       WHICH                                 
037258,000117: 
037259,000118: 30,2112           05353                           TC       PHASCHNG                              
037260,000119: 30,2113           04024                           OCT      04024                                 
037261,000120: 
037262,000121: 30,2114           06036                           TC       INTPRET                               
037263,000122: 30,2115           54345                           DLOAD    SL                                    
037264,000123: 30,2116           03641                                    XRANGE                                
037265,000124: 30,2117           20206                                    5D                                    
037266,000125: 30,2120           77615                           DAD                                            
037267,000126: 30,2121           02341                                    Y                                     
037268,000127: 30,2122           17631                           STODL    YCO                                   
037269,000128: 30,2123           03643                                    APO                                   #  RA = APO + /LAND/
037270,000129: 30,2124           77661                           SL                                             

Page 841

037272,000131: 30,2125           20206                                    5D                                    
037273,000132: 30,2126           41415                           DAD      PUSH                                  #  RA*2(-24) IN MPAC AND PDL
037274,000133: 30,2127           02337                                    /LAND/                                
037275,000134: 30,2130           65205                           DMP      PDDL                                  #  2 RA MU*2(-62) IN PDL, LOAD RA
037276,000135: 30,2131           20003                                    MUM(-37)                              
037277,000136: 30,2132           41215                           DAD      DMP                                   #  (RA+RP)*2(-24)
037278,000137: 30,2133           03627                                    RCO                                   #  RP(RA+RP)*2(-48)
037279,000138: 30,2134           03627                                    RCO                                   
037280,000139: 30,2135           75465                           BDDV     SQRT                                  #  2 MU RA/RP(RA+RP)*2(-14)=ZDOTD(2)
037281,000140: 30,2136           77626                           STADR                                          
037282,000141: 30,2137           51504                           STOVL    ZDOTD                                 
037283,000142: 30,2140           03535                                    UNIT/R/                               
037284,000143: 30,2141           53361                           VXSC     VAD                                   
037285,000144: 30,2142           20310                                    49FPS                                 
037286,000145: 30,2143           03577                                    V1S                                   
037287,000146: 30,2144           03525                           STORE    V                                     #  V(TIPOVER) = V(IGN) + 57FPS (UNIT/R/)
037288,000147: 30,2145           77614                           SETGO                                          
037289,000148: 30,2146           04421                                    FLVR                                  
037290,000149: 30,2147           60313                                    ASCENT                                
037291,000150: 30,2150           77745        P12RET             DLOAD                                          
037292,000151: 30,2151           02365                                    ATP                                   #  ATP(2)*2(18)
037293,000152: 30,2152           65316                           DSQ      PDDL                                  
037294,000153: 30,2153           02361                                    ATY                                   #  ATY(2)*2(18)
037295,000154: 30,2154           43316                           DSQ      DAD                                   
037296,000155: 30,2155           75454                           BZE      SQRT                                  
037297,000156: 30,2156           60162                                    YAWDUN                                
037298,000157: 30,2157           55352                           SL1      BDDV                                  
037299,000158: 30,2160           02361                                    ATY                                   
037300,000159: 30,2161           77736                           ARCSIN                                         
037301,000160: 30,2162           26367        YAWDUN             STOVL    YAW                                   
037302,000161: 30,2163           03252                                    UNFC/2                                
037303,000162: 30,2164           50256                           UNIT     DOT                                   
037304,000163: 30,2165           03535                                    UNIT/R/                               
037305,000164: 30,2166           65552                           SL1      ARCCOS                                
037306,000165: 30,2167           77676                           DCOMP                                          
037307,000166: 30,2170           02371                           STORE    PITCH                                 
037308,000167: 30,2171           77776                           EXIT                                           
037309,000168: 30,2172           05353                           TC       PHASCHNG                              
037310,000169: 30,2173           04024                           OCT      04024                                 
037311,000170: 
037312,000171: 30,2174           05516                           TC       DOWNFLAG                              
037313,000172: 30,2175           00213                           ADRES    FLPI                                  
037314,000173: 
037315,000174: 30,2176           00004                           INHINT                                         
037316,000175: 30,2177           04674                           TC       IBNKCALL                              
037317,000176: 30,2200           40142                           CADR     PFLITEDB                              
037318,000177: 30,2201           00003                           RELINT                                         
037319,000178: 
037320,000179: 30,2202           04635                           TC       POSTJUMP                              
037321,000180: 30,2203           74124                           CADR     BURNBABY                              

Page 842

037323,000182: 30,2204           77745        P12INIT            DLOAD                                          #  INITIALIZE ENGINE DATA.  USED FOR P12 AND
037324,000183: 30,2205           24001                                    (1/DV)A                               #  P71.
037325,000184: 30,2206           03637                           STORE    1/DV3                                 
037326,000185: 30,2207           03635                           STORE    1/DV2                                 
037327,000186: 30,2210           17633                           STODL    1/DV1                                 
037328,000187: 30,2211           24005                                    (AT)A                                 
037329,000188: 30,2212           16257                           STODL    AT                                    
037330,000189: 30,2213           24007                                    (TBUP)A                               
037331,000190: 30,2214           16265                           STODL    TBUP                                  
037332,000191: 30,2215           34013                                    ATDECAY                               
037333,000192: 30,2216           54276                           DCOMP    SL                                    
037334,000193: 30,2217           20214                                    11D                                   
037335,000194: 30,2220           02263                           STORE    TTO                                   
037336,000195: 30,2221           57535                           SLOAD    DCOMP                                 
037337,000196: 30,2222           26001                                    APSVEX                                
037338,000197: 30,2223           77702                           SR2                                            
037339,000198: 30,2224           02261                           STORE    VE                                    
037340,000199: 30,2225           43414                           BOFF     RVQ                                   
037341,000200: 30,2226           04747                                    FLAP                                  
037342,000201: 30,2227           60230                                    COMMINIT                              
037343,000202: 30,2230           43345        COMMINIT           DLOAD    DAD                                   #  INITIALIZE TARGET DATA. USED BY P12, P70
037344,000203: 30,2231           25602                                    HINJECT                               #  AND P71 IF IT DOES NOT FOLLOW P70.
037345,000204: 30,2232           02337                                    /LAND/                                
037346,000205: 30,2233           17627                           STODL    RCO                                   
037347,000206: 30,2234           06424                                    HI6ZEROS                              
037348,000207: 30,2235           03654                           STORE    TXO                                   
037349,000208: 30,2236           03631                           STORE    YCO                                   
037350,000209: 30,2237           02267                           STORE    RDOTD                                 
037351,000210: 30,2240           26271                           STOVL    YDOTD                                 
037352,000211: 30,2241           01563                                    VRECTCSM                              
037353,000212: 30,2242           64235                           VXV      MXV                                   
037354,000213: 30,2243           01555                                    RRECTCSM                              
037355,000214: 30,2244           01734                                    REFSMMAT                              
037356,000215: 30,2245           77656                           UNIT                                           
037357,000216: 30,2246           17716                           STODL    QAXIS                                 
037358,000217: 30,2247           02506                                    ABTVINJ2                              #  TENTATIVELY STORE LOW INJECTION VELOCITY
037359,000218: 30,2250           02273                           STORE    ZDOTD                                 
037360,000219: 30,2251           77614                           BON                                            
037361,000220: 30,2252           04704                                    FLPI                                  
037362,000221: 30,2253           60263                                    LOVEL                                 
037363,000222: 30,2254           45335                           SLOAD    DSU                                   
037364,000223: 30,2255           02503                                    TBRKPNT                               #  TBRKPNT-TGO
037365,000224: 30,2256           03515                                    TGO                                   
037366,000225: 30,2257           71240                           BMN      DLOAD                                 #  IF TGO>TBRKPNT,LOW VINJECT IS OK;RETURN
037367,000226: 30,2260           60263                                    LOVEL                                 
037368,000227: 30,2261           02504                                    ABTVINJ1                              #  FOR TGO.TBRKPNT USE HI VELOCITY.
037369,000228: 30,2262           02273                           STORE    ZDOTD                                 
037370,000229: 30,2263           77616        LOVEL              RVQ                                            
037371,000230: 30,2264           40220        GUIDINIT           STQ      SETPD                                 
037372,000231: 30,2265           01164                                    TEMPR60                               

Page 843

037374,000233: 30,2266           00001                                    0D                                    
037375,000234: 30,2267           41575                           VLOAD    PUSH                                  
037376,000235: 30,2270           06416                                    UNITZ                                 
037377,000236: 30,2271           41434                           RTB      PUSH                                  
037378,000237: 30,2272           21462                                    LOADTIME                              
037379,000238: 30,2273           45135                           SLOAD    CALL                                  
037380,000239: 30,2274           20312                                    (APO)                                 
037381,000240: 30,2275           51504                                    RP-TO-R                               
037382,000241: 30,2276           74321                           MXV      VXSC                                  
037383,000242: 30,2277           01734                                    REFSMMAT                              
037384,000243: 30,2300           20005                                    MOONRATE                              
037385,000244: 30,2301           26331                           STOVL    WM                                    
037386,000245: 30,2302           02023                                    RLS                                   
037387,000246: 30,2303           52446                           ABVAL    SL3                                   
037388,000247: 30,2304           36337                           STCALL   /LAND/                                
037389,000248: 30,2305           01164                                    TEMPR60                               
037390,000249: 
037391,000250: 30,2306           02022        P12ADRES           REMADR   P12TABLE                              #  NOT IN SAME BANK.
037392,000251: 30,2307           00046 07374  49FPS              2DEC     .149352    B-6                        #  EXPECTED RDOT AT TIPOVER
037393,000252: 
037394,000253: 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