Source Code

These source-code files were from the printout at the MIT Museum, with many thanks to Deborah Douglas, the Museum's Curator of Science and Technology, for releasing it to us. The printout was digitally photographed by Paul Fjeld. A team of volunteers transcribed the source code manually from these images or, where appropriate, modified already-transcribed but similar source Luminary 131 (Apollo 13) source code to agree with the images from the printout. Note that the page images presented online are of reduced quality, and that higher-quality images are available. Report any conversion errors or legibility problems in page images to info@sandroid.org. Notations on the program listing read, in part:

	GAP:  ASSEMBLE REVISION 001 OF AGC PROGRAM LMY99 BY NASA 2021112-061
	20'35 OCT. 28,1968
Note that the date is the date of the printout, not the date of the program revision.

028171,000002:                                                                                                  ## Copyright:   Public domain.
028172,000003:                                                                                                  ## Filename:    GROUND_TRACKING_DETERMINATION_PROGRAM.agc
028173,000004:                                                                                                  ## Purpose:     Part of the source code for Luminary 1A build 099.
028174,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
028175,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for Apollo 11.
028176,000007:                                                                                                  ## Assembler:   yaYUL
028177,000008:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
028178,000009:                                                                                                  ## Website:     www.ibiblio.org/apollo.
028179,000010:                                                                                                  ## Pages:       654-657
028180,000011:                                                                                                  ## Mod history: 2009-05-18 RSB  Adapted from the corresponding 
028181,000012:                                                                                                  ##                              Luminary131 file, using page 
028182,000013:                                                                                                  ##                              images from Luminary 1A.
028183,000014:                                                                                                  ##              2016-12-13 RSB  GOTOP00H -> GOTOPOOH
028184,000015:                                                                                                  ##              2016-12-14 RSB  Proofed text comments with octopus/ProoferComments
028185,000016:                                                                                                  ##                              but no errors found.
028186,000017:                                                                                                  ##              2017-03-15 RSB  Comment-text fixes identified in 5-way
028187,000018:                                                                                                  ##                              side-by-side diff of Luminary 69/99/116/131/210.
028188,000019: 
028189,000020:                                                                                                  ## This source code has been transcribed or otherwise adapted from
028190,000021:                                                                                                  ## digitized images of a hardcopy from the MIT Museum.  The digitization
028191,000022:                                                                                                  ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
028192,000023:                                                                                                  ## the Museum.  Many thanks to both.  The images (with suitable reduction
028193,000024:                                                                                                  ## in storage size and consequent reduction in image quality as well) are
028194,000025:                                                                                                  ## available online at www.ibiblio.org/apollo.  If for some reason you
028195,000026:                                                                                                  ## find that the images are illegible, contact me at info@sandroid.org
028196,000027:                                                                                                  ## about getting access to the (much) higher-quality images which Paul
028197,000028:                                                                                                  ## actually created.
028198,000029:                                                                                                  ##
028199,000030:                                                                                                  ## Notations on the hardcopy document read, in part:
028200,000031:                                                                                                  ##
028201,000032:                                                                                                  ##      Assemble revision 001 of AGC program LMY99 by NASA 2021112-61
028202,000033:                                                                                                  ##      16:27 JULY 14, 1969 
028203,000034: 

Page 654

