Source Code

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

The reconstruction began with reconstructed source code for Luminary 97. Changes between revisions 96 and 97 were backed out, as described by anomal report LNY-59. transcribed from a digitized copy of that program. 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 96 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.

027605,000002:                                                                                                  ## Copyright:   Public domain.
027606,000003:                                                                                                  ## Filename:    GROUND_TRACKING_DETERMINATION_PROGRAM_-_P21.agc
027607,000004:                                                                                                  ## Purpose:     A section of Luminary revision 96.
027608,000005:                                                                                                  ##              It is part of the reconstructed source code for the
027609,000006:                                                                                                  ##              original release of the flight software for the Lunar 
027610,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 11.
027611,000008:                                                                                                  ##              The code has been recreated from a previously reconstructed
027612,000009:                                                                                                  ##              copy of Luminary 97 by undoing changes described in anomaly
027613,000010:                                                                                                  ##              report LNY-59. The code has been adapted such that the
027614,000011:                                                                                                  ##              resulting bugger words exactly match those specified for
027615,000012:                                                                                                  ##              Luminary 96 in NASA drawing 2021152D, which gives relatively
027616,000013:                                                                                                  ##              high confidence that the reconstruction is correct.
027617,000014:                                                                                                  ## Reference:   pp. 654-657
027618,000015:                                                                                                  ## Assembler:   yaYUL
027619,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
027620,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
027621,000018:                                                                                                  ## Mod history: 2019-08-04 MAS  Created from Luminary 97.
027622,000019: 

Page 654

027624,000021:                                                                                                  #  GROUND TRACKING DETERMINATION PROGRAM P21
027625,000022:                                                                                                  #  PROGRAM DESCRIPTION
027626,000023:                                                                                                  #        MOD NO - 1
027627,000024:                                                                                                  #        MOD BY - N. M. NEVILLE
027628,000025: 
027629,000026:                                                                                                  #  FUNCTIONAL DECRIPTION -
027630,000027:                                                                                                  #        TO PROVIDE THE ASTRONAUT DETAILS OF THE LM OR CSM GROUND TRACK WITHOUT
027631,000028:                                                                                                  #        THE NEED FOR GROUND COMMUNICATION (REQUESTED BY DSKY).
027632,000029: 
027633,000030:                                                                                                  #  CALLING SEQUENCE -
027634,000031:                                                                                                  #        ASTRONAUT REQUEST THROUGH DSKY V37E21E
027635,000032: 
027636,000033:                                                                                                  #  SUBROUTINES CALLED -
027637,000034:                                                                                                  #        GOPERF4
027638,000035:                                                                                                  #        GOFLASH
027639,000036:                                                                                                  #        THISPREC
027640,000037:                                                                                                  #        OTHPREC
027641,000038:                                                                                                  #        LAT-LONG
027642,000039: 
027643,000040:                                                                                                  #  NORMAL EXIT MODES -
027644,000041:                                                                                                  #        ASTRONAUT REQUEST TROUGH DSKY TO TERMINATE PROGRAM V34E
027645,000042: 
027646,000043:                                                                                                  #  ALARM OR ABORT EXIT MODES -
027647,000044:                                                                                                  #        NONE
027648,000045: 
027649,000046:                                                                                                  #  OUTPUT -
027650,000047:                                                                                                  #        OCTAL DISPLAY OF OPTION CODE AND VEHICLE WHOSE GROUND TRACK IS TO BE
027651,000048:                                                                                                  #        COMPUTED
027652,000049:                                                                                                  #                OPTION CODE     00002
027653,000050:                                                                                                  #                THIS            00001
027654,000051:                                                                                                  #                OTHER           00002
027655,000052:                                                                                                  #        DECIMAL DISPLAY OF TIME TO BE INTEGRATED TO HOURS, MINUTES, SECONDS
027656,000053:                                                                                                  #        DECIMAL DISPLAY OF LAT,LONG,ALT
027657,000054: 
027658,000055:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED
027659,000056:                                                                                                  #        AX0             2DEC    4.652459653 E-5 RADIANS         %68-69 CONSTANTS"
027660,000057:                                                                                                  #        -AY0            2DEC    2.147535898 E-5 RADIANS
027661,000058:                                                                                                  #        AZ0             2DEC    .7753206164     REVOLUTIONS
027662,000059:                                                                                                  #        FOR LUNAR ORBITS 504LM VECTOR IS NEEDED
027663,000060:                                                                                                  #        504LM           2DEC    -2.700340600 E-5 RADIANS
027664,000061:                                                                                                  #        504LM _2        2DEC    -7.514128400 E-4 RADIANS
027665,000062:                                                                                                  #        504LM _4        2DEC    _2.553198641 E-4 RADIANS
027666,000063: 
027667,000064:                                                                                                  #        NONE
027668,000065: 
027669,000066:                                                                                                  #  DEBRIS

Page 655

