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.

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

Page 414

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

Page 415

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

Page 416

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

Page 417

018357,000188: 20,2145           35041                           CAF      1SEC                                  #  INCREMENT TIME FOR NEXT UPDATE
018358,000189: 20,2146           27671                           ADS      NEXTIME                               
018359,000190: 20,2147           15217                           TCF      ENDOFJOB                              
018360,000191: 
018361,000192: 
018362,000193: 20,2150           37663        UPDTCALL           CAF      PRIO26                                #  CALL FOR UPDATE
018363,000194: 20,2151           05147                           TC       FINDVAC                               #  OF STEERING COMMANDS
018364,000195: 20,2152  E6,1661                                  EBANK=   BCDU                                  
018365,000196: 20,2152           03026 44066                     2CADR    NEWDELHI                              
018366,000197: 
018367,000198: 20,2154           05324                           TC       TASKOVER                              
018368,000199: 

Page 418

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

Page 419

018422,000253: 20,2155           30032        ZEROEROR           CA       CDUX                                  #  PICK UP CDU ANGLES AND STORE IN
018423,000254: 20,2156           55646                           TS       CDUXD                                 #  CDU DESIRED
018424,000255: 20,2157           30033                           CA       CDUY                                  
018425,000256: 20,2160           55650                           TS       CDUYD                                 
018426,000257: 20,2161           30034                           CA       CDUZ                                  
018427,000258: 20,2162           55652                           TS       CDUZD                                 
018428,000259: 20,2163           00002                           TC       Q                                     
018429,000260: 
018430,000261: 22,2000                                           SETLOC   KALCMON1                              
018431,000262: 22,2000                                           BANK                                           
018432,000263: 
018433,000264: 22,3142           31155        LOADCDUD           CA       CPHI                                  #  STORE TERMINAL ANGLES INTO
018434,000265: 22,3143           55646                           TS       CDUXD                                 #  COMMAND ANGLES
018435,000266: 22,3144           31156        LOADYZ             CA       CTHETA                                
018436,000267: 22,3145           55650                           TS       CDUYD                                 
018437,000268: 22,3146           31157                           CA       CPSI                                  
018438,000269: 22,3147           55652                           TS       CDUZD                                 
018439,000270: 22,3150           00002                           TC       Q                                     

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