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.

030975,000002:                                                                                                  ## Copyright:   Public domain.
030976,000003:                                                                                                  ## Filename:    R31.agc
030977,000004:                                                                                                  ## Purpose:     The main source file for Luminary revision 069.
030978,000005:                                                                                                  ##              It is part of the source code for the original release
030979,000006:                                                                                                  ##              of the flight software for the Lunar Module's (LM) Apollo
030980,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 10. The actual flown
030981,000008:                                                                                                  ##              version was Luminary 69 revision 2, which included a
030982,000009:                                                                                                  ##              newer lunar gravity model and only affected module 2.
030983,000010:                                                                                                  ##              This file is intended to be a faithful transcription, except
030984,000011:                                                                                                  ##              that the code format has been changed to conform to the
030985,000012:                                                                                                  ##              requirements of the yaYUL assembler rather than the
030986,000013:                                                                                                  ##              original YUL assembler.
030987,000014:                                                                                                  ## Reference:   pp. 712-716
030988,000015:                                                                                                  ## Assembler:   yaYUL
030989,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
030990,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
030991,000018:                                                                                                  ## Mod history: 2016-12-13 MAS  Created from Luminary 99.
030992,000019:                                                                                                  ##              2016-12-14 MAS  Updated from comment-proofed Luminary 99 version.
030993,000020:                                                                                                  ##              2016-12-15 RRB  Updated for Luminary 69.
030994,000021:                                                                                                  ##              2017-01-20 HG   add label V16N54
030995,000022:                                                                                                  ##                              fix label REDOEXPT -> REDOEXTP
030996,000023:                                                                                                  ##                                        GETRVN   -> GETRVN2
030997,000024:                                                                                                  ##                              fix operand RRONE   -> RONE 
030998,000025:                                                                                                  ##                                          REFSMAT -> REFSMMAT
030999,000026:                                                                                                  ##                                          RHTETA  -> RTHETA
031000,000027:                                                                                                  ##                                          EDNEXT  -> ENDEXT
031001,000028:                                                                                                  ##              2017-01-22 HG   Add missing segemnt of interpretive statements
031002,000029:                                                                                                  ##                              Fix some comments, remove tabs
031003,000030:                                                                                                  ##              2017-01-28 RSB  Proofed comment text using octopus/prooferComments
031004,000031:                                                                                                  ##                              and fixed errors found.
031005,000032:                                                                                                  ##              2021-05-30 ABS  Aligned IAW to field boundary.
031006,000033: 

Page 712

031008,000035: 34,3271                                           BANK     34                                    
031009,000036: 37,2000                                           SETLOC   R31                                   
031010,000037: 37,2000                                           BANK                                           
031011,000038: 
031012,000039: 37,3113                                           COUNT*   $$/R31                                
031013,000040: 
031014,000041: 37,3113           35015        R31CALL            CAF      PRIO3                                 
031015,000042: 37,3114           05105                           TC       FINDVAC                               
031016,000043: 37,3115  E7,1466                                  EBANK=   SUBEXIT                               
031017,000044: 37,3115           03145 76067                     2CADR    V83CALL                               
031018,000045: 
031019,000046: 37,3117           05221        DSPDELAY           TC       FIXDELAY                              
031020,000047: 37,3120           00144                           DEC      100        B-14                       
031021,000048: 37,3121           31044                           CA       EXTVBACT                              
031022,000049: 37,3122           74740                           MASK     BIT12                                 
031023,000050: 37,3123           00006                           EXTEND                                         
031024,000051: 37,3124           13117                           BZF      DSPDELAY                              
031025,000052: 
031026,000053: 37,3125           35017                           CAF      PRIO5                                 
031027,000054: 37,3126           05072                           TC       NOVAC                                 
031028,000055: 37,3127  E7,1607                                  EBANK=   TSTRT                                 
031029,000056: 37,3127           03132 76067                     2CADR    DISPN5X                               
031030,000057: 
031031,000058: 37,3131           15261                           TCF      TASKOVER                              
031032,000059: 
031033,000060: 37,3132           33240        DISPN5X            CAF      V16N54                                
031034,000061: 37,3133           04616                           TC       BANKCALL                              
031035,000062: 37,3134           20212                           CADR     GOMARKF                               
031036,000063: 37,3135           05563                           TC       B5OFF                                 
031037,000064: 37,3136           05563                           TC       B5OFF                                 
031038,000065: 37,3137           13132                           TCF      DISPN5X                               
031039,000066: 
031040,000067: 37,3140           06036        V83                TC       INTPRET                               
031041,000068: 37,3141           77624                           CALL                                           
031042,000069: 37,3142           77371                                    REDOEXTP                              
031043,000070: 37,3143           77650                           GOTO                                           
031044,000071: 37,3144           77150                                    COMPDISP                              
031045,000072: 37,3145           06036        V83CALL            TC       INTPRET                               
031046,000073: 37,3146           77624                           CALL                                           
031047,000074: 37,3147           77241                                    STATEXTP                              #  EXTRAPOLATE STATE VECTORS
031048,000075: 37,3150           52375        COMPDISP           VLOAD    VSU                                   
031049,000076: 37,3151           00001                                    RATT                                  
031050,000077: 37,3152           02213                                    RONE                                  
031051,000078: 37,3153           51406                           PUSH     ABVAL                                 #  RATT-RONE TO 0D               PD = 6
031052,000079: 37,3154           02205                           STORE    RANGE                                 #  METERS B-29
031053,000080: 37,3155           77301                           NORM     VLOAD                                 
031054,000081: 37,3156           00047                                    X1                                    #  RATT-RONE                     PD = 0
031055,000082: 37,3157           53457                           VSL*     UNIT                                  
031056,000083: 37,3160           20201                                    0,1                                   

