Source Code

These source-code files are part of a reconstructed copy of Luminary 97, the second release of the Apollo 11 Lunar Module (LM) Apollo Guidance Computer (AGC) software. It was created to fix two incorrect ephemeris constants in Luminary 96, as described by anomaly report LNY-59.

The reconstruction began with source code of Luminary 99 revision 1 previously transcribed from a digitized copy of that program. The code was then updated by undoing changes described in original Luminary memos 83 and 85, using asterisks indicating changed lines in the listing as a guide. The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152D. Note that page numbers in the reconstructed code match those on the Luminary 099 revision 001 printout, although the added code would likely have changed page numbers for a real Luminary 97 listing.

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.

027736,000002:                                                                                                  ## Copyright:   Public domain.
027737,000003:                                                                                                  ## Filename:    GROUND_TRACKING_DETERMINATION_PROGRAM_-_P21.agc
027738,000004:                                                                                                  ## Purpose:     A section of Luminary revision 97.
027739,000005:                                                                                                  ##              It is part of the reconstructed source code for the
027740,000006:                                                                                                  ##              second release of the flight software for the Lunar 
027741,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 11.
027742,000008:                                                                                                  ##              It was created to fix two incorrect ephemeris constants in
027743,000009:                                                                                                  ##              Luminary 96, as described by anomaly report LNY-59.
027744,000010:                                                                                                  ##              The code has been recreated from a copy of Luminary 99
027745,000011:                                                                                                  ##              revision 001, using asterisks indicating changed lines in
027746,000012:                                                                                                  ##              the listing and Luminary Memos #83 and #85, which list 
027747,000013:                                                                                                  ##              changes between Luminary 97 and 98, and 98 and 99. The
027748,000014:                                                                                                  ##              code has been adapted such that the resulting bugger words
027749,000015:                                                                                                  ##              exactly match those specified for Luminary 97 in NASA drawing
027750,000016:                                                                                                  ##              2021152D, which gives relatively high confidence that the
027751,000017:                                                                                                  ##              reconstruction is correct.
027752,000018:                                                                                                  ## Reference:   pp. 654-657
027753,000019:                                                                                                  ## Assembler:   yaYUL
027754,000020:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
027755,000021:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
027756,000022:                                                                                                  ## Mod history: 2019-07-28 MAS  Created from Luminary 99.
027757,000023: 

Page 654

