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.

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

Page 654

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

Page 655

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

Page 656

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

Page 657

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

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