Page 713

031058,000085: 37,3161           52315                           PDVL     VSU                                   #  UNIT(LOS) TO 0D              PD = 6
031059,000086: 37,3162           00007                                    VATT                                  
031060,000087: 37,3163           02221                                    VONE                                  
031061,000088: 37,3164           77641                           DOT                                            #  (VATT-VONE).UNIT(LOS)        PD = 0
031062,000089: 37,3165           77752                           SL1                                            
031063,000090: 37,3166           26207                           STOVL    RRATE                                 #  RANGE RATE M/CS B-7
031064,000091: 37,3167           02213                                    RONE                                  
031065,000092: 37,3170           63256                           UNIT     PDVL                                  #  UR TO 0D                           PD = 6
031066,000093: 37,3171           06416                                    THISAXIS                              #  UNITX FOR CM, UNTIZ FOR LM
031067,000094: 37,3172           77624                           CALL                                           
031068,000095: 37,3173           47565                                    CDU*NBSM                              
031069,000096: 37,3174           41505                           VXM      PUSH                                  #  UXORZ TO 6D                  PD=12D
031070,000097: 37,3175           01734                                    REFSMMAT                              
031071,000098: 37,3176           72431                           VPROJ    VSL2                                  
031072,000099: 37,3177           00001                                    0D                                    
031073,000100: 37,3200           53445                           BVSU     UNIT                                  
031074,000101: 37,3201           00007                                    6D                                    
031075,000102: 37,3202           47315                           PDVL     VXV                                   #  UP/2 TO 12D                  PD=18D
031076,000103: 37,3203           02213                                    RONE                                  
031077,000104: 37,3204           02221                                    VONE                                  
031078,000105: 37,3205           47256                           UNIT     VXV                                   
031079,000106: 37,3206           02213                                    RONE                                  
031080,000107: 37,3207           63241                           DOT      PDVL                                  #  SIGN TO 12D, UP/2 TO MPAC    PD=18D
031081,000108: 37,3210           00015                                    12D                                   
031082,000109: 37,3211           50372                           VSL1     DOT                                   #  UP.UXORZ
031083,000110: 37,3212           00007                                    6D                                    
031084,000111: 37,3213           72565                           SIGN     SL1                                   
031085,000112: 37,3214           00015                                    12D                                   
031086,000113: 37,3215           77726                           ACOS                                           
031087,000114: 37,3216           26211                           STOVL    RTHETA                                
031088,000115: 37,3217           02213                                    RONE                                  
031089,000116: 37,3220           51041                           DOT      BPL                                   
031090,000117: 37,3221           00007                                    6D                                    
031091,000118: 37,3222           77227                                    +5                                    
031092,000119: 37,3223           44345                           DLOAD    BDSU                                  #  IF UXORZ.R NEG, RTHETA = 1 - RTHETA
031093,000120: 37,3224           02211                                    RTHETA                                
031094,000121: 37,3225           06432                                    DPPOSMAX                              
031095,000122: 37,3226           02211                           STORE    RTHETA                                #  RTHETA BETWEEN 0 AND 1 REV.
031096,000123: 37,3227           77776                           EXIT                                           
031097,000124: 37,3230           34747                           CAF      BIT5                                  #  HAVE WE BEEN ANSWERED
031098,000125: 37,3231           71044                           MASK     EXTVBACT                              
031099,000126: 37,3232           00006                           EXTEND                                         
031100,000127: 37,3233           15472                           BZF      ENDEXT                                #  YES, DIE
031101,000128: 
031102,000129: 37,3234           41044                           CS       EXTVBACT                              
031103,000130: 37,3235           74740                           MASK     BIT12                                 
031104,000131: 37,3236           27044                           ADS      EXTVBACT                              
031105,000132: 
031106,000133: 37,3237           13140                           TCF      V83                                   
031107,000134: 37,3240           04066        V16N54             VN       1654                                  
031108,000135: 