027759,000025:                                                                                                  #  GROUND TRACKING DETERMINATION PROGRAM P21
027760,000026:                                                                                                  #  PROGRAM DESCRIPTION
027761,000027:                                                                                                  #        MOD NO - 1
027762,000028:                                                                                                  #        MOD BY - N. M. NEVILLE
027763,000029: 
027764,000030:                                                                                                  #  FUNCTIONAL DECRIPTION -
027765,000031:                                                                                                  #        TO PROVIDE THE ASTRONAUT DETAILS OF THE LM OR CSM GROUND TRACK WITHOUT
027766,000032:                                                                                                  #        THE NEED FOR GROUND COMMUNICATION (REQUESTED BY DSKY).
027767,000033: 
027768,000034:                                                                                                  #  CALLING SEQUENCE -
027769,000035:                                                                                                  #        ASTRONAUT REQUEST THROUGH DSKY V37E21E
027770,000036: 
027771,000037:                                                                                                  #  SUBROUTINES CALLED -
027772,000038:                                                                                                  #        GOPERF4
027773,000039:                                                                                                  #        GOFLASH
027774,000040:                                                                                                  #        THISPREC
027775,000041:                                                                                                  #        OTHPREC
027776,000042:                                                                                                  #        LAT-LONG
027777,000043: 
027778,000044:                                                                                                  #  NORMAL EXIT MODES -
027779,000045:                                                                                                  #        ASTRONAUT REQUEST TROUGH DSKY TO TERMINATE PROGRAM V34E
027780,000046: 
027781,000047:                                                                                                  #  ALARM OR ABORT EXIT MODES -
027782,000048:                                                                                                  #        NONE
027783,000049: 
027784,000050:                                                                                                  #  OUTPUT -
027785,000051:                                                                                                  #        OCTAL DISPLAY OF OPTION CODE AND VEHICLE WHOSE GROUND TRACK IS TO BE
027786,000052:                                                                                                  #        COMPUTED
027787,000053:                                                                                                  #                OPTION CODE     00002
027788,000054:                                                                                                  #                THIS            00001
027789,000055:                                                                                                  #                OTHER           00002
027790,000056:                                                                                                  #        DECIMAL DISPLAY OF TIME TO BE INTEGRATED TO HOURS, MINUTES, SECONDS
027791,000057:                                                                                                  #        DECIMAL DISPLAY OF LAT,LONG,ALT
027792,000058: 
027793,000059:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED
027794,000060:                                                                                                  #        AX0             2DEC    4.652459653 E-5 RADIANS         %68-69 CONSTANTS"
027795,000061:                                                                                                  #        -AY0            2DEC    2.147535898 E-5 RADIANS
027796,000062:                                                                                                  #        AZ0             2DEC    .7753206164     REVOLUTIONS
027797,000063:                                                                                                  #        FOR LUNAR ORBITS 504LM VECTOR IS NEEDED
027798,000064:                                                                                                  #        504LM           2DEC    -2.700340600 E-5 RADIANS
027799,000065:                                                                                                  #        504LM _2        2DEC    -7.514128400 E-4 RADIANS
027800,000066:                                                                                                  #        504LM _4        2DEC    _2.553198641 E-4 RADIANS
027801,000067: 
027802,000068:                                                                                                  #        NONE
027803,000069: 
027804,000070:                                                                                                  #  DEBRIS

Page 655

027806,000072:                                                                                                  #        CENTRALS - A,Q,L
027807,000073:                                                                                                  #        OTHER - THOSE USED BY THE ABOVE LISTED SUBROUTINES
027808,000074:                                                                                                  #        SEE LEMPREC, LAT-LONG
027809,000075: 
027810,000076: 35,2545  30,2000                                  SBANK=   LOWSUPER                              #  FOR LOW 2CADR'S.
027811,000077: 
027812,000078: 33,2200                                           BANK     33                                    
027813,000079: 24,2000                                           SETLOC   P20S                                  
027814,000080: 24,2000                                           BANK                                           
027815,000081: 
027816,000082: 24,3505  E7,1762                                  EBANK=   P21TIME                               
027817,000083: 24,3505                                           COUNT*   $$/P21                                
027818,000084: 24,3505           34753        PROG21             CAF      ONE                                   
027819,000085: 24,3506           55145                           TS       OPTION2                               #  ASSUMED VEHICLE IS LM, R2 = 00001
027820,000086: 24,3507           34752                           CAF      BIT2                                  #  OPTION 2
027821,000087: 24,3510           04616                           TC       BANKCALL                              
027822,000088: 24,3511           20633                           CADR     GOPERF4                               
027823,000089: 24,3512           06001                           TC       GOTOPOOH                              #  TERMINATE
027824,000090: 24,3513           03515                           TC       +2                                    #  PROCEED VALUE OF ASSUMED VEHICLE OK
027825,000091: 24,3514           03507                           TC       -5                                    #  R2 LOADED THROUGH DSKY
027826,000092: 24,3515           33665        P21PROG1           CAF      V6N34                                 #  LOAD DESIRED TIME OF LAT-LONG.
027827,000093: 24,3516           04616                           TC       BANKCALL                              
027828,000094: 24,3517           20476                           CADR     GOFLASH                               
027829,000095: 24,3520           06001                           TC       GOTOPOOH                              #  TERM
027830,000096: 24,3521           03523                           TC       +2                                    #  PROCEED VALUES OK
027831,000097: 24,3522           03515                           TC       -5                                    #  TIME LOADED THROUGH DSKY
027832,000098: 24,3523           06037                           TC       INTPRET                               
027833,000099: 24,3524           77745                           DLOAD                                          
027834,000100: 24,3525           01046                                    DSPTEM1                               
027835,000101: 24,3526           34041                           STCALL   TDEC1                                 #  INTEGRATE TO TIME SPECIFIED IN TDEC
027836,000102: 24,3527           27414                                    INTSTALL                              
027837,000103: 24,3530           43014                           BON      CLEAR                                 
027838,000104: 24,3531           00304                                    P21FLAG                               
027839,000105: 24,3532           51550                                    P21CONT                               #  ON --- RECYCLE USING BASE VECTOR
027840,000106: 24,3533           01674                                    VINTFLAG                              #  OFF -- 1ST PASS CALL BASE VECTOR
027841,000107: 24,3534           70535                           SLOAD    SR1                                   
027842,000108: 24,3535           01146                                    OPTION2                               
027843,000109: 24,3536           43030                           BHIZ     SET                                   
027844,000110: 24,3537           51541                                    +2                                    #  ZERO -- THIS VEHICLE (LM)
027845,000111: 24,3540           01474                                    VINTFLAG                              #  ONE -- OTHER VEHICLE (CM)
027846,000112: 24,3541           43014                           CLEAR    CLEAR                                 
027847,000113: 24,3542           01676                                    DIM0FLAG                              
027848,000114: 24,3543           01673                                    INTYPFLG                              #  PRECISION
027849,000115: 24,3544           77624                           CALL                                           
027850,000116: 24,3545           27134                                    INTEGRV                               #  CALCULATE
027851,000117: 24,3546           77650                           GOTO                                           #  -AND
027852,000118: 24,3547           51571                                    P21VSAVE                              #  -SAVE BASE VECTOR
027853,000119: 24,3550           77775        P21CONT            VLOAD                                          
027854,000120: 24,3551           03676                                    P21BASER                              #  RECYCLE -- INTEG FROM BASE VECTOR
027855,000121: 24,3552           25535                           STOVL    RCV                                   #  --POS

