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
	16:27 JULY 14,1969
Note that the date is the date of the printout, not the date of the program revision.

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

Page 654

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

Page 655

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

Page 656

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

Page 657

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

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