Page 714

031110,000137:                                                                                                  #  THE STATEXTP SUBROUTINE DOES A PRECISION EXTRAPOLATION OF BOTH VEHICLES
031111,000138:                                                                                                  #  STATE VECTORS TO PRESENT TIME AND SAVES THEM AS BASE VECTORS.
031112,000139:                                                                                                  #  IF SERVICER IS OFF ---
031113,000140:                                                                                                  #                  THIS VEHICLES BASE VECTOR IS CONIC EXTRAPOLATED TO
031114,000141:                                                                                                  #                  PRESENT TIME AND SAVED AS RONE, VONE.
031115,000142:                                                                                                  #                  THE OTHER VEHICLES BASE VECTOR IS CONIC EXTRAPOLATED
031116,000143:                                                                                                  #                  TO THE SAME TIME, THE OUTPUT BEING LEFT IN RATT, VATT.
031117,000144:                                                                                                  #  IF SERVICER IS ON ---
031118,000145:                                                                                                  #                  RONE, VONE ARE SET EQUAL TO RN, VN AND THE OTHER
031119,000146:                                                                                                  #                  VEHICLES STATE VECTOR IS PREC. EXTRAPOLATED TO PIPTIME.
031120,000147: 
031121,000148: 37,3241           47020        STATEXTP           STQ      RTB                                   
031122,000149: 37,3242           02116                                    STATEXIT                              
031123,000150: 37,3243           21462                                    LOADTIME                              
031124,000151: 37,3244           34041                           STCALL   TDEC1                                 
031125,000152: 37,3245           27043                                    OTHPREC                               #  GET BASE VECTORS
031126,000153: 37,3246           77775                           VLOAD                                          
031127,000154: 37,3247           00017                                    RATT1                                 
031128,000155: 37,3250           26140                           STOVL    BASEOTP                               #  OTHER POS.
031129,000156: 37,3251           00025                                    VATT1                                 
031130,000157: 37,3252           16120                           STODL    BASEOTV                               #  OTHER VEL.
031131,000158: 37,3253           00015                                    TAT                                   
031132,000159: 37,3254           02114                           STORE    BASETIME                              
031133,000160: 37,3255           34041                           STCALL   TDEC1                                 
031134,000161: 37,3256           27057                                    THISPREC                              
031135,000162: 37,3257           77775                           VLOAD                                          
031136,000163: 37,3260           00017                                    RATT1                                 
031137,000164: 37,3261           26170                           STOVL    BASETHP                               #  THIS POS.
031138,000165: 37,3262           00025                                    VATT1                                 
031139,000166: 37,3263           02105                           STORE    BASETHV                               #  THIS VEL
031140,000167: 37,3264           47014        HAVEBASE           BON      RTB                                   
031141,000168: 37,3265           03712                                    AVEGFLAG                              
031142,000169: 37,3266           77346                                    GETRVN                                #  IF AVG ON ,GET RN ETC.
031143,000170: 37,3267           21462                                    LOADTIME                              
031144,000171: 37,3270           52014                           BON      GOTO                                  #  TEST FOR LM ON SURFACE.
031145,000172: 37,3271           04307                                    SURFFLAG                              
031146,000173: 37,3272           77365                                    R31SURF                               
031147,000174: 37,3273           77274                                    +1                                    
031148,000175: 37,3274           34041                           STCALL   TDEC1                                 #  BEGIN SET UP FOR CONIC EXTRAP. FOR THIS.
031149,000176: 37,3275           27412                                    INTSTALL                              
031150,000177: 37,3276           43175                           VLOAD    CLEAR                                 
031151,000178: 37,3277           02170                                    BASETHP                               
031152,000179: 37,3300           00263                                    MOONFLAG                              
031153,000180: 37,3301           25535                           STOVL    RCV                                   
031154,000181: 37,3302           02105                                    BASETHV                               
031155,000182: 37,3303           15543                           STODL    VCV                                   
031156,000183: 37,3304           02114                                    BASETIME                              
031157,000184: 37,3305           43014                           BOF      SET                                   #  GET APPROPRIATE MOONFLAG SETTING
031158,000185: 37,3306           04344                                    MOONTHIS                              
031159,000186: 37,3307           77311                                    +2                                    
031160,000187: 37,3310           00063                                    MOONFLAG                              

