Source Code

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

The reconstruction began with source code of Zerlina 56, Luminary 210, and Luminary 131, previously transcribed from digitized copies of those programs. The code was created by combining the three, using Zerlina 56 as a base, since it was based off of Luminary 183. The differences between the three were carefully merged using the Luminary memos as a guide, with all changes made after Luminary 178 being backed out. 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 178 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.

028106,000002:                                                                                                  ## Copyright:   Public domain.
028107,000003:                                                                                                  ## Filename:    GROUND_TRACKING_DETERMINATION_PROGRAM_-_P21.agc
028108,000004:                                                                                                  ## Purpose:     A section of Luminary revision 178.
028109,000005:                                                                                                  ##              It is part of the reconstructed source code for the final
028110,000006:                                                                                                  ##              release of the flight software for the Lunar Module's
028111,000007:                                                                                                  ##              (LM) Apollo Guidance Computer (AGC) for Apollo 14. The
028112,000008:                                                                                                  ##              code has been recreated from copies of Zerlina 56, Luminary
028113,000009:                                                                                                  ##              210, and Luminary 131, as well as many Luminary memos.
028114,000010:                                                                                                  ##              It has been adapted such that the resulting bugger words
028115,000011:                                                                                                  ##              exactly match those specified for Luminary 178 in NASA
028116,000012:                                                                                                  ##              drawing 2021152N, which gives relatively high confidence
028117,000013:                                                                                                  ##              that the reconstruction is correct.
028118,000014:                                                                                                  ## Reference:   pp. 649-652
028119,000015:                                                                                                  ## Assembler:   yaYUL
028120,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
028121,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
028122,000018:                                                                                                  ## Mod history: 2019-08-14 MAS  Created from Zerlina 56.
028123,000019: 

Page 649

028125,000021:                                                                                                  #  GROUND TRACKING DETERMINATION PROGRAM P21
028126,000022:                                                                                                  #  PROGRAM DESCRIPTION
028127,000023:                                                                                                  #  MOD NO - 1
028128,000024:                                                                                                  #  MOD BY - N.M.NEVILLE
028129,000025:                                                                                                  #  FUNCTIONAL DECRIPTION-
028130,000026: 
028131,000027:                                                                                                  #  TO PROVIDE THE ASTRONAUT DETAILS OF THE LM OR CSM GROUND TRACK WITHOUT
028132,000028:                                                                                                  #  THE NEED FOR GROUND COMMUNICATION (REQUESTED BY DSKY).
028133,000029:                                                                                                  #  CALLING SEQUENCE -
028134,000030: 
028135,000031:                                                                                                  #  ASTRONAUT REQUEST THROUGH DSKY V37E21E
028136,000032:                                                                                                  #  SUBROUTINES CALLED-
028137,000033: 
028138,000034:                                                                                                  #  GOPERF4
028139,000035:                                                                                                  #  GOFLASH
028140,000036:                                                                                                  #  THISPREC
028141,000037:                                                                                                  #  OTHPREC
028142,000038:                                                                                                  #  LAT-LONG
028143,000039:                                                                                                  #  NORMAL EXIT MODES-
028144,000040: 
028145,000041:                                                                                                  #  ASTRONAUT REQUEST TROUGH DSKY TO TERMINATE PROGRAM V34E
028146,000042:                                                                                                  #  ALARM OR ABORT EXIT MODES-
028147,000043: 
028148,000044:                                                                                                  #  NONE
028149,000045:                                                                                                  #  OUTPUT -
028150,000046: 
028151,000047:                                                                                                  #  OCTAL DISPLAY OF OPTION CODE AND VEHICLE WHOSE GROUND TRACK IS TO BE
028152,000048:                                                                                                  #  COMPUTED
028153,000049:                                                                                                  #           OPTION CODE  00002
028154,000050:                                                                                                  #           THIS         00001
028155,000051:                                                                                                  #           OTHER        00002
028156,000052:                                                                                                  #  DECIMAL DISPLAY OF TIME TO BE INTEGRATED TO HOURS , MINUTES , SECONDS
028157,000053:                                                                                                  #  DECIMAL DISPLAY OF LAT,LONG,ALT
028158,000054:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED
028159,000055: 
028160,000056:                                                                                                  #  AX0      2DEC   4.652459653 E-5   RADIANS       %68-69 CONSTANTS"
028161,000057: 
028162,000058:                                                                                                  #  -AY0     2DEC   2.147535898 E-5   RADIANS
028163,000059: 
028164,000060:                                                                                                  #  AZ0      2DEC   .7753206164       REVOLUTIONS
028165,000061:                                                                                                  #  FOR LUNAR ORBITS 504LM VECTOR IS NEEDED
028166,000062: 
028167,000063:                                                                                                  #  504LM    2DEC   -2.700340600 E-5  RADIANS
028168,000064: 
028169,000065:                                                                                                  #  504LM _2 2DEC   -7.514128400 E-4  RADIANS     
028170,000066: 
028171,000067:                                                                                                  #  504LM _4 2DEC   _2.553198641 E-4  RADIANS     
028172,000068: 
028173,000069:                                                                                                  #  NONE
028174,000070:                                                                                                  #  DEBRIS

