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.

018162,000002:                                                                                                  ## Copyright:   Public domain.
018163,000003:                                                                                                  ## Filename:    KALCMANU_STEERING.agc
018164,000004:                                                                                                  ## Purpose:     Part of the source code for Comanche, build 055.
018165,000005:                                                                                                  ##              It is part of the source code for the Command Module's (CM)
018166,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), Apollo 11.
018167,000007:                                                                                                  ## Assembler:   yaYUL
018168,000008:                                                                                                  ## Reference:   pp. 414-419
018169,000009:                                                                                                  ## Contact:     Onno Hommes <ohommes@cmu.edu>.
018170,000010:                                                                                                  ## Website:     www.ibiblio.org/apollo.
018171,000011:                                                                                                  ## Mod history: 05/07/09 OH     Transcription Batch 1 Assignment 
018172,000012:                                                                                                  ##              2016-12-10 RSB  Proofed comments with octopus/ProoferComments
018173,000013:                                                                                                  ##                              and fixed the errors found.
018174,000014:                                                                                                  ##              2017-01-28 RSB  WTIH -> WITH.
018175,000015:                                                                                                  ##
018176,000016:                                                                                                  ## The contents of the "Comanche055" files, in general, are transcribed 
018177,000017:                                                                                                  ## from scanned documents. 
018178,000018:                                                                                                  ##
018179,000019:                                                                                                  ##      Assemble revision 055 of AGC program Comanche by NASA
018180,000020:                                                                                                  ##      2021113-051.  April 1, 1969.  
018181,000021:                                                                                                  ##
018182,000022:                                                                                                  ##      This AGC program shall also be referred to as Colossus 2A
018183,000023:                                                                                                  ##
018184,000024:                                                                                                  ##      Prepared by
018185,000025:                                                                                                  ##                      Massachusetts Institute of Technology
018186,000026:                                                                                                  ##                      75 Cambridge Parkway
018187,000027:                                                                                                  ##                      Cambridge, Massachusetts
018188,000028:                                                                                                  ##
018189,000029:                                                                                                  ##      under NASA contract NAS 9-4065.
018190,000030:                                                                                                  ##
018191,000031:                                                                                                  ## Refer directly to the online document mentioned above for further information.
018192,000032:                                                                                                  ## Please report any errors to info@sandroid.org.
018193,000033: 

Page 414

