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.

021974,000002:                                                                                                  ## Copyright:   Public domain.
021975,000003:                                                                                                  ## Filename:    R31.agc
021976,000004:                                                                                                  ## Purpose:     Part of the source code for Comanche, build 055. It
021977,000005:                                                                                                  ##              is part of the source code for the Command Module's
021978,000006:                                                                                                  ##              (CM) Apollo Guidance Computer (AGC), Apollo 11.
021979,000007:                                                                                                  ## Assembler:   yaYUL
021980,000008:                                                                                                  ## Reference:   pp. 505-510
021981,000009:                                                                                                  ## Contact:     Onno Hommes <ohommes@cmu.edu>
021982,000010:                                                                                                  ## Website:     http://www.ibiblio.org/apollo.
021983,000011:                                                                                                  ## Mod history: 2009-05-11 OH   Batch 2 Assignment Comanche Transcription
021984,000012:                                                                                                  ##              2009-05-20 RSB  Corrected INSTALL -> INTSTALL
021985,000013:                                                                                                  ##              2016-12-10 RSB  Proofed comments with octopus/ProoferComments
021986,000014:                                                                                                  ##                              and fixed the errors found.
021987,000015:                                                                                                  ##              2017-01-18 RSB  Fixed comment-text errors noted while diff'ing
021988,000016:                                                                                                  ##                              vs Colossus 249.
021989,000017:                                                                                                  ##              2017-02-08 RSB  Comment-text fixes identified in proofing Artemis 72.
021990,000018:                                                                                                  ##              2017-03-17 RSB  Comment-text fixes identified by 4-way diff'ing
021991,000019:                                                                                                  ##                              of Colossus 237 & 249, Comanche 55, and Artemis 72.
021992,000020: 
021993,000021:                                                                                                  ## The contents of the "Comanche055" files, in general, are transcribed 
021994,000022:                                                                                                  ## from scanned documents. 
021995,000023:                                                                                                  ##
021996,000024:                                                                                                  ##       Assemble revision 055 of AGC program Comanche by NASA
021997,000025:                                                                                                  ##       2021113-051.  April 1, 1969.  
021998,000026:                                                                                                  ##
021999,000027:                                                                                                  ##       This AGC program shall also be referred to as Colossus 2A
022000,000028:                                                                                                  ##
022001,000029:                                                                                                  ##       Prepared by
022002,000030:                                                                                                  ##                       Massachusetts Institute of Technology
022003,000031:                                                                                                  ##                       75 Cambridge Parkway
022004,000032:                                                                                                  ##                       Cambridge, Massachusetts
022005,000033:                                                                                                  ##
022006,000034:                                                                                                  ##       under NASA contract NAS 9-4065.
022007,000035:                                                                                                  ##
022008,000036:                                                                                                  ## Refer directly to the online document mentioned above for further
022009,000037:                                                                                                  ## information.  Please report any errors to info@sandroid.org.
022010,000038: 
022011,000039: 

Page 505

