Source Code

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

The reconstruction began with reconstructed source code for Luminary 173. Changes between revision 163 and 173 were backed out, as described by Luminary memos 157 and 158. 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 163 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.

028045,000002:                                                                                                  ## Copyright:   Public domain.
028046,000003:                                                                                                  ## Filename:    GROUND_TRACKING_DETERMINATION_PROGRAM_-_P21.agc
028047,000004:                                                                                                  ## Purpose:     A section of Luminary revision 163.
028048,000005:                                                                                                  ##              It is part of the reconstructed source code for the first
028049,000006:                                                                                                  ##              (unflown) release of the flight software for the Lunar
028050,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 14.
028051,000008:                                                                                                  ##              The code has been recreated from a reconstructed copy of
028052,000009:                                                                                                  ##              Luminary 173, as well as Luminary memos 157 amd 158.
028053,000010:                                                                                                  ##              It has been adapted such that the resulting bugger words
028054,000011:                                                                                                  ##              exactly match those specified for Luminary 163 in NASA
028055,000012:                                                                                                  ##              drawing 2021152N, which gives relatively high confidence
028056,000013:                                                                                                  ##              that the reconstruction is correct.
028057,000014:                                                                                                  ## Reference:   pp. 649-652
028058,000015:                                                                                                  ## Assembler:   yaYUL
028059,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
028060,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
028061,000018:                                                                                                  ## Mod history: 2019-08-21 MAS  Created from Luminary 173.
028062,000019: 

Page 649

028064,000021:                                                                                                  #  GROUND TRACKING DETERMINATION PROGRAM P21
028065,000022:                                                                                                  #  PROGRAM DESCRIPTION
028066,000023:                                                                                                  #  MOD NO - 1
028067,000024:                                                                                                  #  MOD BY - N.M.NEVILLE
028068,000025:                                                                                                  #  FUNCTIONAL DECRIPTION-
028069,000026: 
028070,000027:                                                                                                  #  TO PROVIDE THE ASTRONAUT DETAILS OF THE LM OR CSM GROUND TRACK WITHOUT
028071,000028:                                                                                                  #  THE NEED FOR GROUND COMMUNICATION (REQUESTED BY DSKY).
028072,000029:                                                                                                  #  CALLING SEQUENCE -
028073,000030: 
028074,000031:                                                                                                  #  ASTRONAUT REQUEST THROUGH DSKY V37E21E
028075,000032:                                                                                                  #  SUBROUTINES CALLED-
028076,000033: 
028077,000034:                                                                                                  #  GOPERF4
028078,000035:                                                                                                  #  GOFLASH
028079,000036:                                                                                                  #  THISPREC
028080,000037:                                                                                                  #  OTHPREC
028081,000038:                                                                                                  #  LAT-LONG
028082,000039:                                                                                                  #  NORMAL EXIT MODES-
028083,000040: 
028084,000041:                                                                                                  #  ASTRONAUT REQUEST TROUGH DSKY TO TERMINATE PROGRAM V34E
028085,000042:                                                                                                  #  ALARM OR ABORT EXIT MODES-
028086,000043: 
028087,000044:                                                                                                  #  NONE
028088,000045:                                                                                                  #  OUTPUT -
028089,000046: 
028090,000047:                                                                                                  #  OCTAL DISPLAY OF OPTION CODE AND VEHICLE WHOSE GROUND TRACK IS TO BE
028091,000048:                                                                                                  #  COMPUTED
028092,000049:                                                                                                  #           OPTION CODE  00002
028093,000050:                                                                                                  #           THIS         00001
028094,000051:                                                                                                  #           OTHER        00002
028095,000052:                                                                                                  #  DECIMAL DISPLAY OF TIME TO BE INTEGRATED TO HOURS , MINUTES , SECONDS
028096,000053:                                                                                                  #  DECIMAL DISPLAY OF LAT,LONG,ALT
028097,000054:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED
028098,000055: 
028099,000056:                                                                                                  #  AX0      2DEC   4.652459653 E-5   RADIANS       %68-69 CONSTANTS"
028100,000057: 
028101,000058:                                                                                                  #  -AY0     2DEC   2.147535898 E-5   RADIANS
028102,000059: 
028103,000060:                                                                                                  #  AZ0      2DEC   .7753206164       REVOLUTIONS
028104,000061:                                                                                                  #  FOR LUNAR ORBITS 504LM VECTOR IS NEEDED
028105,000062: 
028106,000063:                                                                                                  #  504LM    2DEC   -2.700340600 E-5  RADIANS
028107,000064: 
028108,000065:                                                                                                  #  504LM _2 2DEC   -7.514128400 E-4  RADIANS     
028109,000066: 
028110,000067:                                                                                                  #  504LM _4 2DEC   _2.553198641 E-4  RADIANS     
028111,000068: 
028112,000069:                                                                                                  #  NONE
028113,000070:                                                                                                  #  DEBRIS