028205,000036:                                                                                                  #  GROUND TRACKING DETERMINATION PROGRAM P21
028206,000037:                                                                                                  #  PROGRAM DESCRIPTION
028207,000038:                                                                                                  #        MOD NO - 1
028208,000039:                                                                                                  #        MOD BY - N. M. NEVILLE
028209,000040: 
028210,000041:                                                                                                  #  FUNCTIONAL DECRIPTION -
028211,000042:                                                                                                  #        TO PROVIDE THE ASTRONAUT DETAILS OF THE LM OR CSM GROUND TRACK WITHOUT
028212,000043:                                                                                                  #        THE NEED FOR GROUND COMMUNICATION (REQUESTED BY DSKY).
028213,000044: 
028214,000045:                                                                                                  #  CALLING SEQUENCE -
028215,000046:                                                                                                  #        ASTRONAUT REQUEST THROUGH DSKY V37E21E
028216,000047: 
028217,000048:                                                                                                  #  SUBROUTINES CALLED -
028218,000049:                                                                                                  #        GOPERF4
028219,000050:                                                                                                  #        GOFLASH
028220,000051:                                                                                                  #        THISPREC
028221,000052:                                                                                                  #        OTHPREC
028222,000053:                                                                                                  #        LAT-LONG
028223,000054: 
028224,000055:                                                                                                  #  NORMAL EXIT MODES -
028225,000056:                                                                                                  #        ASTRONAUT REQUEST TROUGH DSKY TO TERMINATE PROGRAM V34E
028226,000057: 
028227,000058:                                                                                                  #  ALARM OR ABORT EXIT MODES -
028228,000059:                                                                                                  #        NONE
028229,000060: 
028230,000061:                                                                                                  #  OUTPUT -
028231,000062:                                                                                                  #        OCTAL DISPLAY OF OPTION CODE AND VEHICLE WHOSE GROUND TRACK IS TO BE
028232,000063:                                                                                                  #        COMPUTED
028233,000064:                                                                                                  #                OPTION CODE     00002
028234,000065:                                                                                                  #                THIS            00001
028235,000066:                                                                                                  #                OTHER           00002
028236,000067:                                                                                                  #        DECIMAL DISPLAY OF TIME TO BE INTEGRATED TO HOURS, MINUTES, SECONDS
028237,000068:                                                                                                  #        DECIMAL DISPLAY OF LAT,LONG,ALT
028238,000069: 
028239,000070:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED
028240,000071:                                                                                                  #        AX0             2DEC    4.652459653 E-5 RADIANS         %68-69 CONSTANTS"
028241,000072:                                                                                                  #        -AY0            2DEC    2.147535898 E-5 RADIANS
028242,000073:                                                                                                  #        AZ0             2DEC    .7753206164     REVOLUTIONS
028243,000074:                                                                                                  #        FOR LUNAR ORBITS 504LM VECTOR IS NEEDED
028244,000075:                                                                                                  #        504LM           2DEC    -2.700340600 E-5 RADIANS
028245,000076:                                                                                                  #        504LM _2        2DEC    -7.514128400 E-4 RADIANS
028246,000077:                                                                                                  #        504LM _4        2DEC    _2.553198641 E-4 RADIANS
028247,000078: 
028248,000079:                                                                                                  #        NONE
028249,000080: 
028250,000081:                                                                                                  #  DEBRIS

Page 655