Page 650

028176,000072: 
028177,000073:                                                                                                  #  CENTRALS-A,Q,L
028178,000074:                                                                                                  #  OTHER-THOSE USED BY THE ABOVE LISTED SUBROUTINES
028179,000075:                                                                                                  #  SEE LEMPREC,LAT-LONG
028180,000076: 35,2455  30,2000                                  SBANK=   LOWSUPER                              #  FOR LOW 2CADR'S.
028181,000077: 
028182,000078: 33,2113                                           BANK     33                                    
028183,000079: 24,2000                                           SETLOC   P20S                                  
028184,000080: 24,2000                                           BANK                                           
028185,000081: 
028186,000082: 24,3440  E7,1762                                  EBANK=   P21TIME                               
028187,000083: 24,3440                                           COUNT*   $$/P21                                
028188,000084: 24,3440           34753        PROG21             CAF      ONE                                   
028189,000085: 24,3441           55144                           TS       OPTION2                               #  ASSUMED VEHICLE IS LM , R2 = 00001
028190,000086: 24,3442           34752                           CAF      BIT2                                  #   OPTION 2
028191,000087: 24,3443           04616                           TC       BANKCALL                              
028192,000088: 24,3444           20634                           CADR     GOPERF4                               
028193,000089: 24,3445           06001                           TC       GOTOPOOH                              #  TERMINATE
028194,000090: 24,3446           03450                           TC       +2                                    #  PROCEED VALUE OF ASSUMED VEHICLE OK
028195,000091: 24,3447           03442                           TC       -5                                    #  R2 LOADED THROUGH DSKY
028196,000092: 24,3450           34755                           CAF      ZERO                                  #  INITIAL TIME = PRESENT TIME
028197,000093: 24,3451           55044                           TS       DSPTEM1                               
028198,000094: 24,3452           55045                           TS       DSPTEM1    +1                         
028199,000095: 24,3453           33627        P21PROG1           CAF      V6N34                                 #  LOAD DESIRED TIME OF LAT-LONG.
028200,000096: 24,3454           04616                           TC       BANKCALL                              
028201,000097: 24,3455           20477                           CADR     GOFLASH                               
028202,000098: 24,3456           06001                           TC       GOTOPOOH                              #  TERM
028203,000099: 24,3457           03461                           TC       +2                                    #  PROCEED VALUES OK
028204,000100: 24,3460           03453                           TC       -5                                    #  TIME LOADED THROUGH DSKY
028205,000101: 24,3461           06042                           TC       INTPRET                               
028206,000102: 24,3462           53145                           DLOAD    BZE                                   
028207,000103: 24,3463           01045                                    DSPTEM1                               
028208,000104: 24,3464           51621                                    P21PRTM                               
028209,000105: 24,3465           34041        P21PROG2           STCALL   TDEC1                                 #  INTEG TO TIME SPECIFIED IN TDEC1
028210,000106: 24,3466           27410                                    INTSTALL                              
028211,000107: 24,3467           43014                           BON      CLEAR                                 
028212,000108: 24,3470           00304                                    P21FLAG                               
028213,000109: 24,3471           51507                                    P21CONT                               #  ON---RECYCLE USING BASE VECTOR
028214,000110: 24,3472           01674                                    VINTFLAG                              #  OFF--1ST PASS CALL BASE VECTOR
028215,000111: 24,3473           70535                           SLOAD    SR1                                   
028216,000112: 24,3474           01145                                    OPTION2                               
028217,000113: 24,3475           43030                           BHIZ     SET                                   
028218,000114: 24,3476           51500                                    +2                                    #  ZERO--THIS VEHICLE(LM)
028219,000115: 24,3477           01474                                    VINTFLAG                              #  ONE--OTHER VEHICLE(CM)
028220,000116: 24,3500           43014                           CLEAR    CLEAR                                 
028221,000117: 24,3501           01676                                    DIM0FLAG                              
028222,000118: 24,3502           01673                                    INTYPFLG                              #  PRECISION
028223,000119: 24,3503           77624                           CALL                                           
028224,000120: 24,3504           27133                                    INTEGRV                               #  CALCULATE
028225,000121: 24,3505           77650                           GOTO                                           #  -AND