Page 650

028115,000072: 
028116,000073:                                                                                                  #  CENTRALS-A,Q,L
028117,000074:                                                                                                  #  OTHER-THOSE USED BY THE ABOVE LISTED SUBROUTINES
028118,000075:                                                                                                  #  SEE LEMPREC,LAT-LONG
028119,000076: 35,2455  30,2000                                  SBANK=   LOWSUPER                              #  FOR LOW 2CADR'S.
028120,000077: 
028121,000078: 33,2117                                           BANK     33                                    
028122,000079: 24,2000                                           SETLOC   P20S                                  
028123,000080: 24,2000                                           BANK                                           
028124,000081: 
028125,000082: 24,3440  E7,1762                                  EBANK=   P21TIME                               
028126,000083: 24,3440                                           COUNT*   $$/P21                                
028127,000084: 24,3440           34753        PROG21             CAF      ONE                                   
028128,000085: 24,3441           55144                           TS       OPTION2                               #  ASSUMED VEHICLE IS LM , R2 = 00001
028129,000086: 24,3442           34752                           CAF      BIT2                                  #   OPTION 2
028130,000087: 24,3443           04616                           TC       BANKCALL                              
028131,000088: 24,3444           20634                           CADR     GOPERF4                               
028132,000089: 24,3445           06001                           TC       GOTOPOOH                              #  TERMINATE
028133,000090: 24,3446           03450                           TC       +2                                    #  PROCEED VALUE OF ASSUMED VEHICLE OK
028134,000091: 24,3447           03442                           TC       -5                                    #  R2 LOADED THROUGH DSKY
028135,000092: 24,3450           34755                           CAF      ZERO                                  #  INITIAL TIME = PRESENT TIME
028136,000093: 24,3451           55044                           TS       DSPTEM1                               
028137,000094: 24,3452           55045                           TS       DSPTEM1    +1                         
028138,000095: 24,3453           33627        P21PROG1           CAF      V6N34                                 #  LOAD DESIRED TIME OF LAT-LONG.
028139,000096: 24,3454           04616                           TC       BANKCALL                              
028140,000097: 24,3455           20477                           CADR     GOFLASH                               
028141,000098: 24,3456           06001                           TC       GOTOPOOH                              #  TERM
028142,000099: 24,3457           03461                           TC       +2                                    #  PROCEED VALUES OK
028143,000100: 24,3460           03453                           TC       -5                                    #  TIME LOADED THROUGH DSKY
028144,000101: 24,3461           06042                           TC       INTPRET                               
028145,000102: 24,3462           53145                           DLOAD    BZE                                   
028146,000103: 24,3463           01045                                    DSPTEM1                               
028147,000104: 24,3464           51621                                    P21PRTM                               
028148,000105: 24,3465           34041        P21PROG2           STCALL   TDEC1                                 #  INTEG TO TIME SPECIFIED IN TDEC1
028149,000106: 24,3466           27410                                    INTSTALL                              
028150,000107: 24,3467           43014                           BON      CLEAR                                 
028151,000108: 24,3470           00304                                    P21FLAG                               
028152,000109: 24,3471           51507                                    P21CONT                               #  ON---RECYCLE USING BASE VECTOR
028153,000110: 24,3472           01674                                    VINTFLAG                              #  OFF--1ST PASS CALL BASE VECTOR
028154,000111: 24,3473           70535                           SLOAD    SR1                                   
028155,000112: 24,3474           01145                                    OPTION2                               
028156,000113: 24,3475           43030                           BHIZ     SET                                   
028157,000114: 24,3476           51500                                    +2                                    #  ZERO--THIS VEHICLE(LM)
028158,000115: 24,3477           01474                                    VINTFLAG                              #  ONE--OTHER VEHICLE(CM)
028159,000116: 24,3500           43014                           CLEAR    CLEAR                                 
028160,000117: 24,3501           01676                                    DIM0FLAG                              
028161,000118: 24,3502           01673                                    INTYPFLG                              #  PRECISION
028162,000119: 24,3503           77624                           CALL                                           
028163,000120: 24,3504           27133                                    INTEGRV                               #  CALCULATE
028164,000121: 24,3505           77650                           GOTO                                           #  -AND