028252,000083:                                                                                                  #        CENTRALS - A,Q,L
028253,000084:                                                                                                  #        OTHER - THOSE USED BY THE ABOVE LISTED SUBROUTINES
028254,000085:                                                                                                  #        SEE LEMPREC, LAT-LONG
028255,000086: 
028256,000087: 35,2545  30,2000                                  SBANK=   LOWSUPER                              #  FOR LOW 2CADR'S.
028257,000088: 
028258,000089: 33,2200                                           BANK     33                                    
028259,000090: 24,2000                                           SETLOC   P20S                                  
028260,000091: 24,2000                                           BANK                                           
028261,000092: 
028262,000093: 24,3505  E7,1762                                  EBANK=   P21TIME                               
028263,000094: 24,3505                                           COUNT*   $$/P21                                
028264,000095: 24,3505           34753        PROG21             CAF      ONE                                   
028265,000096: 24,3506           55145                           TS       OPTION2                               #  ASSUMED VEHICLE IS LM, R2 = 00001
028266,000097: 24,3507           34752                           CAF      BIT2                                  #  OPTION 2
028267,000098: 24,3510           04616                           TC       BANKCALL                              
028268,000099: 24,3511           20633                           CADR     GOPERF4                               
028269,000100: 24,3512           06001                           TC       GOTOPOOH                              #  TERMINATE
028270,000101: 24,3513           03515                           TC       +2                                    #  PROCEED VALUE OF ASSUMED VEHICLE OK
028271,000102: 24,3514           03507                           TC       -5                                    #  R2 LOADED THROUGH DSKY
028272,000103: 24,3515           33665        P21PROG1           CAF      V6N34                                 #  LOAD DESIRED TIME OF LAT-LONG.
028273,000104: 24,3516           04616                           TC       BANKCALL                              
028274,000105: 24,3517           20476                           CADR     GOFLASH                               
028275,000106: 24,3520           06001                           TC       GOTOPOOH                              #  TERM
028276,000107: 24,3521           03523                           TC       +2                                    #  PROCEED VALUES OK
028277,000108: 24,3522           03515                           TC       -5                                    #  TIME LOADED THROUGH DSKY
028278,000109: 24,3523           06037                           TC       INTPRET                               
028279,000110: 24,3524           77745                           DLOAD                                          
028280,000111: 24,3525           01046                                    DSPTEM1                               
028281,000112: 24,3526           34041                           STCALL   TDEC1                                 #  INTEGRATE TO TIME SPECIFIED IN TDEC
028282,000113: 24,3527           27414                                    INTSTALL                              
028283,000114: 24,3530           43014                           BON      CLEAR                                 
028284,000115: 24,3531           00304                                    P21FLAG                               
028285,000116: 24,3532           51550                                    P21CONT                               #  ON --- RECYCLE USING BASE VECTOR
028286,000117: 24,3533           01674                                    VINTFLAG                              #  OFF -- 1ST PASS CALL BASE VECTOR
028287,000118: 24,3534           70535                           SLOAD    SR1                                   
028288,000119: 24,3535           01146                                    OPTION2                               
028289,000120: 24,3536           43030                           BHIZ     SET                                   
028290,000121: 24,3537           51541                                    +2                                    #  ZERO -- THIS VEHICLE (LM)
028291,000122: 24,3540           01474                                    VINTFLAG                              #  ONE -- OTHER VEHICLE (CM)
028292,000123: 24,3541           43014                           CLEAR    CLEAR                                 
028293,000124: 24,3542           01676                                    DIM0FLAG                              
028294,000125: 24,3543           01673                                    INTYPFLG                              #  PRECISION
028295,000126: 24,3544           77624                           CALL                                           
028296,000127: 24,3545           27134                                    INTEGRV                               #  CALCULATE
028297,000128: 24,3546           77650                           GOTO                                           #  -AND
028298,000129: 24,3547           51571                                    P21VSAVE                              #  -SAVE BASE VECTOR
028299,000130: 24,3550           77775        P21CONT            VLOAD                                          
028300,000131: 24,3551           03676                                    P21BASER                              #  RECYCLE -- INTEG FROM BASE VECTOR
028301,000132: 24,3552           25535                           STOVL    RCV                                   #  --POS

Page 656

