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.

019893,000002:                                                                                                  ## Copyright:   Public domain.
019894,000003:                                                                                                  ## Filename:    GROUND_TRACKING_DETERMINATION_PROGRAM.agc
019895,000004:                                                                                                  ## Purpose:     Part of the source code for Comanche, build 055.
019896,000005:                                                                                                  ##              It is part of the source code for the Command Module's (CM)
019897,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), Apollo 11.
019898,000007:                                                                                                  ## Assembler:   yaYUL
019899,000008:                                                                                                  ## Reference:   pp. 456-459
019900,000009:                                                                                                  ## Contact:     Onno Hommes <ohommes@cmu.edu>.
019901,000010:                                                                                                  ## Website:     www.ibiblio.org/apollo.
019902,000011:                                                                                                  ## Mod history: 2009-05-07 OH   Transcription Batch 1 Assignment 
019903,000012:                                                                                                  ##              2009-05-20 RSB  Corrected a couple of DIMOFLAG to DIM0FLAG.
019904,000013:                                                                                                  ##
019905,000014:                                                                                                  ## The contents of the "Comanche055" files, in general, are transcribed 
019906,000015:                                                                                                  ## from scanned documents. 
019907,000016:                                                                                                  ##
019908,000017:                                                                                                  ##      Assemble revision 055 of AGC program Comanche by NASA
019909,000018:                                                                                                  ##      2021113-051.  April 1, 1969.  
019910,000019:                                                                                                  ##
019911,000020:                                                                                                  ##      This AGC program shall also be referred to as Colossus 2A
019912,000021:                                                                                                  ##
019913,000022:                                                                                                  ##      Prepared by
019914,000023:                                                                                                  ##                      Massachusetts Institute of Technology
019915,000024:                                                                                                  ##                      75 Cambridge Parkway
019916,000025:                                                                                                  ##                      Cambridge, Massachusetts
019917,000026:                                                                                                  ##
019918,000027:                                                                                                  ##      under NASA contract NAS 9-4065.
019919,000028:                                                                                                  ##
019920,000029:                                                                                                  ## Refer directly to the online document mentioned above for further information.
019921,000030:                                                                                                  ## Please report any errors to info@sandroid.org.
019922,000031: 

Page 456