Page 651

028166,000123: 24,3506           51530                                    P21VSAVE                              #  -SAVE BASE VECTOR
028167,000124: 24,3507           77775        P21CONT            VLOAD                                          
028168,000125: 24,3510           03676                                    P21BASER                              #  RECYCLE--INTEG FROM BASE VECTOR
028169,000126: 24,3511           25535                           STOVL    RCV                                   #  --POS
028170,000127: 24,3512           03704                                    P21BASEV                              
028171,000128: 24,3513           15543                           STODL    VCV                                   #  --VEL
028172,000129: 24,3514           03763                                    P21TIME                               
028173,000130: 24,3515           01517                           STORE    TET                                   #  --TIME
028174,000131: 24,3516           43014                           CLEAR    CLEAR                                 
028175,000132: 24,3517           01676                                    DIM0FLAG                              
028176,000133: 24,3520           00263                                    MOONFLAG                              
028177,000134: 24,3521           53135                           SLOAD    BZE                                   
028178,000135: 24,3522           01163                                    P21ORIG                               
028179,000136: 24,3523           51526                                    +3                                    #  ZERO=EARTH
028180,000137: 24,3524           77614                           SET                                            #  ---2=MOON
028181,000138: 24,3525           00063                                    MOONFLAG                              
028182,000139: 24,3526           77624                 +3        CALL                                           
028183,000140: 24,3527           27106                                    INTEGRVS                              
028184,000141: 24,3530           77745        P21VSAVE           DLOAD                                          #  SAVE CURRENT BASE VECTOR
028185,000142: 24,3531           00015                                    TAT                                   
028186,000143: 24,3532           27763                           STOVL    P21TIME                               #  --TIME
028187,000144: 24,3533           00017                                    RATT1                                 
028188,000145: 24,3534           27676                           STOVL    P21BASER                              #  --POS B-29 OR B-27
028189,000146: 24,3535           00025                                    VATT1                                 
028190,000147: 24,3536           03704                           STORE    P21BASEV                              #  --VEL B-07 OR B-05
028191,000148: 24,3537           53646                           ABVAL    SL*                                   
028192,000149: 24,3540           57576                                    0,2                                   
028193,000150: 24,3541           27712                           STOVL    P21VEL                                #  VEL/ FOR N91 DISP
028194,000151: 24,3542           00001                                    RATT                                  
028195,000152: 24,3543           50256                           UNIT     DOT                                   
028196,000153: 24,3544           00007                                    VATT                                  #   U(R).V
028197,000154: 24,3545           67471                           DDV      ASIN                                  #  U(R).U(V)
028198,000155: 24,3546           03712                                    P21VEL                                
028199,000156: 24,3547           03714                           STORE    P21GAM                                #  SIN-1 U(R).U(V) , -90 TO &90
028200,000157: 24,3550           67334                           SXA,2    SLOAD                                 
028201,000158: 24,3551           01162                                    P21ORIG                               #  0=EARTH
028202,000159: 24,3552           01145                                    OPTION2                               
028203,000160: 24,3553           46142                           SR1      BHIZ                                  
028204,000161: 24,3554           51557                                    +3                                    
028205,000162: 24,3555           77650                           GOTO                                           
028206,000163: 24,3556           51562                                    +4                                    
028207,000164: 24,3557           77614                 +3        BON                                            
028208,000165: 24,3560           04307                                    SURFFLAG                              
028209,000166: 24,3561           51564                                    P21DSP                                
028210,000167: 24,3562           77614                 +4        SET                                            
028211,000168: 24,3563           00064                                    P21FLAG                               
028212,000169: 24,3564           67214        P21DSP             CLEAR    SLOAD                                 #  GENERATE DISPLAY DATA
028213,000170: 24,3565           01663                                    LUNAFLAG                              
028214,000171: 24,3566           00050                                    X2                                    