018195,000035:                                                                                                  #  GENERATION OF STEERING COMMANDS FOR DIGITAL AUTOPILOT FREE FALL MANEUVERS
018196,000036: 
018197,000037:                                                                                                  #  NEW COMMANDS WILL BE GENERATED EVERY ONE SECOND DURING THE MANEUVER
018198,000038: 
018199,000039: 15,2000                                           BANK     15                                    
018200,000040: 
018201,000041: 22,2000                                           SETLOC   KALCMON1                              
018202,000042: 22,2000                                           BANK                                           
018203,000043: 
018204,000044: 22,3026  E6,1661                                  EBANK=   BCDU                                  
018205,000045: 
018206,000046: 22,3026                                           COUNT    22/KALC                               
018207,000047: 
018208,000048: 22,3026           41332        NEWDELHI           CS       HOLDFLAG                              #  SEE IF MANEUVER HAS BEEN INTERRUPTED
018209,000049: 22,3027           00006                           EXTEND                                         #  BY ASTRONAUT
018210,000050: 22,3030           62726                           BZMF     NOGO       -2                         #  IF SO, TERMINATE KALCMANU
018211,000051: 22,3031           06006        NEWANGL            TC       INTPRET                               
018212,000052: 22,3032           75160                           AXC,1    AXC,2                                 
018213,000053: 22,3033           03320                                    MIS                                   #  COMPUTE THE NEW MATRIX FROM S/C TO
018214,000054: 22,3034           03425                                    DEL                                   #  STABLE MEMBER AXES
018215,000055: 22,3035           77624                           CALL                                           
018216,000056: 22,3036           44304                                    MXM3                                  
018217,000057: 22,3037           45575                           VLOAD    STADR                                 
018218,000058: 22,3040           50442                           STOVL    MIS        +12D                       #  CALCULATE NEW DESIRED CDU ANGLES
018219,000059: 22,3041           77626                           STADR                                          
018220,000060: 22,3042           50450                           STOVL    MIS        +6D                        
018221,000061: 22,3043           77626                           STADR                                          
018222,000062: 22,3044           74456                           STORE    MIS                                   
018223,000063: 22,3045           45160                           AXC,1    CALL                                  
018224,000064: 22,3046           03320                                    MIS                                   
018225,000065: 22,3047           44655                                    DCMTOCDU                              #  PICK UP THE NEW CDU ANGLES FROM MATRIX
018226,000066: 22,3050           77634                           RTB                                            
018227,000067: 22,3051           45552                                    V1STO2S                               
018228,000068: 22,3052           03267                           STORE    NCDU                                  #  NEW CDU ANGLES
018229,000069: 22,3053           77414                           BONCLR   EXIT                                  
018230,000070: 22,3054           01215                                    CALCMAN2                              
018231,000071: 22,3055           40065                                    MANUSTAT                              #  TO START MANEUVER
018232,000072: 22,3056           35016                           CAF      TWO                                   #           +0 OTHERWISE
018233,000073: 22,3057           55664        INCRDCDU           TS       KSPNDX                                
018234,000074: 22,3060           60000                           DOUBLE                                         
018235,000075: 22,3061           55665                           TS       KDPNDX                                
018236,000076: 22,3062           51664                           INDEX    KSPNDX                                
018237,000077: 22,3063           31666                           CA       NCDU                                  #  NEW DESIRED CDU ANGLES
018238,000078: 22,3064           00006                           EXTEND                                         
018239,000079: 22,3065           51664                           INDEX    KSPNDX                                
018240,000080: 22,3066           21661                           MSU      BCDU                                  #  INITIAL S/C ANGLE OR PREVIOUS DESIRED
018241,000081: 22,3067           00006                           EXTEND                                         #  CDU ANGLES
018242,000082: 22,3070           73002                           MP       QUADROT                               
018243,000083: 22,3071           51665                           INDEX    KDPNDX                                
018244,000084: 22,3072           53576                           DXCH     DELCDUX                               #  ANGLE INCREMENTS TO BE ADDED TO

Page 415