019924,000033:                                                                                                  #  GROUND TRACKING DETERMINATION PROGRAM -- P21
019925,000034: 
019926,000035:                                                                                                  #  PROGRAM DESCRIPTION
019927,000036:                                                                                                  #        MOD NO -- 1
019928,000037:                                                                                                  #        MOD BY -- N. M. NEVILLE
019929,000038: 
019930,000039:                                                                                                  #  FUNCTIONAL DESCRIPTION --
019931,000040:                                                                                                  #        TO PROVIDE THE ASTRONAUT DETAILS OF THE LM OR CSM GROUND TRACK WITHOUT
019932,000041:                                                                                                  #        THE NEED FOR GROUND COMMUNICATION (REQUESTED BY DSKY).
019933,000042: 
019934,000043:                                                                                                  #  CALLING SEQUENCE --
019935,000044:                                                                                                  #        ASTRONAUT REQUEST THROUGH DSKY V37E21E
019936,000045: 
019937,000046:                                                                                                  #  SUBROUTINES CALLED --
019938,000047:                                                                                                  #        GOPERF4
019939,000048:                                                                                                  #        GOFLASH
019940,000049:                                                                                                  #        THISPREC
019941,000050:                                                                                                  #        OTHPREC
019942,000051:                                                                                                  #        LAT-LONG
019943,000052: 
019944,000053:                                                                                                  #  NORMAL EXIT MODES --
019945,000054:                                                                                                  #        ASTRONAUT REQUEST THROUGH DSKY TO TERMINATE PROGRAM V34E
019946,000055: 
019947,000056:                                                                                                  #  ALARM OR ABORT EXIT MODES --
019948,000057:                                                                                                  #        NONE
019949,000058: 
019950,000059:                                                                                                  #  OUTPUT --
019951,000060:                                                                                                  #        OCTAL DISPLAY OF OPTION CODE AND VEHICLE WHOSE GROUND TRACK IS TO BE
019952,000061:                                                                                                  #        COMPUTED
019953,000062:                                                                                                  #                OPTION CODE     00002
019954,000063:                                                                                                  #                THIS            00001
019955,000064:                                                                                                  #                OTHER           00002
019956,000065:                                                                                                  #        DECIMAL DISPLAY OF TIME TO BE INTEGRATED TO HOURS , MINUTES , SECONDS
019957,000066:                                                                                                  #        DECIMAL DISPLAY OF LAT,LONG,ALT
019958,000067: 
019959,000068:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED
019960,000069:                                                                                                  #        AX0      2DEC   4.652459653 E-5   RADIANS       "68-69 CONSTANTS"
019961,000070:                                                                                                  #        -AY0     2DEC   2.147535898 E-5   RADIANS
019962,000071:                                                                                                  #        AZ0      2DEC   .7753206164       REVOLUTIONS
019963,000072:                                                                                                  #        FOR LUNAR ORBITS 504LM VECTOR IS NEEDED
019964,000073:                                                                                                  #        504LM    2DEC   -2.700340600 E-5  RADIANS
019965,000074:                                                                                                  #        504LM _2 2DEC   -7.514128400 E-4  RADIANS
019966,000075:                                                                                                  #        504LM _4 2DEC   _2.553198641 E-4  RADIANS
019967,000076: 
019968,000077:                                                                                                  #        NONE
019969,000078: 
019970,000079:                                                                                                  #  DEBRIS
019971,000080: 

Page 457

019973,000082:                                                                                                  #        CENTRALS -- A,Q,L
019974,000083:                                                                                                  #        OTHER -- THOSE USED BY THE ABOVE LISTED SUBROUTINES
019975,000084:                                                                                                  #        SEE LEMPREC, LAT-LONG
019976,000085: 
019977,000086: 33,3776  30,2000                                  SBANK=   LOWSUPER                              #  FOR LOW 2CADR'S.
019978,000087: 
019979,000088: 33,3776                                           BANK     33                                    
019980,000089: 37,2000                                           SETLOC   P20S                                  
019981,000090: 37,2000                                           BANK                                           
019982,000091: 
019983,000092: 37,2001  E4,1715                                  EBANK=   P21TIME                               
019984,000093: 37,2001                                           COUNT    24/P21                                
019985,000094: 
019986,000095: 37,2001           35017        PROG21             CAF      ONE                                   
019987,000096: 37,2002           55132                           TS       OPTION2                               #  ASSUMED VEHICLE IS LM, R2 = 00001
019988,000097: 37,2003           35016                           CAF      BIT2                                  #   OPTION 2
019989,000098: 37,2004           04662                           TC       BANKCALL                              
019990,000099: 37,2005           21055                           CADR     GOPERF4                               
019991,000100: 37,2006           04106                           TC       GOTOP00H                              #  TERMINATE
019992,000101: 37,2007           02011                           TC       +2                                    #  PROCEED VALUE OF ASSUMED VEHICLE OK
019993,000102: 37,2010           02003                           TC       -5                                    #  R2 LOADED THROUGH DSKY
019994,000103: 37,2011           32152        P21PROG1           CAF      V6N34                                 #  LOAD DESIRED TIME OF LAT-LONG.
019995,000104: 37,2012           04662                           TC       BANKCALL                              
019996,000105: 37,2013           20720                           CADR     GOFLASH                               
019997,000106: 37,2014           04106                           TC       GOTOP00H                              #  TERM
019998,000107: 37,2015           02017                           TC       +2                                    #  PROCEED VALUES OK
019999,000108: 37,2016           02011                           TC       -5                                    #  TIME LOADED THROUGH DSKY
020000,000109: 37,2017           06006                           TC       INTPRET                               
020001,000110: 37,2020           77745                           DLOAD                                          
020002,000111: 37,2021           01046                                    DSPTEM1                               
020003,000112: 37,2022           34041                           STCALL   TDEC1                                 #  INTEG TO TIME SPECIFIED IN TDEC
020004,000113: 37,2023           27442                                    INTSTALL                              
020005,000114: 37,2024           43014                           BON      SET                                   
020006,000115: 37,2025           01303                                    P21FLAG                               
020007,000116: 37,2026           76044                                    P21CONT                               #  ON...RECYCLE USING BASE VECTOR
020008,000117: 37,2027           01474                                    VINTFLAG                              #  OFF..1ST PASS CALC BASE VECTOR
020009,000118: 37,2030           70535                           SLOAD    SR1                                   
020010,000119: 37,2031           01133                                    OPTION2                               
020011,000120: 37,2032           43030                           BHIZ     CLEAR                                 
020012,000121: 37,2033           76035                                    +2                                    #  ZERO..THIS VEHICLE (CM)
020013,000122: 37,2034           01674                                    VINTFLAG                              #  ONE...OTHER VEHICLE(LM)
020014,000123: 37,2035           43014                           CLEAR    CLEAR                                 
020015,000124: 37,2036           01676                                    DIM0FLAG                              
020016,000125: 37,2037           01673                                    INTYPFLG                              #  PRECISION
020017,000126: 37,2040           77624                           CALL                                           
020018,000127: 37,2041           27162                                    INTEGRV                               #  CALCULATE
020019,000128: 37,2042           77650                           GOTO                                           #  .AND
020020,000129: 37,2043           76065                                    P21VSAVE                              #  ..SAVE BASE VECTOR
020021,000130: 37,2044           77775        P21CONT            VLOAD                                          #  RECYCLE..INTEG FROM BASE VECTOR                       
020022,000131: 37,2045           03605                                    P21BASER                              

