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 Colossus 249 (Apollo 9) 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 055 OF AGC PROGRAM COMANCHE BY NASA 2021113-051
	10:28 APR.  1,1969
Note that the date is the date of the printout, not the date of the program revision.

019998,000002:                                                                                                  ## Copyright:   Public domain.
019999,000003:                                                                                                  ## Filename:    GROUND_TRACKING_DETERMINATION_PROGRAM.agc
020000,000004:                                                                                                  ## Purpose:     Part of the source code for Comanche, build 055.
020001,000005:                                                                                                  ##              It is part of the source code for the Command Module's (CM)
020002,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), Apollo 11.
020003,000007:                                                                                                  ## Assembler:   yaYUL
020004,000008:                                                                                                  ## Reference:   pp. 456-459
020005,000009:                                                                                                  ## Contact:     Onno Hommes <ohommes@cmu.edu>.
020006,000010:                                                                                                  ## Website:     www.ibiblio.org/apollo.
020007,000011:                                                                                                  ## Mod history: 2009-05-07 OH   Transcription Batch 1 Assignment 
020008,000012:                                                                                                  ##              2009-05-20 RSB  Corrected a couple of DIMOFLAG to DIM0FLAG.
020009,000013:                                                                                                  ##              2016-12-10 RSB  Proofed comments with octopus/ProoferComments
020010,000014:                                                                                                  ##                              and fixed the errors found.
020011,000015:                                                                                                  ##              2016-12-10 RSB  All of the GOTOPOOH's should have been
020012,000016:                                                                                                  ##                              GOTOPOOH, and I've changed them back.
020013,000017:                                                                                                  ##
020014,000018:                                                                                                  ## The contents of the "Comanche055" files, in general, are transcribed 
020015,000019:                                                                                                  ## from scanned documents. 
020016,000020:                                                                                                  ##
020017,000021:                                                                                                  ##      Assemble revision 055 of AGC program Comanche by NASA
020018,000022:                                                                                                  ##      2021113-051.  April 1, 1969.  
020019,000023:                                                                                                  ##
020020,000024:                                                                                                  ##      This AGC program shall also be referred to as Colossus 2A
020021,000025:                                                                                                  ##
020022,000026:                                                                                                  ##      Prepared by
020023,000027:                                                                                                  ##                      Massachusetts Institute of Technology
020024,000028:                                                                                                  ##                      75 Cambridge Parkway
020025,000029:                                                                                                  ##                      Cambridge, Massachusetts
020026,000030:                                                                                                  ##
020027,000031:                                                                                                  ##      under NASA contract NAS 9-4065.
020028,000032:                                                                                                  ##
020029,000033:                                                                                                  ## Refer directly to the online document mentioned above for further information.
020030,000034:                                                                                                  ## Please report any errors to info@sandroid.org.
020031,000035: 

Page 456