Page 652

028216,000173: 24,3567           43054                           BZE      SET                                   
028217,000174: 24,3570           51572                                    +2                                    #  0=EARTH
028218,000175: 24,3571           01463                                    LUNAFLAG                              
028219,000176: 24,3572           77775                           VLOAD                                          
028220,000177: 24,3573           00001                                    RATT                                  
028221,000178: 24,3574           16032                           STODL    ALPHAV                                
028222,000179: 24,3575           00015                                    TAT                                   
028223,000180: 24,3576           45014                           CLEAR    CALL                                  
028224,000181: 24,3577           00662                                    ERADFLAG                              
028225,000182: 24,3600           26347                                    LAT-LONG                              
028226,000183: 24,3601           77605                           DMP                                            #  MPAC = ALT,METERS B-29
028227,000184: 24,3602           11631                                    K.01                                  
028228,000185: 24,3603           03716                           STORE    P21ALT                                #  ALT/100 FOR N91 DISP
028229,000186: 24,3604           77776                           EXIT                                           
028230,000187: 24,3605           33626                           CAF      V06N43                                #  DISPLAY LAT,LONG,ALT
028231,000188: 24,3606           04616                           TC       BANKCALL                              #  LAT,LONG = 1/2 REVS B0
028232,000189: 24,3607           20477                           CADR     GOFLASH                               #  ALT = KM  B14
028233,000190: 24,3610           06001                           TC       GOTOPOOH                              #  TERM
028234,000191: 24,3611           06001                           TC       GOTOPOOH                              
028235,000192: 24,3612           06042                           TC       INTPRET                               #  V32E RECYCLE
028236,000193: 24,3613           43345                           DLOAD    DAD                                   
028237,000194: 24,3614           03763                                    P21TIME                               
028238,000195: 24,3615           11625                                    600SEC                                #  600 SECONDS OR 10 MIN
028239,000196: 24,3616           01045                           STORE    DSPTEM1                               
028240,000197: 24,3617           77634                           RTB                                            
028241,000198: 24,3620           51453                                    P21PROG1                              
028242,000199: 24,3621           52034        P21PRTM            RTB      GOTO                                  
028243,000200: 24,3622           21574                                    LOADTIME                              
028244,000201: 24,3623           51465                                    P21PROG2                              
028245,000202: 24,3624           00003 25140  600SEC             2DEC     60000      B-28                       #  10 MIN
028246,000203: 
028247,000204: 24,3626           01453        V06N43             VN       00643                                 
028248,000205: 24,3627           01442        V6N34              VN       00634                                 
028249,000206: 24,3630           00243 32703  K.01               2DEC     .01                                   
028250,000207: 

End of include-file GROUND_TRACKING_DETERMINATION_PROGRAM_-_P21.agc.  Parent file is MAIN.agc