Page 458

020024,000133: 37,2046           25535                           STOVL    RCV                                   #  ..POS
020025,000134: 37,2047           03613                                    P21BASEV                              
020026,000135: 37,2050           15543                           STODL    VCV                                   #  ..VEL
020027,000136: 37,2051           02316                                    P21TIME                               
020028,000137: 37,2052           01517                           STORE    TET                                   #  ..TIME
020029,000138: 37,2053           43014                           CLEAR    CLEAR                                 
020030,000139: 37,2054           01676                                    DIM0FLAG                              
020031,000140: 37,2055           00263                                    MOONFLAG                              
020032,000141: 37,2056           53135                           SLOAD    BZE                                   
020033,000142: 37,2057           03604                                    P21ORIG                               
020034,000143: 37,2060           76063                                    +3                                    #  ZERO = EARTH
020035,000144: 37,2061           77614                           SET                                            #  ...2 = MOON
020036,000145: 37,2062           00063                                    MOONFLAG                              
020037,000146: 37,2063           77624                           CALL                                           
020038,000147: 37,2064           27135                                    INTEGRVS                              
020039,000148: 37,2065           77745        P21VSAVE           DLOAD                                          #  SAVE CURRENT BASE VECTOR
020040,000149: 37,2066           00015                                    TAT                                   
020041,000150: 37,2067           26316                           STOVL    P21TIME                               #  ..TIME
020042,000151: 37,2070           00017                                    RATT1                                 
020043,000152: 37,2071           27605                           STOVL    P21BASER                              #  ..POS B-29 OR B-27
020044,000153: 37,2072           00025                                    VATT1                                 
020045,000154: 37,2073           03613                           STORE    P21BASEV                              #  ..VEL B-7  OR B-5
020046,000155: 37,2074           53646                           ABVAL    SL*                                   
020047,000156: 37,2075           57576                                    0,2                                   
020048,000157: 37,2076           27623                           STOVL    P21VEL                                #  /VEL/ FOR N73 DSP
020049,000158: 37,2077           00001                                    RATT                                  
020050,000159: 37,2100           50256                           UNIT     DOT                                   
020051,000160: 37,2101           00007                                    VATT                                  #  U(R).(V)
020052,000161: 37,2102           67471                           DDV      ASIN                                  #  U(R).U(V)
020053,000162: 37,2103           03623                                    P21VEL                                
020054,000163: 37,2104           03625                           STORE    P21GAM                                #  SIN-1 U(R).U(V), -90 TO +90
020055,000164: 37,2105           43134                           SXA,2    SET                                   
020056,000165: 37,2106           03603                                    P21ORIG                               #  0 = EARTH  2 = MOON
020057,000166: 37,2107           01063                                    P21FLAG                               
020058,000167: 37,2110           67214        P21DSP             CLEAR    SLOAD                                 #  GENERATE DISPLAY DATA
020059,000168: 37,2111           01663                                    LUNAFLAG                              
020060,000169: 37,2112           00050                                    X2                                    
020061,000170: 37,2113           43054                           BZE      SET                                   
020062,000171: 37,2114           76116                                    +2                                    #  0 = EARTH
020063,000172: 37,2115           01463                                    LUNAFLAG                              
020064,000173: 37,2116           77775                           VLOAD                                          
020065,000174: 37,2117           00001                                    RATT                                  
020066,000175: 37,2120           16152                           STODL    ALPHAV                                
020067,000176: 37,2121           00015                                    TAT                                   
020068,000177: 37,2122           45014                           CLEAR    CALL                                  
020069,000178: 37,2123           00662                                    ERADFLAG                              
020070,000179: 37,2124           26370                                    LAT-LONG                              
020071,000180: 37,2125           77605                           DMP                                            #  MPAC = ALT, METERS B-29
020072,000181: 37,2126           36154                                    K.01                                  
020073,000182: 37,2127           03621                           STORE    P21ALT                                #  ALT/100 FOR N73 DSP