020033,000037:                                                                                                  #  GROUND TRACKING DETERMINATION PROGRAM P21
020034,000038: 
020035,000039:                                                                                                  #  PROGRAM DESCRIPTION
020036,000040:                                                                                                  #  MOD NO - 1
020037,000041:                                                                                                  #  MOD BY - N. M. NEVILLE
020038,000042:                                                                                                  #  FUNCTIONAL DECRIPTION-
020039,000043: 
020040,000044:                                                                                                  #  TO PROVIDE THE ASTRONAUT DETAILS OF THE LM OR CSM GROUND TRACK WITHOUT
020041,000045:                                                                                                  #  THE NEED FOR GROUND COMMUNICATION (REQUESTED BY DSKY).
020042,000046:                                                                                                  #  CALLING SEQUENCE-
020043,000047: 
020044,000048:                                                                                                  #  ASTRONAUT REQUEST THROUGH DSKY V37E21E
020045,000049:                                                                                                  #  SUBROUTINES CALLED-
020046,000050: 
020047,000051:                                                                                                  #  GOPERF4
020048,000052:                                                                                                  #  GOFLASH
020049,000053:                                                                                                  #  THISPREC
020050,000054:                                                                                                  #  OTHPREC
020051,000055:                                                                                                  #  LAT-LONG
020052,000056:                                                                                                  #  NORMAL EXIT MODES-
020053,000057: 
020054,000058:                                                                                                  #  ASTRONAUT REQUEST TROUGH DSKY TO TERMINATE PROGRAM V34E
020055,000059:                                                                                                  #  ALARM OR ABORT EXIT MODES-
020056,000060: 
020057,000061:                                                                                                  #  NONE
020058,000062:                                                                                                  #  OUTPUT-
020059,000063: 
020060,000064:                                                                                                  #  OCTAL DISPLAY OF OPTION CODE AND VEHICLE WHOSE GROUND TRACK IS TO BE
020061,000065:                                                                                                  #  COMPUTED
020062,000066:                                                                                                  #           OPTION CODE  00002
020063,000067:                                                                                                  #           THIS         00001
020064,000068:                                                                                                  #           OTHER                00002
020065,000069:                                                                                                  #  DECIMAL DISPLAY OF TIME TO BE INTEGRATED TO HOURS , MINUTES , SECONDS
020066,000070:                                                                                                  #  DECIMAL DISPLAY OF LAT,LONG,ALT
020067,000071:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED
020068,000072: 
020069,000073:                                                                                                  #  AX0    2DEC   4.652459653 E-5   RADIANS       %68-69 CONSTANTS"
020070,000074: 
020071,000075:                                                                                                  #  -AY0   2DEC   2.147535898 E-5   RADIANS
020072,000076: 
020073,000077:                                                                                                  #  AZ0    2DEC   .7753206164       REVOLUTIONS
020074,000078:                                                                                                  #  FOR LUNAR ORBITS 504LM VECTOR IS NEEDED
020075,000079: 
020076,000080:                                                                                                  #  504LM  2DEC   -2.700340600 E-5  RADIANS
020077,000081: 
020078,000082:                                                                                                  #  504LM _2 2DEC -7.514128400 E-4  RADIANS
020079,000083: 
020080,000084:                                                                                                  #  504LM _4 2DEC _2.553198641 E-4  RADIANS
020081,000085: 
020082,000086:                                                                                                  #  NONE
020083,000087:                                                                                                  #  DEBRIS
020084,000088: 

Page 457