Page 651

028227,000123: 24,3506           51530                                    P21VSAVE                              #  -SAVE BASE VECTOR
028228,000124: 24,3507           77775        P21CONT            VLOAD                                          
028229,000125: 24,3510           03676                                    P21BASER                              #  RECYCLE--INTEG FROM BASE VECTOR
028230,000126: 24,3511           25535                           STOVL    RCV                                   #  --POS
028231,000127: 24,3512           03704                                    P21BASEV                              
028232,000128: 24,3513           15543                           STODL    VCV                                   #  --VEL
028233,000129: 24,3514           03763                                    P21TIME                               
028234,000130: 24,3515           01517                           STORE    TET                                   #  --TIME
028235,000131: 24,3516           43014                           CLEAR    CLEAR                                 
028236,000132: 24,3517           01676                                    DIM0FLAG                              
028237,000133: 24,3520           00263                                    MOONFLAG                              
028238,000134: 24,3521           53135                           SLOAD    BZE                                   
028239,000135: 24,3522           01163                                    P21ORIG                               
028240,000136: 24,3523           51526                                    +3                                    #  ZERO=EARTH
028241,000137: 24,3524           77614                           SET                                            #  ---2=MOON
028242,000138: 24,3525           00063                                    MOONFLAG                              
028243,000139: 24,3526           77624                 +3        CALL                                           
028244,000140: 24,3527           27106                                    INTEGRVS                              
028245,000141: 24,3530           77745        P21VSAVE           DLOAD                                          #  SAVE CURRENT BASE VECTOR
028246,000142: 24,3531           00015                                    TAT                                   
028247,000143: 24,3532           27763                           STOVL    P21TIME                               #  --TIME
028248,000144: 24,3533           00017                                    RATT1                                 
028249,000145: 24,3534           27676                           STOVL    P21BASER                              #  --POS B-29 OR B-27
028250,000146: 24,3535           00025                                    VATT1                                 
028251,000147: 24,3536           03704                           STORE    P21BASEV                              #  --VEL B-07 OR B-05
028252,000148: 24,3537           53646                           ABVAL    SL*                                   
028253,000149: 24,3540           57576                                    0,2                                   
028254,000150: 24,3541           27712                           STOVL    P21VEL                                #  VEL/ FOR N91 DISP
028255,000151: 24,3542           00001                                    RATT                                  
028256,000152: 24,3543           50256                           UNIT     DOT                                   
028257,000153: 24,3544           00007                                    VATT                                  #   U(R).V
028258,000154: 24,3545           67471                           DDV      ASIN                                  #  U(R).U(V)
028259,000155: 24,3546           03712                                    P21VEL                                
028260,000156: 24,3547           03714                           STORE    P21GAM                                #  SIN-1 U(R).U(V) , -90 TO &90
028261,000157: 24,3550           67334                           SXA,2    SLOAD                                 
028262,000158: 24,3551           01162                                    P21ORIG                               #  0=EARTH
028263,000159: 24,3552           01145                                    OPTION2                               
028264,000160: 24,3553           46142                           SR1      BHIZ                                  
028265,000161: 24,3554           51557                                    +3                                    
028266,000162: 24,3555           77650                           GOTO                                           
028267,000163: 24,3556           51562                                    +4                                    
028268,000164: 24,3557           77614                 +3        BON                                            
028269,000165: 24,3560           04307                                    SURFFLAG                              
028270,000166: 24,3561           51564                                    P21DSP                                
028271,000167: 24,3562           77614                 +4        SET                                            
028272,000168: 24,3563           00064                                    P21FLAG                               
028273,000169: 24,3564           67214        P21DSP             CLEAR    SLOAD                                 #  GENERATE DISPLAY DATA
028274,000170: 24,3565           01663                                    LUNAFLAG                              
028275,000171: 24,3566           00050                                    X2                                    