027671,000068:                                                                                                  #        CENTRALS - A,Q,L
027672,000069:                                                                                                  #        OTHER - THOSE USED BY THE ABOVE LISTED SUBROUTINES
027673,000070:                                                                                                  #        SEE LEMPREC, LAT-LONG
027674,000071: 
027675,000072: 35,2545  30,2000                                  SBANK=   LOWSUPER                              #  FOR LOW 2CADR'S.
027676,000073: 
027677,000074: 33,2200                                           BANK     33                                    
027678,000075: 24,2000                                           SETLOC   P20S                                  
027679,000076: 24,2000                                           BANK                                           
027680,000077: 
027681,000078: 24,3505  E7,1762                                  EBANK=   P21TIME                               
027682,000079: 24,3505                                           COUNT*   $$/P21                                
027683,000080: 24,3505           34753        PROG21             CAF      ONE                                   
027684,000081: 24,3506           55145                           TS       OPTION2                               #  ASSUMED VEHICLE IS LM, R2 = 00001
027685,000082: 24,3507           34752                           CAF      BIT2                                  #  OPTION 2
027686,000083: 24,3510           04616                           TC       BANKCALL                              
027687,000084: 24,3511           20633                           CADR     GOPERF4                               
027688,000085: 24,3512           06001                           TC       GOTOPOOH                              #  TERMINATE
027689,000086: 24,3513           03515                           TC       +2                                    #  PROCEED VALUE OF ASSUMED VEHICLE OK
027690,000087: 24,3514           03507                           TC       -5                                    #  R2 LOADED THROUGH DSKY
027691,000088: 24,3515           33665        P21PROG1           CAF      V6N34                                 #  LOAD DESIRED TIME OF LAT-LONG.
027692,000089: 24,3516           04616                           TC       BANKCALL                              
027693,000090: 24,3517           20476                           CADR     GOFLASH                               
027694,000091: 24,3520           06001                           TC       GOTOPOOH                              #  TERM
027695,000092: 24,3521           03523                           TC       +2                                    #  PROCEED VALUES OK
027696,000093: 24,3522           03515                           TC       -5                                    #  TIME LOADED THROUGH DSKY
027697,000094: 24,3523           06037                           TC       INTPRET                               
027698,000095: 24,3524           77745                           DLOAD                                          
027699,000096: 24,3525           01046                                    DSPTEM1                               
027700,000097: 24,3526           34041                           STCALL   TDEC1                                 #  INTEGRATE TO TIME SPECIFIED IN TDEC
027701,000098: 24,3527           27414                                    INTSTALL                              
027702,000099: 24,3530           43014                           BON      CLEAR                                 
027703,000100: 24,3531           00304                                    P21FLAG                               
027704,000101: 24,3532           51550                                    P21CONT                               #  ON --- RECYCLE USING BASE VECTOR
027705,000102: 24,3533           01674                                    VINTFLAG                              #  OFF -- 1ST PASS CALL BASE VECTOR
027706,000103: 24,3534           70535                           SLOAD    SR1                                   
027707,000104: 24,3535           01146                                    OPTION2                               
027708,000105: 24,3536           43030                           BHIZ     SET                                   
027709,000106: 24,3537           51541                                    +2                                    #  ZERO -- THIS VEHICLE (LM)
027710,000107: 24,3540           01474                                    VINTFLAG                              #  ONE -- OTHER VEHICLE (CM)
027711,000108: 24,3541           43014                           CLEAR    CLEAR                                 
027712,000109: 24,3542           01676                                    DIM0FLAG                              
027713,000110: 24,3543           01673                                    INTYPFLG                              #  PRECISION
027714,000111: 24,3544           77624                           CALL                                           
027715,000112: 24,3545           27134                                    INTEGRV                               #  CALCULATE
027716,000113: 24,3546           77650                           GOTO                                           #  -AND
027717,000114: 24,3547           51571                                    P21VSAVE                              #  -SAVE BASE VECTOR
027718,000115: 24,3550           77775        P21CONT            VLOAD                                          
027719,000116: 24,3551           03676                                    P21BASER                              #  RECYCLE -- INTEG FROM BASE VECTOR
027720,000117: 24,3552           25535                           STOVL    RCV                                   #  --POS

Page 656