020086,000090:                                                                                                  #  CENTRALS-A,Q,L
020087,000091:                                                                                                  #  OTHER-THOSE USED BY THE ABOVE LISTED SUBROUTINES
020088,000092:                                                                                                  #  SEE LEMPREC, LAT-LONG
020089,000093: 
020090,000094: 33,3776  30,2000                                  SBANK=   LOWSUPER                              #  FOR LOW 2CADR'S.
020091,000095: 
020092,000096: 33,3776                                           BANK     33                                    
020093,000097: 37,2000                                           SETLOC   P20S                                  
020094,000098: 37,2000                                           BANK                                           
020095,000099: 
020096,000100: 37,2001  E4,1715                                  EBANK=   P21TIME                               
020097,000101: 37,2001                                           COUNT    24/P21                                
020098,000102: 
020099,000103: 37,2001           35017        PROG21             CAF      ONE                                   
020100,000104: 37,2002           55132                           TS       OPTION2                               #  ASSUMED VEHICLE IS LM, R2 = 00001
020101,000105: 37,2003           35016                           CAF      BIT2                                  #   OPTION 2
020102,000106: 37,2004           04662                           TC       BANKCALL                              
020103,000107: 37,2005           21055                           CADR     GOPERF4                               
020104,000108: 37,2006           04106                           TC       GOTOPOOH                              #  TERMINATE
020105,000109: 37,2007           02011                           TC       +2                                    #  PROCEED VALUE OF ASSUMED VEHICLE OK
020106,000110: 37,2010           02003                           TC       -5                                    #  R2 LOADED THROUGH DSKY
020107,000111: 37,2011           32152        P21PROG1           CAF      V6N34                                 #  LOAD DESIRED TIME OF LAT-LONG.
020108,000112: 37,2012           04662                           TC       BANKCALL                              
020109,000113: 37,2013           20720                           CADR     GOFLASH                               
020110,000114: 37,2014           04106                           TC       GOTOPOOH                              #  TERM
020111,000115: 37,2015           02017                           TC       +2                                    #  PROCEED VALUES OK
020112,000116: 37,2016           02011                           TC       -5                                    #  TIME LOADED THROUGH DSKY
020113,000117: 37,2017           06006                           TC       INTPRET                               
020114,000118: 37,2020           77745                           DLOAD                                          
020115,000119: 37,2021           01046                                    DSPTEM1                               
020116,000120: 37,2022           34041                           STCALL   TDEC1                                 #  INTEG TO TIME SPECIFIED IN TDEC
020117,000121: 37,2023           27442                                    INTSTALL                              
020118,000122: 37,2024           43014                           BON      SET                                   
020119,000123: 37,2025           01303                                    P21FLAG                               
020120,000124: 37,2026           76044                                    P21CONT                               #  ON...RECYCLE USING BASE VECTOR
020121,000125: 37,2027           01474                                    VINTFLAG                              #  OFF..1ST PASS CALC BASE VECTOR
020122,000126: 37,2030           70535                           SLOAD    SR1                                   
020123,000127: 37,2031           01133                                    OPTION2                               
020124,000128: 37,2032           43030                           BHIZ     CLEAR                                 
020125,000129: 37,2033           76035                                    +2                                    #  ZERO..THIS VEHICLE (CM)
020126,000130: 37,2034           01674                                    VINTFLAG                              #  ONE...OTHER VEHICLE(LM)
020127,000131: 37,2035           43014                           CLEAR    CLEAR                                 
020128,000132: 37,2036           01676                                    DIM0FLAG                              
020129,000133: 37,2037           01673                                    INTYPFLG                              #  PRECISION
020130,000134: 37,2040           77624                           CALL                                           
020131,000135: 37,2041           27162                                    INTEGRV                               #  CALCULATE
020132,000136: 37,2042           77650                           GOTO                                           #  .AND
020133,000137: 37,2043           76065                                    P21VSAVE                              #  ..SAVE BASE VECTOR
020134,000138: 37,2044           77775        P21CONT            VLOAD                                          #  RECYCLE..INTEG FROM BASE VECTOR                       
020135,000139: 37,2045           03605                                    P21BASER                              

Page 458