Page 459

020075,000184: 37,2130           77776                           EXIT                                           
020076,000185: 37,2131           32151                           CAF      V06N43                                #  DISPLAY LAT,LONG,ALT
020077,000186: 37,2132           04662                           TC       BANKCALL                              #  LAT,LONG = REVS B0 BOTH EARTH/MOON
020078,000187: 37,2133           20720                           CADR     GOFLASH                               #  ALT = METERS B-29  BOTH EARTH/MOON
020079,000188: 37,2134           04106                           TC       GOTOP00H                              #  TERM
020080,000189: 37,2135           04106                           TC       GOTOP00H                              
020081,000190: 37,2136           06006                           TC       INTPRET                               #  V32E RECYCLE
020082,000191: 37,2137           43345                           DLOAD    DAD                                   
020083,000192: 37,2140           02316                                    P21TIME                               
020084,000193: 37,2141           36146                                    600SEC                                #  600 SECONDS OR 10 MIN
020085,000194: 37,2142           01046                           STORE    DSPTEM1                               
020086,000195: 37,2143           77634                           RTB                                            
020087,000196: 37,2144           76011                                    P21PROG1                              
020088,000197: 
020089,000198: 37,2145           00003 25140  600SEC             2DEC     60000      B-28                       #  10 MIN
020090,000199: 
020091,000200: 37,2147           00001        P21ONENN           OCT      00001                                 #  NEEDED TO DETERMINE VEHICLE
020092,000201: 37,2150           00000                           OCT      00000                                 #  TO BE INTEGRATED
020093,000202: 37,2151           01453        V06N43             VN       00643                                 
020094,000203: 37,2152           01442        V6N34              VN       00634                                 
020095,000204: 37,2153           00243 32703  K.01               2DEC     .01                                   
020096,000205: 

End of include-file GROUND_TRACKING_DETERMINATION_PROGRAM.agc.  Parent file is MAIN.agc