022013,000041: 34,2002                                           BANK     34                                    
022014,000042: 31,2000                                           SETLOC   R31                                   
022015,000043: 31,2000                                           BANK                                           
022016,000044: 
022017,000045: 31,2000                                           COUNT*   $$/R31                                
022018,000046: 
022019,000047: 31,2000           35057        R31CALL            CAF      PRIO3                                 
022020,000048: 31,2001           05147                           TC       FINDVAC                               
022021,000049: 31,2002  E4,1770                                  EBANK=   SUBEXIT                               
022022,000050: 31,2002           02032 62064                     2CADR    V83CALL                               
022023,000051: 
022024,000052: 31,2004           35041        DSPDELAY           CAF      1SEC                                  
022025,000053: 31,2005           04662                           TC       BANKCALL                              
022026,000054: 31,2006           01732                           CADR     DELAYJOB                              
022027,000055: 31,2007           31044                           CA       EXTVBACT                              
022028,000056: 31,2010           75004                           MASK     BIT12                                 
022029,000057: 31,2011           00006                           EXTEND                                         
022030,000058: 31,2012           12004                           BZF      DSPDELAY                              
022031,000059: 
022032,000060: 31,2013           30105        DISPN5X            CA       FLAGWRD9                              #  TEST R31FLAG (IN SUNDANCE R31FLAG WILL
022033,000061: 31,2014           75014                           MASK     BIT4                                  #        ALWAYS BE SET AS R34 DOES NOT EXIST)
022034,000062: 31,2015           00006                           EXTEND                                         
022035,000063: 31,2016           12021                           BZF      +3                                    
022036,000064: 31,2017           32136                           CAF      V16N54                                #  R31   USE NOUN 54
022037,000065: 31,2020           02022                           TC       +2                                    
022038,000066: 31,2021           32137                           CAF      V16N53                                #  R34   USE NOUN 53
022039,000067: 31,2022           04662                           TC       BANKCALL                              
022040,000068: 31,2023           20561                           CADR     GOMARKF                               
022041,000069: 31,2024           05625                           TC       B5OFF                                 
022042,000070: 31,2025           05625                           TC       B5OFF                                 
022043,000071: 31,2026           12013                           TCF      DISPN5X                               
022044,000072: 
022045,000073: 31,2027           06006        V83                TC       INTPRET                               
022046,000074: 31,2030           77650                           GOTO                                           
022047,000075: 31,2031           62171                                    HAVEBASE                              #  INTEG STATE VECTORS
022048,000076: 31,2032           06006        V83CALL            TC       INTPRET                               
022049,000077: 31,2033           77650                           GOTO                                           
022050,000078: 31,2034           62140                                    STATEXTP                              #  EXTRAPOLATE STATE VECTORS
022051,000079: 31,2035           52375        COMPDISP           VLOAD    VSU                                   
022052,000080: 31,2036           00001                                    RATT                                  
022053,000081: 31,2037           02327                                    RONE                                  
022054,000082: 31,2040           51406                           PUSH     ABVAL                                 #  RATT-RONE TO 0D       PD= 6
022055,000083: 31,2041           02321                           STORE    RANGE                                 #  METERS B-29
022056,000084: 31,2042           77301                           NORM     VLOAD                                 
022057,000085: 31,2043           00047                                    X1                                    #  RATT-RONE             PD= 0
022058,000086: 31,2044           77762                           VSR1                                           
022059,000087: 31,2045           53457                           VSL*     UNIT                                  
022060,000088: 31,2046           20201                                    0,1                                   
022061,000089: 31,2047           52315                           PDVL     VSU                                   #  UNIT(LOS) TO 0D       PD= 6

Page 506

022063,000091: 31,2050           00007                                    VATT                                  
022064,000092: 31,2051           02335                                    VONE                                  
022065,000093: 31,2052           77641                           DOT                                            #  (VATT-VONE).UNIT(LOS) PD= 0
022066,000094: 31,2053           77752                           SL1                                            
022067,000095: 31,2054           36323                           STCALL   RRATE                                 #  RANGE RATE M/CS B-7
022068,000096: 31,2055           47477                                    CDUTRIG                               #  TO INITIALIZE FOR *NBSM*
022069,000097: 31,2056           77624                           CALL                                           
022070,000098: 31,2057           62311                                    R34LOS                                #  NOTE.  PDL MUST = 0.
022071,000099: 31,2060           53575        R34ANG             VLOAD    UNIT                                  
022072,000100: 31,2061           02327                                    RONE                                  
022073,000101: 31,2062           77715                           PDVL                                           #  UR TO 0D              PD= 6
022074,000102: 31,2063           15333                                    THISAXIS                              #  UNITX FOR CM, UNITZ FOR LM
022075,000103: 31,2064           77214                           BON      VLOAD                                 #  CHK R31FLAG.  ON=R31 THETA, OFF=R34 PHI
022076,000104: 31,2065           04713                                    R31FLAG                               
022077,000105: 31,2066           62070                                    +2                                    #  R31-THETA
022078,000106: 31,2067           00015                                    12D                                   
022079,000107: 31,2070           77624                           CALL                                           
022080,000108: 31,2071           47646                                    *NBSM*                                
022081,000109: 31,2072           41505                           VXM      PUSH                                  #  UXORZ TO 6D           PD=12D
022082,000110: 31,2073           01736                                    REFSMMAT                              
022083,000111: 31,2074           72431                           VPROJ    VSL2                                  
022084,000112: 31,2075           00001                                    0D                                    
022085,000113: 31,2076           53445                           BVSU     UNIT                                  
022086,000114: 31,2077           00007                                    6D                                    
022087,000115: 31,2100           47315                           PDVL     VXV                                   #  UP/2 TO 12D           PD=18D
022088,000116: 31,2101           02327                                    RONE                                  
022089,000117: 31,2102           02335                                    VONE                                  
022090,000118: 31,2103           47256                           UNIT     VXV                                   
022091,000119: 31,2104           02327                                    RONE                                  
022092,000120: 31,2105           63241                           DOT      PDVL                                  #  SIGN TO 12D, UP/2 TO MPAC     PD=18D
022093,000121: 31,2106           00015                                    12D                                   
022094,000122: 31,2107           50372                           VSL1     DOT                                   #  UP.UXORZ
022095,000123: 31,2110           00007                                    6D                                    
022096,000124: 31,2111           72565                           SIGN     SL1                                   
022097,000125: 31,2112           00015                                    12D                                   
022098,000126: 31,2113           77726                           ACOS                                           
022099,000127: 31,2114           26325                           STOVL    RTHETA                                
022100,000128: 31,2115           02327                                    RONE                                  
022101,000129: 31,2116           51041                           DOT      BPL                                   
022102,000130: 31,2117           00007                                    6D                                    
022103,000131: 31,2120           62125                                    +5                                    
022104,000132: 31,2121           44345                           DLOAD    BDSU                                  #  IF UXORZ.R NEG, RTHETA = 1 - RTHETA
022105,000133: 31,2122           02325                                    RTHETA                                
022106,000134: 31,2123           15343                                    DPPOSMAX                              
022107,000135: 31,2124           02325                           STORE    RTHETA                                #  RTHETA BETWEEN 0 AND 1 REV.
022108,000136: 31,2125           77776                           EXIT                                           
022109,000137: 31,2126           35013                           CAF      BIT5                                  #  HAVE WE BEEN ANSWERED
022110,000138: 31,2127           71044                           MASK     EXTVBACT                              
022111,000139: 31,2130           00006                           EXTEND                                         
022112,000140: 31,2131           15534                           BZF      ENDEXT                                #  YES, DIE