Page 652

028277,000173: 24,3567           43054                           BZE      SET                                   
028278,000174: 24,3570           51572                                    +2                                    #  0=EARTH
028279,000175: 24,3571           01463                                    LUNAFLAG                              
028280,000176: 24,3572           77775                           VLOAD                                          
028281,000177: 24,3573           00001                                    RATT                                  
028282,000178: 24,3574           16032                           STODL    ALPHAV                                
028283,000179: 24,3575           00015                                    TAT                                   
028284,000180: 24,3576           45014                           CLEAR    CALL                                  
028285,000181: 24,3577           00662                                    ERADFLAG                              
028286,000182: 24,3600           26347                                    LAT-LONG                              
028287,000183: 24,3601           77605                           DMP                                            #  MPAC = ALT,METERS B-29
028288,000184: 24,3602           11631                                    K.01                                  
028289,000185: 24,3603           03716                           STORE    P21ALT                                #  ALT/100 FOR N91 DISP
028290,000186: 24,3604           77776                           EXIT                                           
028291,000187: 24,3605           33626                           CAF      V06N43                                #  DISPLAY LAT,LONG,ALT
028292,000188: 24,3606           04616                           TC       BANKCALL                              #  LAT,LONG = 1/2 REVS B0
028293,000189: 24,3607           20477                           CADR     GOFLASH                               #  ALT = KM  B14
028294,000190: 24,3610           06001                           TC       GOTOPOOH                              #  TERM
028295,000191: 24,3611           06001                           TC       GOTOPOOH                              
028296,000192: 24,3612           06042                           TC       INTPRET                               #  V32E RECYCLE
028297,000193: 24,3613           43345                           DLOAD    DAD                                   
028298,000194: 24,3614           03763                                    P21TIME                               
028299,000195: 24,3615           11625                                    600SEC                                #  600 SECONDS OR 10 MIN
028300,000196: 24,3616           01045                           STORE    DSPTEM1                               
028301,000197: 24,3617           77634                           RTB                                            
028302,000198: 24,3620           51453                                    P21PROG1                              
028303,000199: 24,3621           52034        P21PRTM            RTB      GOTO                                  
028304,000200: 24,3622           21574                                    LOADTIME                              
028305,000201: 24,3623           51465                                    P21PROG2                              
028306,000202: 24,3624           00003 25140  600SEC             2DEC     60000      B-28                       #  10 MIN
028307,000203: 
028308,000204: 24,3626           01453        V06N43             VN       00643                                 
028309,000205: 24,3627           01442        V6N34              VN       00634                                 
028310,000206: 24,3630           00243 32703  K.01               2DEC     .01                                   
028311,000207: 

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