Page 656

027857,000123: 24,3553           03704                                    P21BASEV                              
027858,000124: 24,3554           15543                           STODL    VCV                                   #  --VEL
027859,000125: 24,3555           03763                                    P21TIME                               
027860,000126: 24,3556           01517                           STORE    TET                                   #  --TIME
027861,000127: 24,3557           43014                           CLEAR    CLEAR                                 
027862,000128: 24,3560           01676                                    DIM0FLAG                              
027863,000129: 24,3561           00263                                    MOONFLAG                              
027864,000130: 24,3562           53135                           SLOAD    BZE                                   
027865,000131: 24,3563           01164                                    P21ORIG                               
027866,000132: 24,3564           51567                                    +3                                    #  ZERO = EARTH
027867,000133: 24,3565           77614                           SET                                            #  ---2 = MOON
027868,000134: 24,3566           00063                                    MOONFLAG                              
027869,000135: 24,3567           77624                 +3        CALL                                           
027870,000136: 24,3570           27107                                    INTEGRVS                              
027871,000137: 24,3571           77745        P21VSAVE           DLOAD                                          #  SAVE CURRENT BASE VECTOR
027872,000138: 24,3572           00015                                    TAT                                   
027873,000139: 24,3573           27763                           STOVL    P21TIME                               #  --TIME
027874,000140: 24,3574           00017                                    RATT1                                 
027875,000141: 24,3575           27676                           STOVL    P21BASER                              #  --POS B-29 OR B-27
027876,000142: 24,3576           00025                                    VATT1                                 
027877,000143: 24,3577           03704                           STORE    P21BASEV                              #  --VEL B-07 OR B-05
027878,000144: 24,3600           53646                           ABVAL    SL*                                   
027879,000145: 24,3601           57576                                    0,2                                   
027880,000146: 24,3602           27712                           STOVL    P21VEL                                #  VEL/ FOR N91 DISP
027881,000147: 24,3603           00001                                    RATT                                  
027882,000148: 24,3604           50256                           UNIT     DOT                                   
027883,000149: 24,3605           00007                                    VATT                                  #  U(R).V
027884,000150: 24,3606           67471                           DDV      ASIN                                  #  U(R).U(V)
027885,000151: 24,3607           03712                                    P21VEL                                
027886,000152: 24,3610           03714                           STORE    P21GAM                                #  SIN-1 U(R).U(V) , -90 TO &90
027887,000153: 24,3611           67334                           SXA,2    SLOAD                                 
027888,000154: 24,3612           01163                                    P21ORIG                               #  0 = EARTH
027889,000155: 24,3613           01146                                    OPTION2                               
027890,000156: 24,3614           46142                           SR1      BHIZ                                  
027891,000157: 24,3615           51620                                    +3                                    
027892,000158: 24,3616           77650                           GOTO                                           
027893,000159: 24,3617           51623                                    +4                                    
027894,000160: 24,3620           77614                 +3        BON                                            
027895,000161: 24,3621           04307                                    SURFFLAG                              
027896,000162: 24,3622           51625                                    P21DSP                                
027897,000163: 24,3623           77614                 +4        SET                                            
027898,000164: 24,3624           00064                                    P21FLAG                               
027899,000165: 24,3625           67214        P21DSP             CLEAR    SLOAD                                 #  GENERATE DISPLAY DATA
027900,000166: 24,3626           01663                                    LUNAFLAG                              
027901,000167: 24,3627           00050                                    X2                                    
027902,000168: 24,3630           43054                           BZE      SET                                   
027903,000169: 24,3631           51633                                    +2                                    #  0 = EARTH
027904,000170: 24,3632           01463                                    LUNAFLAG                              
027905,000171: 24,3633           77775                           VLOAD                                          
027906,000172: 24,3634           00001                                    RATT                                  