Page 507

022114,000142: 31,2132           41044                           CS       EXTVBACT                              
022115,000143: 31,2133           75004                           MASK     BIT12                                 
022116,000144: 31,2134           27044                           ADS      EXTVBACT                              
022117,000145: 
022118,000146: 31,2135           12027                           TCF      V83                                   
022119,000147: 31,2136           04066        V16N54             VN       1654                                  
022120,000148: 31,2137           04065        V16N53             VN       1653                                  
022121,000149: 

Page 508

022123,000151:                                                                                                  #  STATEXTP DOES AN INITIAL PRECISION EXTRAPOLATION OF THE
022124,000152:                                                                                                  #  LEM STATE VECTOR TO PRESENT TIME OR TO PIPTIME IF AV G
022125,000153:                                                                                                  #  IS ON AND SAVES AS BASE VECTOR. IF AV G IS ON RN + VN
022126,000154:                                                                                                  #  ARE USED AS THE CM STATE VECTOR AND THE INITIAL R RDOT
022127,000155:                                                                                                  #  RTHETA ARE COMPUTED WITH NO FURTHER INTEGRATION. IF AV
022128,000156:                                                                                                  #  G IS OFF A PRECISION EXTRAPOLATION IS MADE OF THE CM
022129,000157:                                                                                                  #  STATE VECTOR TO PRESENT TIME AND.....
022130,000158: 
022131,000159:                                                                                                  #    THE CM + LM STATE VECTORS ARE INTEGRATED TO PRES TIME
022132,000160:                                                                                                  #    USING PRECISION OR CONIC AS SURFFLAG IS SET OR CLEAR.
022133,000161: 
022134,000162:                                                                                                  #    IF AV G IS ON THEN SUBSEQUENT PASSES WILL PROVIDE
022135,000163:                                                                                                  #      USE OF RN + VN AS CM STATE VECTOR AND THE LM STATE
022136,000164:                                                                                                  #      VECTOR WILL BE PRECISION INTEGRATED USING LEMPREC
022137,000165: 
022138,000166:                                                                                                  #    IF SURFFLAG IS SET.
022139,000167:                                                                                                  #      CM STATE VECTOR RONE VONE + LM STATE VECTOR RATT
022140,000168:                                                                                                  #      VATT ARE USED IN COMPUTING R RDOT RTHETA.
022141,000169: 
022142,000170: 
022143,000171: 31,2140           43034        STATEXTP           RTB      BOF                                   #  INITIAL INTEGRATION
022144,000172: 31,2141           45510                                    LOADTIME                              
022145,000173: 31,2142           03751                                    V37FLAG                               
022146,000174: 31,2143           62146                                    +3                                    #  AV G OFF, USE PRES TIME
022147,000175: 31,2144           77624                           CALL                                           
022148,000176: 31,2145           62273                                    GETRVN                                #       ON,  USE RN VN PIPTIME
022149,000177: 31,2146           02343                           STORE    BASETIME                              #  PRES TIME OR PIPTIME
022150,000178: 31,2147           34041                           STCALL   TDEC1                                 
022151,000179: 31,2150           27105                                    LEMPREC                               
022152,000180: 31,2151           77775                           VLOAD                                          #  BASE VECTOR, LM
022153,000181: 31,2152           00017                                    RATT1                                 
022154,000182: 31,2153           26225                           STOVL    BASEOTP                               #    POS.
022155,000183: 31,2154           00025                                    VATT1                                 
022156,000184: 31,2155           02241                           STORE    BASEOTV                               #    VEL.
022157,000185: 31,2156           71214                           BON      DLOAD                                 
022158,000186: 31,2157           03711                                    V37FLAG                               
022159,000187: 31,2160           62035                                    COMPDISP                              #  COMPUTE R RDOT RTHETA FROM
022160,000188:                                                                                                  #  RONE(RN) VONE(VN) RATT+VATT(LEMPREC)
022161,000189: 31,2161           00015                                    TAT                                   
022162,000190: 31,2162           34041                           STCALL   TDEC1                                 
022163,000191: 31,2163           27071                                    CSMPREC                               
022164,000192: 31,2164           77775                           VLOAD                                          #  BASE VECTOR, CM
022165,000193: 31,2165           00017                                    RATT1                                 
022166,000194: 31,2166           26255                           STOVL    BASETHP                               #   POS.
022167,000195: 31,2167           00025                                    VATT1                                 
022168,000196: 31,2170           02263                           STORE    BASETHV                               #   VEL.
022169,000197: 31,2171           47014        HAVEBASE           BON      RTB                                   #  SUBSEQUENT INTEGRATIONS
022170,000198: 31,2172           03711                                    V37FLAG                               
022171,000199: 31,2173           62256                                    GETRVN5                               
022172,000200: 31,2174           45510                                    LOADTIME                              
022173,000201: 31,2175           34041                           STCALL   TDEC1                                 #  AV G OFF. SET INTEG. OF CM
022174,000202: 31,2176           27442                                    INTSTALL                              
022175,000203: 31,2177           43175                           VLOAD    CLEAR                                 
022176,000204: 31,2200           02255                                    BASETHP                               

