Source Code

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

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

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

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

Page 649

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

Page 650

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

Page 651

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

Page 652

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

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