Page 657

027908,000174: 24,3635           16032                           STODL    ALPHAV                                
027909,000175: 24,3636           00015                                    TAT                                   
027910,000176: 24,3637           45014                           CLEAR    CALL                                  
027911,000177: 24,3640           00662                                    ERADFLAG                              
027912,000178: 24,3641           26351                                    LAT-LONG                              
027913,000179: 24,3642           77605                           DMP                                            #  MPAC = ALT, METERS B-29
027914,000180: 24,3643           11667                                    K.01                                  
027915,000181: 24,3644           03716                           STORE    P21ALT                                #  ALT/100 FOR N91 DISP
027916,000182: 24,3645           77776                           EXIT                                           
027917,000183: 24,3646           33664                           CAF      V06N43                                #  DISPLAY LAT, LONG, ALT
027918,000184: 24,3647           04616                           TC       BANKCALL                              #  LAT, LONG = 1/2 REVS B0
027919,000185: 24,3650           20476                           CADR     GOFLASH                               #  ALT = KM B14
027920,000186: 24,3651           06001                           TC       GOTOPOOH                              #  TERM
027921,000187: 24,3652           06001                           TC       GOTOPOOH                              
027922,000188: 24,3653           06037                           TC       INTPRET                               #  V32E RECYCLE
027923,000189: 24,3654           43345                           DLOAD    DAD                                   
027924,000190: 24,3655           03763                                    P21TIME                               
027925,000191: 24,3656           11663                                    600SEC                                #  600 SECONDS OR 10 MIN
027926,000192: 24,3657           01046                           STORE    DSPTEM1                               
027927,000193: 24,3660           77634                           RTB                                            
027928,000194: 24,3661           51515                                    P21PROG1                              
027929,000195: 24,3662           00003 25140  600SEC             2DEC     60000      B-28                       #  10 MIN
027930,000196: 
027931,000197: 24,3664           01453        V06N43             VN       00643                                 
027932,000198: 24,3665           01442        V6N34              VN       00634                                 
027933,000199: 24,3666           00243 32703  K.01               2DEC     .01                                   
027934,000200: 

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