Page 509

022178,000206: 31,2201           00263                                    MOONFLAG                              
022179,000207: 31,2202           25535                           STOVL    RCV                                   
022180,000208: 31,2203           02263                                    BASETHV                               
022181,000209: 31,2204           15543                           STODL    VCV                                   
022182,000210: 31,2205           02343                                    BASETIME                              
022183,000211: 31,2206           43014                           BOF      SET                                   #  GET APPROPRIATE MOONFLAG SETTING
022184,000212: 31,2207           04343                                    MOONTHIS                              
022185,000213: 31,2210           62212                                    +2                                    
022186,000214: 31,2211           00063                                    MOONFLAG                              
022187,000215: 31,2212           77614                           CLEAR                                          
022188,000216: 31,2213           01673                                    INTYPFLG                              
022189,000217: 31,2214           43014                           BON      SET                                   
022190,000218: 31,2215           04307                                    SURFFLAG                              
022191,000219: 31,2216           62220                                    +2                                    #  PREC. IF LM DOWN
022192,000220: 31,2217           01473                                    INTYPFLG                              #  CONIC IF LM NOT DOWN
022193,000221: 31,2220           35517                           STCALL   TET                                   
022194,000222: 31,2221           27135                                    INTEGRVS                              #  INTEGRATION --- AT LAST---
022195,000223: 31,2222           77775                           VLOAD                                          
022196,000224: 31,2223           00001                                    RATT                                  
022197,000225: 31,2224           26327                           STOVL    RONE                                  
022198,000226: 31,2225           00007                                    VATT                                  
022199,000227: 31,2226           16335                           STODL    VONE                                  #  GET SET FOR CONIC EXTRAP.,OTHER
022200,000228: 31,2227           00015                                    TAT                                   
022201,000229: 31,2230           45014                           BON      CALL                                  
022202,000230: 31,2231           04307                                    SURFFLAG                              
022203,000231: 31,2232           62267                                    GETRVN6                               #  LEMPREC IF LM DOWN
022204,000232: 31,2233           27442                                    INTSTALL                              #  ..CONIC IF NOT DOWN
022205,000233: 31,2234           77614                           SET                                            
022206,000234: 31,2235           01473                                    INTYPFLG                              
022207,000235: 31,2236           00041        OTHINT             STORE    TDEC1                                 #  ENTERED IF AV G ON TO INTEG LM
022208,000236: 31,2237           43175                           VLOAD    CLEAR                                 
022209,000237: 31,2240           02225                                    BASEOTP                               
022210,000238: 31,2241           00263                                    MOONFLAG                              
022211,000239: 31,2242           25535                           STOVL    RCV                                   
022212,000240: 31,2243           02241                                    BASEOTV                               
022213,000241: 31,2244           15543                           STODL    VCV                                   
022214,000242: 31,2245           02343                                    BASETIME                              
022215,000243: 31,2246           43014                           BOF      SET                                   
022216,000244: 31,2247           04343                                    MOONTHIS                              
022217,000245: 31,2250           62252                                    +2                                    
022218,000246: 31,2251           00063                                    MOONFLAG                              
022219,000247: 31,2252           35517                           STCALL   TET                                   
022220,000248: 31,2253           27135                                    INTEGRVS                              
022221,000249: 31,2254           77650                           GOTO                                           
022222,000250: 31,2255           62035                                    COMPDISP                              #  COMPUTE R RDOT RTHETA         
022223,000251: 31,2256           77624        GETRVN5            CALL                                           #  AV G ON
022224,000252: 31,2257           62273                                    GETRVN                                
022225,000253: 31,2260           45014                           BON      CALL                                  
022226,000254: 31,2261           04307                                    SURFFLAG                              
022227,000255: 31,2262           62267                                    GETRVN6                               #  LM DOWN, LMPREC