018246,000086: 22,3073           51664                           INDEX    KSPNDX                                #  DCDU EVERY TENTH SEC
018247,000087: 22,3074           31666                           CA       NCDU                                  #  BY LEM DAP
018248,000088: 22,3075           51664                           INDEX    KSPNDX                                
018249,000089: 22,3076           57661                           XCH      BCDU                                  
018250,000090: 22,3077           51665                           INDEX    KDPNDX                                
018251,000091: 22,3100           55646                           TS       CDUXD                                 
018252,000092: 22,3101           11664                           CCS      KSPNDX                                
018253,000093: 22,3102           13057                           TCF      INCRDCDU                              #  LOOP FOR THREE AXES
018254,000094: 
018255,000095: 22,3103           00003                           RELINT                                         
018256,000096:                                                                                                  #  COMPARE PRESENT TIME WITH TIME TO TERMINATE MANEUVER
018257,000097: 
018258,000098: 22,3104           03115        TMANUCHK           TC       TIMECHK                               
018259,000099: 22,3105           04701                           TC       POSTJUMP                              
018260,000100: 22,3106           40131                           CADR     CONTMANU                              
018261,000101: 
018262,000102: 22,3107           35017                           CAF      ONE                                   
018263,000103: 22,3110           05245        MANUSTAL           TC       WAITLIST                              
018264,000104: 22,3111  E6,1661                                  EBANK=   BCDU                                  
018265,000105: 22,3111           02000 42066                     2CADR    MANUSTOP                              
018266,000106: 
018267,000107: 22,3113           00003                           RELINT                                         
018268,000108: 22,3114           15217                           TCF      ENDOFJOB                              
018269,000109: 
018270,000110: 
018271,000111: 22,3115           00006        TIMECHK            EXTEND                                         
018272,000112: 22,3116           40025                           DCS      TIME2                                 
018273,000113: 22,3117           53673                           DXCH     TTEMP                                 
018274,000114: 22,3120           00006                           EXTEND                                         
018275,000115: 22,3121           31717                           DCA      TM                                    
018276,000116: 22,3122           21673                           DAS      TTEMP                                 
018277,000117: 22,3123           11672                           CCS      TTEMP                                 
018278,000118: 22,3124           00002                           TC       Q                                     
018279,000119: 22,3125           13127                           TCF      +2                                    
018280,000120: 22,3126           13137                           TCF      2NDRETRN                              
018281,000121: 22,3127           11673                           CCS      TTEMP      +1                         
018282,000122: 22,3130           00002                           TC       Q                                     
018283,000123: 22,3131           13133                           TCF      MANUOFF                               
018284,000124: 22,3132           40000                           COM                                            
018285,000125: 22,3133           65041        MANUOFF            AD       1SEC                                  
018286,000126: 22,3134           00006                           EXTEND                                         
018287,000127: 22,3135           63137                           BZMF     2NDRETRN                              
018288,000128: 22,3136           24002                           INCR     Q                                     
018289,000129: 22,3137           24002        2NDRETRN           INCR     Q                                     
018290,000130: 22,3140           24002                           INCR     Q                                     
018291,000131: 22,3141           00002                           TC       Q                                     
018292,000132: 
018293,000133: 20,2000                                           SETLOC   MANUSTUF                              
018294,000134: 20,2000                                           BANK                                           

Page 416