028303,000134: 24,3553           03704                                    P21BASEV                              
028304,000135: 24,3554           15543                           STODL    VCV                                   #  --VEL
028305,000136: 24,3555           03763                                    P21TIME                               
028306,000137: 24,3556           01517                           STORE    TET                                   #  --TIME
028307,000138: 24,3557           43014                           CLEAR    CLEAR                                 
028308,000139: 24,3560           01676                                    DIM0FLAG                              
028309,000140: 24,3561           00263                                    MOONFLAG                              
028310,000141: 24,3562           53135                           SLOAD    BZE                                   
028311,000142: 24,3563           01164                                    P21ORIG                               
028312,000143: 24,3564           51567                                    +3                                    #  ZERO = EARTH
028313,000144: 24,3565           77614                           SET                                            #  ---2 = MOON
028314,000145: 24,3566           00063                                    MOONFLAG                              
028315,000146: 24,3567           77624                 +3        CALL                                           
028316,000147: 24,3570           27107                                    INTEGRVS                              
028317,000148: 24,3571           77745        P21VSAVE           DLOAD                                          #  SAVE CURRENT BASE VECTOR
028318,000149: 24,3572           00015                                    TAT                                   
028319,000150: 24,3573           27763                           STOVL    P21TIME                               #  --TIME
028320,000151: 24,3574           00017                                    RATT1                                 
028321,000152: 24,3575           27676                           STOVL    P21BASER                              #  --POS B-29 OR B-27
028322,000153: 24,3576           00025                                    VATT1                                 
028323,000154: 24,3577           03704                           STORE    P21BASEV                              #  --VEL B-07 OR B-05
028324,000155: 24,3600           53646                           ABVAL    SL*                                   
028325,000156: 24,3601           57576                                    0,2                                   
028326,000157: 24,3602           27712                           STOVL    P21VEL                                #  VEL/ FOR N91 DISP
028327,000158: 24,3603           00001                                    RATT                                  
028328,000159: 24,3604           50256                           UNIT     DOT                                   
028329,000160: 24,3605           00007                                    VATT                                  #  U(R).V
028330,000161: 24,3606           67471                           DDV      ASIN                                  #  U(R).U(V)
028331,000162: 24,3607           03712                                    P21VEL                                
028332,000163: 24,3610           03714                           STORE    P21GAM                                #  SIN-1 U(R).U(V) , -90 TO &90
028333,000164: 24,3611           67334                           SXA,2    SLOAD                                 
028334,000165: 24,3612           01163                                    P21ORIG                               #  0 = EARTH
028335,000166: 24,3613           01146                                    OPTION2                               
028336,000167: 24,3614           46142                           SR1      BHIZ                                  
028337,000168: 24,3615           51620                                    +3                                    
028338,000169: 24,3616           77650                           GOTO                                           
028339,000170: 24,3617           51623                                    +4                                    
028340,000171: 24,3620           77614                 +3        BON                                            
028341,000172: 24,3621           04307                                    SURFFLAG                              
028342,000173: 24,3622           51625                                    P21DSP                                
028343,000174: 24,3623           77614                 +4        SET                                            
028344,000175: 24,3624           00064                                    P21FLAG                               
028345,000176: 24,3625           67214        P21DSP             CLEAR    SLOAD                                 #  GENERATE DISPLAY DATA
028346,000177: 24,3626           01663                                    LUNAFLAG                              
028347,000178: 24,3627           00050                                    X2                                    
028348,000179: 24,3630           43054                           BZE      SET                                   
028349,000180: 24,3631           51633                                    +2                                    #  0 = EARTH
028350,000181: 24,3632           01463                                    LUNAFLAG                              
028351,000182: 24,3633           77775                           VLOAD                                          
028352,000183: 24,3634           00001                                    RATT                                  

Page 657

028354,000185: 24,3635           16032                           STODL    ALPHAV                                
028355,000186: 24,3636           00015                                    TAT                                   
028356,000187: 24,3637           45014                           CLEAR    CALL                                  
028357,000188: 24,3640           00662                                    ERADFLAG                              
028358,000189: 24,3641           26351                                    LAT-LONG                              
028359,000190: 24,3642           77605                           DMP                                            #  MPAC = ALT, METERS B-29
028360,000191: 24,3643           11667                                    K.01                                  
028361,000192: 24,3644           03716                           STORE    P21ALT                                #  ALT/100 FOR N91 DISP
028362,000193: 24,3645           77776                           EXIT                                           
028363,000194: 24,3646           33664                           CAF      V06N43                                #  DISPLAY LAT, LONG, ALT
028364,000195: 24,3647           04616                           TC       BANKCALL                              #  LAT, LONG = 1/2 REVS B0
028365,000196: 24,3650           20476                           CADR     GOFLASH                               #  ALT = KM B14
028366,000197: 24,3651           06001                           TC       GOTOPOOH                              #  TERM
028367,000198: 24,3652           06001                           TC       GOTOPOOH                              
028368,000199: 24,3653           06037                           TC       INTPRET                               #  V32E RECYCLE
028369,000200: 24,3654           43345                           DLOAD    DAD                                   
028370,000201: 24,3655           03763                                    P21TIME                               
028371,000202: 24,3656           11663                                    600SEC                                #  600 SECONDS OR 10 MIN
028372,000203: 24,3657           01046                           STORE    DSPTEM1                               
028373,000204: 24,3660           77634                           RTB                                            
028374,000205: 24,3661           51515                                    P21PROG1                              
028375,000206: 24,3662           00003 25140  600SEC             2DEC     60000      B-28                       #  10 MIN
028376,000207: 
028377,000208: 24,3664           01453        V06N43             VN       00643                                 
028378,000209: 24,3665           01442        V6N34              VN       00634                                 
028379,000210: 24,3666           00243 32703  K.01               2DEC     .01                                   
028380,000211: 

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