Page 510

022229,000257: 31,2263           27442                                    INTSTALL                              
022230,000258: 31,2264           52014                           CLEAR    GOTO                                  
022231,000259: 31,2265           01673                                    INTYPFLG                              
022232,000260: 31,2266           62236                                    OTHINT                                
022233,000261: 31,2267           34041        GETRVN6            STCALL   TDEC1                                 
022234,000262: 31,2270           27105                                    LEMPREC                               
022235,000263: 31,2271           77650                           GOTO                                           
022236,000264: 31,2272           62035                                    COMPDISP                              #  COMPUTE R RDOT RTHETA
022237,000265: 31,2273           77620        GETRVN             STQ                                            
022238,000266: 31,2274           00000                                    0D                                    
022239,000267: 31,2275           52175                           VLOAD    GOTO                                  #  AV G ON, RONE = RN VONE = VN
022240,000268: 31,2276           01171                                    RN                                    #   AND USE PIPTIME
022241,000269: 31,2277           62300                                    +1                                    
022242,000270: 31,2300           36327                           STCALL   RONE                                  
022243,000271: 31,2301           62302                                    +1                                    
022244,000272: 31,2302           52175                           VLOAD    GOTO                                  
022245,000273: 31,2303           01177                                    VN                                    
022246,000274: 31,2304           62305                                    +1                                    
022247,000275: 31,2305           16335                           STODL    VONE                                  
022248,000276: 31,2306           01205                                    PIPTIME                               
022249,000277: 31,2307           77650                           GOTO                                           
022250,000278: 31,2310           00000                                    0D                                    
022251,000279: 31,2000                                           SETLOC   R34                                   
022252,000280: 31,2000                                           BANK                                           
022253,000281: 31,2311           77776        R34LOS             EXIT                                           
022254,000282: 31,2312           30036                           CA       CDUS                                  
022255,000283: 31,2313           50120                           INDEX    FIXLOC                                
022256,000284: 31,2314           54011                           TS       9D                                    
022257,000285: 31,2315           30035                           CA       CDUT                                  
022258,000286: 31,2316           50120                           INDEX    FIXLOC                                
022259,000287: 31,2317           54013                           TS       11D                                   
022260,000288: 31,2320           30120                           CA       FIXLOC                                
022261,000289: 31,2321           66211                           AD       SIX                                   
022262,000290: 31,2322           40000                           COM                                            
022263,000291: 31,2323           50120                           INDEX    FIXLOC                                
022264,000292: 31,2324           54046                           TS       X1                                    
022265,000293: 31,2325           06006                           TC       INTPRET                               
022266,000294: 31,2326           77624                           CALL                                           
022267,000295: 31,2327           46000                                    SXTNB                                 
022268,000296: 31,2330           34015                           STCALL   12D                                   
022269,000297: 31,2331           62060                                    R34ANG                                

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