018296,000136: 20,2065           77776        MANUSTAT           EXIT                                           #  INITIALIZATION ROUTINE
018297,000137: 20,2066           00006                           EXTEND                                         #  FOR AUTOMATIC MANEUVERS
018298,000138: 20,2067           30025                           DCA      TIME2                                 
018299,000139: 20,2070           21717                           DAS      TM                                    #  TM+T0    MANEUVER COMPLETION TIME
018300,000140: 20,2071           45041                           CS       1SEC                                  
018301,000141: 20,2072           54001                           TS       L                                     
018302,000142: 20,2073           45021                           CS       ZERO                                  
018303,000143: 20,2074           21717                           DAS      TM                                    #  (TM+T0)-1
018304,000144: 20,2075           00004                           INHINT                                         
018305,000145: 20,2076           45017                           CS       ONE                                   #  ENABLE AUTOPILOT TO PERFORM
018306,000146: 20,2077           55332                           TS       HOLDFLAG                              #  AUTOMATIC MANEUVERS
018307,000147: 20,2100           41130                           CS       RATEINDX                              #  SEE IF MANEUVERING AT HIGH RATE
018308,000148: 20,2101           66211                           AD       SIX                                   
018309,000149: 20,2102           00006                           EXTEND                                         
018310,000150: 20,2103           62105                           BZMF     HIGHGAIN                              
018311,000151: 20,2104           12110                           TCF      +4                                    
018312,000152: 20,2105           41501        HIGHGAIN           CS       RCSFLAGS                              #  IF SO, SET HIGH RATE FLAG (BIT 15 OF
018313,000153: 20,2106           75001                           MASK     BIT15                                 #  RCSFLAGS)
018314,000154: 20,2107           27501                           ADS      RCSFLAGS                              
018315,000155: 20,2110           53711                           DXCH     BRATE                                 #  X-AXIS MANEUVER RATE
018316,000156: 20,2111           53526                           DXCH     WBODY                                 
018317,000157: 20,2112           53713                           DXCH     BRATE      +2                         #  Y-AXIS MANEUVER RATE
018318,000158: 20,2113           53530                           DXCH     WBODY1                                
018319,000159: 20,2114           53715                           DXCH     BRATE      +4                         #  Z-AXIS MANEUVER RATE
018320,000160: 20,2115           53532                           DXCH     WBODY2                                
018321,000161: 20,2116           31675                           CA       BIASTEMP   +1                         #  INSERT ATTITUDE ERROR BIASES
018322,000162: 20,2117           55564                           TS       BIAS                                  #  INTO AUTOPILOT
018323,000163: 20,2120           31677                           CA       BIASTEMP   +3                         
018324,000164: 20,2121           55565                           TS       BIAS1                                 
018325,000165: 20,2122           31701                           CA       BIASTEMP   +5                         
018326,000166: 20,2123           55566                           TS       BIAS2                                 
018327,000167: 20,2124           30025                           CA       TIME1                                 
018328,000168: 20,2125           65041                           AD       1SEC                                  
018329,000169: 20,2126           57671                           XCH      NEXTIME                               
018330,000170: 20,2127           04701                           TC       POSTJUMP                              
018331,000171: 20,2130           45056                           CADR     INCRDCDU   -1                         
018332,000172: 
018333,000173: 20,2131           00004        CONTMANU           INHINT                                         #  CONTINUE WITH UPDATE PROCESS
018334,000174: 20,2132           40025                           CS       TIME1                                 
018335,000175: 20,2133           61671                           AD       NEXTIME                               
018336,000176: 20,2134           10000                           CCS      A                                     
018337,000177: 20,2135           65017                           AD       ONE                                   
018338,000178: 20,2136           12141                           TCF      MANUCALL                              
018339,000179: 20,2137           65001                           AD       NEGMAX                                
018340,000180: 20,2140           40000                           COM                                            
018341,000181: 20,2141           05245        MANUCALL           TC       WAITLIST                              
018342,000182: 20,2142  E6,1661                                  EBANK=   BCDU                                  
018343,000183: 20,2142           02150 40066                     2CADR    UPDTCALL                              
018344,000184: 
018345,000185: 20,2144           00003                           RELINT                                         

Page 417

018347,000187: 20,2145           35041                           CAF      1SEC                                  #  INCREMENT TIME FOR NEXT UPDATE
018348,000188: 20,2146           27671                           ADS      NEXTIME                               
018349,000189: 20,2147           15217                           TCF      ENDOFJOB                              
018350,000190: 
018351,000191: 
018352,000192: 20,2150           37663        UPDTCALL           CAF      PRIO26                                #  CALL FOR UPDATE
018353,000193: 20,2151           05147                           TC       FINDVAC                               #  OF STEERING COMMANDS
018354,000194: 20,2152  E6,1661                                  EBANK=   BCDU                                  
018355,000195: 20,2152           03026 44066                     2CADR    NEWDELHI                              
018356,000196: 
018357,000197: 20,2154           05324                           TC       TASKOVER                              
018358,000198: 

Page 418