020137,000141: 37,2046           25535                           STOVL    RCV                                   #  ..POS
020138,000142: 37,2047           03613                                    P21BASEV                              
020139,000143: 37,2050           15543                           STODL    VCV                                   #  ..VEL
020140,000144: 37,2051           02316                                    P21TIME                               
020141,000145: 37,2052           01517                           STORE    TET                                   #  ..TIME
020142,000146: 37,2053           43014                           CLEAR    CLEAR                                 
020143,000147: 37,2054           01676                                    DIM0FLAG                              
020144,000148: 37,2055           00263                                    MOONFLAG                              
020145,000149: 37,2056           53135                           SLOAD    BZE                                   
020146,000150: 37,2057           03604                                    P21ORIG                               
020147,000151: 37,2060           76063                                    +3                                    #  ZERO = EARTH
020148,000152: 37,2061           77614                           SET                                            #  ...2 = MOON
020149,000153: 37,2062           00063                                    MOONFLAG                              
020150,000154: 37,2063           77624                           CALL                                           
020151,000155: 37,2064           27135                                    INTEGRVS                              
020152,000156: 37,2065           77745        P21VSAVE           DLOAD                                          #  SAVE CURRENT BASE VECTOR
020153,000157: 37,2066           00015                                    TAT                                   
020154,000158: 37,2067           26316                           STOVL    P21TIME                               #  ..TIME
020155,000159: 37,2070           00017                                    RATT1                                 
020156,000160: 37,2071           27605                           STOVL    P21BASER                              #  ..POS B-29 OR B-27
020157,000161: 37,2072           00025                                    VATT1                                 
020158,000162: 37,2073           03613                           STORE    P21BASEV                              #  ..VEL B-7  OR B-5
020159,000163: 37,2074           53646                           ABVAL    SL*                                   
020160,000164: 37,2075           57576                                    0,2                                   
020161,000165: 37,2076           27623                           STOVL    P21VEL                                #  /VEL/ FOR N73 DSP
020162,000166: 37,2077           00001                                    RATT                                  
020163,000167: 37,2100           50256                           UNIT     DOT                                   
020164,000168: 37,2101           00007                                    VATT                                  #  U(R).(V)
020165,000169: 37,2102           67471                           DDV      ASIN                                  #  U(R).U(V)
020166,000170: 37,2103           03623                                    P21VEL                                
020167,000171: 37,2104           03625                           STORE    P21GAM                                #  SIN-1 U(R).U(V), -90 TO +90
020168,000172: 37,2105           43134                           SXA,2    SET                                   
020169,000173: 37,2106           03603                                    P21ORIG                               #  0 = EARTH  2 = MOON
020170,000174: 37,2107           01063                                    P21FLAG                               
020171,000175: 37,2110           67214        P21DSP             CLEAR    SLOAD                                 #  GENERATE DISPLAY DATA
020172,000176: 37,2111           01663                                    LUNAFLAG                              
020173,000177: 37,2112           00050                                    X2                                    
020174,000178: 37,2113           43054                           BZE      SET                                   
020175,000179: 37,2114           76116                                    +2                                    #  0 = EARTH
020176,000180: 37,2115           01463                                    LUNAFLAG                              
020177,000181: 37,2116           77775                           VLOAD                                          
020178,000182: 37,2117           00001                                    RATT                                  
020179,000183: 37,2120           16152                           STODL    ALPHAV                                
020180,000184: 37,2121           00015                                    TAT                                   
020181,000185: 37,2122           45014                           CLEAR    CALL                                  
020182,000186: 37,2123           00662                                    ERADFLAG                              
020183,000187: 37,2124           26370                                    LAT-LONG                              
020184,000188: 37,2125           77605                           DMP                                            #  MPAC = ALT, METERS B-29
020185,000189: 37,2126           36154                                    K.01                                  
020186,000190: 37,2127           03621                           STORE    P21ALT                                #  ALT/100 FOR N73 DSP

Page 459

020188,000192: 37,2130           77776                           EXIT                                           
020189,000193: 37,2131           32151                           CAF      V06N43                                #  DISPLAY LAT,LONG,ALT
020190,000194: 37,2132           04662                           TC       BANKCALL                              #  LAT,LONG = REVS B0 BOTH EARTH/MOON
020191,000195: 37,2133           20720                           CADR     GOFLASH                               #  ALT = METERS B-29  BOTH EARTH/MOON
020192,000196: 37,2134           04106                           TC       GOTOPOOH                              #  TERM
020193,000197: 37,2135           04106                           TC       GOTOPOOH                              
020194,000198: 37,2136           06006                           TC       INTPRET                               #  V32E RECYCLE
020195,000199: 37,2137           43345                           DLOAD    DAD                                   
020196,000200: 37,2140           02316                                    P21TIME                               
020197,000201: 37,2141           36146                                    600SEC                                #  600 SECONDS OR 10 MIN
020198,000202: 37,2142           01046                           STORE    DSPTEM1                               
020199,000203: 37,2143           77634                           RTB                                            
020200,000204: 37,2144           76011                                    P21PROG1                              
020201,000205: 
020202,000206: 37,2145           00003 25140  600SEC             2DEC     60000      B-28                       #  10 MIN
020203,000207: 
020204,000208: 37,2147           00001        P21ONENN           OCT      00001                                 #  NEEDED TO DETERMINE VEHICLE
020205,000209: 37,2150           00000                           OCT      00000                                 #  TO BE INTEGRATED
020206,000210: 37,2151           01453        V06N43             VN       00643                                 
020207,000211: 37,2152           01442        V6N34              VN       00634                                 
020208,000212: 37,2153           00243 32703  K.01               2DEC     .01                                   
020209,000213: 

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