Page 715

031162,000189: 37,3311           77614                           SET                                            
031163,000190: 37,3312           01473                                    INTYPFLG                              #  CONIC EXTRAP.
031164,000191: 37,3313           35517                           STCALL   TET                                   
031165,000192: 37,3314           27107                                    INTEGRVS                              #  INTEGRATION --- AT LAST---
031166,000193: 37,3315           77775        OTHCONIC           VLOAD                                          
031167,000194: 37,3316           00001                                    RATT                                  
031168,000195: 37,3317           26213                           STOVL    RONE                                  
031169,000196: 37,3320           00007                                    VATT                                  
031170,000197: 37,3321           36221                           STCALL   VONE                                  #  GET SET FOR CONIC EXTRAP.,OTHER.
031171,000198: 37,3322           27412                                    INTSTALL                              
031172,000199: 37,3323           71214                           SET      DLOAD                                 
031173,000200: 37,3324           01473                                    INTYPFLG                              
031174,000201: 37,3325           00015                                    TAT                                   
031175,000202: 37,3326           00041        OTHINT             STORE    TDEC1                                 
031176,000203: 37,3327           43175                           VLOAD    CLEAR                                 
031177,000204: 37,3330           02140                                    BASEOTP                               
031178,000205: 37,3331           00263                                    MOONFLAG                              
031179,000206: 37,3332           25535                           STOVL    RCV                                   
031180,000207: 37,3333           02120                                    BASEOTV                               
031181,000208: 37,3334           15543                           STODL    VCV                                   
031182,000209: 37,3335           02114                                    BASETIME                              
031183,000210: 37,3336           43014                           BOF      SET                                   
031184,000211: 37,3337           04344                                    MOONTHIS                              
031185,000212: 37,3340           77342                                    +2                                    
031186,000213: 37,3341           00063                                    MOONFLAG                              
031187,000214: 37,3342           35517                           STCALL   TET                                   
031188,000215: 37,3343           27107                                    INTEGRVS                              
031189,000216: 37,3344           77650                           GOTO                                           
031190,000217: 37,3345           02116                                    STATEXIT                              #  THIS VEHICLES POS.,VEL. IN PUSHLIST.
031191,000218: 37,3346           52175        GETRVN             VLOAD    GOTO                                  
031192,000219: 37,3347           01221                                    RN                                    
031193,000220: 37,3350           77351                                    +1                                    
031194,000221: 37,3351           36213                           STCALL   RONE                                  
031195,000222: 37,3352           77353                                    +1                                    
031196,000223: 37,3353           52175                           VLOAD    GOTO                                  
031197,000224: 37,3354           01227                                    VN                                    
031198,000225: 37,3355           77356                                    +1                                    
031199,000226: 37,3356           16221                           STODL    VONE                                  
031200,000227: 37,3357           01235                                    PIPTIME                               
031201,000228: 37,3360           77624        GETRVN2            CALL                                           
031202,000229: 37,3361           27412                                    INTSTALL                              
031203,000230: 37,3362           52014                           CLEAR    GOTO                                  
031204,000231: 37,3363           01673                                    INTYPFLG                              #  PREC EXTRAP FOR OTHER
031205,000232: 37,3364           77326                                    OTHINT                                
031206,000233: 37,3365           34041        R31SURF            STCALL   TDEC1                                 #  LM ON SURFACE.
031207,000234: 37,3366           27057                                    LEMPREC                               
031208,000235: 37,3367           77650                           GOTO                                           #  DO CSM CONIC
031209,000236: 37,3370           77315                                    OTHCONIC                              

Page 716

031211,000238: 37,3371           52020        REDOEXTP           STQ      GOTO                                  
031212,000239: 37,3372           02116                                    STATEXIT                              
031213,000240: 37,3373           77264                                    HAVEBASE                              
031214,000241: 

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