018360,000200:                                                                                                  #  ROUTINE FOR TERMINATING AUTOMATIC MANEUVERS
018361,000201: 
018362,000202: 21,2000                                           SETLOC   KALCMON3                              
018363,000203: 21,2000                                           BANK                                           
018364,000204: 
018365,000205: 21,2000           04537        MANUSTOP           TC       STOPYZ                                
018366,000206: 21,2001           04740                           TC       IBNKCALL                              
018367,000207: 21,2002           45144                           CADR     LOADYZ                                
018368,000208: 
018369,000209: 21,2003           31155        ENDROLL            CA       CPHI                                  
018370,000210: 21,2004           55646                           TS       CDUXD                                 #  SET CDUXD TO THE COMMANDED OUTER GIMBAL
018371,000211: 21,2005           04526                           TC       STOPRATE                              
018372,000212: 21,2006           31327        ENDMANU            CA       ATTPRIO                               #  RESTORE USERS PRIORITY
018373,000213: 21,2007           54063                           TS       NEWPRIO                               
018374,000214: 
018375,000215: 21,2010           35021                           CA       ZERO                                  #  ZERO ATTCADR
018376,000216: 21,2011           53326                           DXCH     ATTCADR                               
018377,000217: 
018378,000218: 21,2012           05160                           TC       SPVAC                                 #  RETURN TO USER OF GOMANUR
018379,000219: 
018380,000220: 21,2013           05324                           TC       TASKOVER                              
018381,000221: 
018382,000222:    4000                                           SETLOC   STOPRAT                               
018383,000223:    4000                                           BANK                                           
018384,000224:    4526           35021        STOPRATE           CAF      ZERO                                  
018385,000225:    4527           55575                           TS       DELCDUX                               
018386,000226:    4530           55576                           TS       DELCDUX    +1                         #  ZERO ROLL INCREMENTAL ANGLES
018387,000227:    4531           55525                           TS       WBODY                                 #  RATE
018388,000228:    4532           55526                           TS       WBODY      +1                         
018389,000229:    4533           55564                           TS       BIAS                                  #  BIAS
018390,000230: 
018391,000231:    4534           45001                           CS       BIT15                                 #  MAKE SURE HIGH RATE FLAG (BIT 15 OF
018392,000232:    4535           71501                           MASK     RCSFLAGS                              #  RCSFLAGS) IS RESET.
018393,000233:    4536           55501                           TS       RCSFLAGS                              
018394,000234: 
018395,000235:    4537           35021        STOPYZ             CAF      ZERO                                  
018396,000236:    4540           55577                           TS       DELCDUY                               #  ZERO PITCH, YAW
018397,000237:    4541           55600                           TS       DELCDUY    +1                         #  INCREMENTAL ANGLES
018398,000238:    4542           55601                           TS       DELCDUZ                               
018399,000239:    4543           55602                           TS       DELCDUZ    +1                         
018400,000240:    4544           55527                           TS       WBODY1                                #  RATES
018401,000241:    4545           55530                           TS       WBODY1     +1                         
018402,000242:    4546           55531                           TS       WBODY2                                
018403,000243:    4547           55532                           TS       WBODY2     +1                         
018404,000244:    4550           55565                           TS       BIAS1                                 #  BIASES
018405,000245:    4551           55566                           TS       BIAS2                                 
018406,000246:    4552           00002                           TC       Q                                     
018407,000247: 
018408,000248: 20,2000                                           SETLOC   MANUSTUF                              
018409,000249: 20,2000                                           BANK                                           
018410,000250: 

Page 419

018412,000252: 20,2155           30032        ZEROERROR           CA       CDUX                                  #  PICK UP CDU ANGLES AND STORE IN
018413,000253: 20,2156           55646                           TS       CDUXD                                 #  CDU DESIRED
018414,000254: 20,2157           30033                           CA       CDUY                                  
018415,000255: 20,2160           55650                           TS       CDUYD                                 
018416,000256: 20,2161           30034                           CA       CDUZ                                  
018417,000257: 20,2162           55652                           TS       CDUZD                                 
018418,000258: 20,2163           00002                           TC       Q                                     
018419,000259: 
018420,000260: 22,2000                                           SETLOC   KALCMON1                              
018421,000261: 22,2000                                           BANK                                           
018422,000262: 
018423,000263: 22,3142           31155        LOADCDUD           CA       CPHI                                  #  STORE TERMINAL ANGLES INTO
018424,000264: 22,3143           55646                           TS       CDUXD                                 #  COMMAND ANGLES
018425,000265: 22,3144           31156        LOADYZ             CA       CTHETA                                
018426,000266: 22,3145           55650                           TS       CDUYD                                 
018427,000267: 22,3146           31157                           CA       CPSI                                  
018428,000268: 22,3147           55652                           TS       CDUZD                                 
018429,000269: 22,3150           00002                           TC       Q                                     

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