027722,000119: 24,3553           03704                                    P21BASEV                              
027723,000120: 24,3554           15543                           STODL    VCV                                   #  --VEL
027724,000121: 24,3555           03763                                    P21TIME                               
027725,000122: 24,3556           01517                           STORE    TET                                   #  --TIME
027726,000123: 24,3557           43014                           CLEAR    CLEAR                                 
027727,000124: 24,3560           01676                                    DIM0FLAG                              
027728,000125: 24,3561           00263                                    MOONFLAG                              
027729,000126: 24,3562           53135                           SLOAD    BZE                                   
027730,000127: 24,3563           01164                                    P21ORIG                               
027731,000128: 24,3564           51567                                    +3                                    #  ZERO = EARTH
027732,000129: 24,3565           77614                           SET                                            #  ---2 = MOON
027733,000130: 24,3566           00063                                    MOONFLAG                              
027734,000131: 24,3567           77624                 +3        CALL                                           
027735,000132: 24,3570           27107                                    INTEGRVS                              
027736,000133: 24,3571           77745        P21VSAVE           DLOAD                                          #  SAVE CURRENT BASE VECTOR
027737,000134: 24,3572           00015                                    TAT                                   
027738,000135: 24,3573           27763                           STOVL    P21TIME                               #  --TIME
027739,000136: 24,3574           00017                                    RATT1                                 
027740,000137: 24,3575           27676                           STOVL    P21BASER                              #  --POS B-29 OR B-27
027741,000138: 24,3576           00025                                    VATT1                                 
027742,000139: 24,3577           03704                           STORE    P21BASEV                              #  --VEL B-07 OR B-05
027743,000140: 24,3600           53646                           ABVAL    SL*                                   
027744,000141: 24,3601           57576                                    0,2                                   
027745,000142: 24,3602           27712                           STOVL    P21VEL                                #  VEL/ FOR N91 DISP
027746,000143: 24,3603           00001                                    RATT                                  
027747,000144: 24,3604           50256                           UNIT     DOT                                   
027748,000145: 24,3605           00007                                    VATT                                  #  U(R).V
027749,000146: 24,3606           67471                           DDV      ASIN                                  #  U(R).U(V)
027750,000147: 24,3607           03712                                    P21VEL                                
027751,000148: 24,3610           03714                           STORE    P21GAM                                #  SIN-1 U(R).U(V) , -90 TO &90
027752,000149: 24,3611           67334                           SXA,2    SLOAD                                 
027753,000150: 24,3612           01163                                    P21ORIG                               #  0 = EARTH
027754,000151: 24,3613           01146                                    OPTION2                               
027755,000152: 24,3614           46142                           SR1      BHIZ                                  
027756,000153: 24,3615           51620                                    +3                                    
027757,000154: 24,3616           77650                           GOTO                                           
027758,000155: 24,3617           51623                                    +4                                    
027759,000156: 24,3620           77614                 +3        BON                                            
027760,000157: 24,3621           04307                                    SURFFLAG                              
027761,000158: 24,3622           51625                                    P21DSP                                
027762,000159: 24,3623           77614                 +4        SET                                            
027763,000160: 24,3624           00064                                    P21FLAG                               
027764,000161: 24,3625           67214        P21DSP             CLEAR    SLOAD                                 #  GENERATE DISPLAY DATA
027765,000162: 24,3626           01663                                    LUNAFLAG                              
027766,000163: 24,3627           00050                                    X2                                    
027767,000164: 24,3630           43054                           BZE      SET                                   
027768,000165: 24,3631           51633                                    +2                                    #  0 = EARTH
027769,000166: 24,3632           01463                                    LUNAFLAG                              
027770,000167: 24,3633           77775                           VLOAD                                          
027771,000168: 24,3634           00001                                    RATT                                  

Page 657

027773,000170: 24,3635           16032                           STODL    ALPHAV                                
027774,000171: 24,3636           00015                                    TAT                                   
027775,000172: 24,3637           45014                           CLEAR    CALL                                  
027776,000173: 24,3640           00662                                    ERADFLAG                              
027777,000174: 24,3641           26351                                    LAT-LONG                              
027778,000175: 24,3642           77605                           DMP                                            #  MPAC = ALT, METERS B-29
027779,000176: 24,3643           11667                                    K.01                                  
027780,000177: 24,3644           03716                           STORE    P21ALT                                #  ALT/100 FOR N91 DISP
027781,000178: 24,3645           77776                           EXIT                                           
027782,000179: 24,3646           33664                           CAF      V06N43                                #  DISPLAY LAT, LONG, ALT
027783,000180: 24,3647           04616                           TC       BANKCALL                              #  LAT, LONG = 1/2 REVS B0
027784,000181: 24,3650           20476                           CADR     GOFLASH                               #  ALT = KM B14
027785,000182: 24,3651           06001                           TC       GOTOPOOH                              #  TERM
027786,000183: 24,3652           06001                           TC       GOTOPOOH                              
027787,000184: 24,3653           06037                           TC       INTPRET                               #  V32E RECYCLE
027788,000185: 24,3654           43345                           DLOAD    DAD                                   
027789,000186: 24,3655           03763                                    P21TIME                               
027790,000187: 24,3656           11663                                    600SEC                                #  600 SECONDS OR 10 MIN
027791,000188: 24,3657           01046                           STORE    DSPTEM1                               
027792,000189: 24,3660           77634                           RTB                                            
027793,000190: 24,3661           51515                                    P21PROG1                              
027794,000191: 24,3662           00003 25140  600SEC             2DEC     60000      B-28                       #  10 MIN
027795,000192: 
027796,000193: 24,3664           01453        V06N43             VN       00643                                 
027797,000194: 24,3665           01442        V6N34              VN       00634                                 
027798,000195: 24,3666           00243 32703  K.01               2DEC     .01                                   
027799,000196: 

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