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.

042173,000002:                                                                                                  ## Copyright:   Public domain.
042174,000003:                                                                                                  ## Filename:    TVCEXECUTIVE.agc
042175,000004:                                                                                                  ## Purpose:     Part of the source code for Colossus 2A, AKA Comanche 055.
042176,000005:                                                                                                  ##              It is part of the source code for the Command Module's (CM)
042177,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for Apollo 11.
042178,000007:                                                                                                  ## Assembler:   yaYUL
042179,000008:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
042180,000009:                                                                                                  ## Website:     www.ibiblio.org/apollo.
042181,000010:                                                                                                  ## Pages:       945-950
042182,000011:                                                                                                  ## Mod history: 2009-05-12 RSB  Adapted from the Colossus249/ file of the
042183,000012:                                                                                                  ##                              same name, using Comanche055 page images.
042184,000013:                                                                                                  ##              2009-05-20 RSB  Corrections:  CAE -> CAF in one place.
042185,000014:                                                                                                  ##              2009-05-21 RSB  In 1SHOTCHK, a CAF SEVEN was corrected to 
042186,000015:                                                                                                  ##                              CAF SIX.
042187,000016:                                                                                                  ##              2010-08-28 JL   Fixed indentation.
042188,000017:                                                                                                  ##              2011-05-08 JL   Flagged workaround.
042189,000018:                                                                                                  ##              2016-12-21 RSB  Proofed comment text using octopus/ProoferComments
042190,000019:                                                                                                  ##                              and corrected the errors found.
042191,000020:                                                                                                  ##              2017-01-20 RSB  Fixed comment-text errors noted while diff'ing
042192,000021:                                                                                                  ##                              vs Colossus 249.
042193,000022: 
042194,000023:                                                                                                  ## This source code has been transcribed or otherwise adapted from digitized
042195,000024:                                                                                                  ## images of a hardcopy from the MIT Museum.  The digitization was performed
042196,000025:                                                                                                  ## by Paul Fjeld, and arranged for by Deborah Douglas of the Museum.  Many
042197,000026:                                                                                                  ## thanks to both.  The images (with suitable reduction in storage size and
042198,000027:                                                                                                  ## consequent reduction in image quality as well) are available online at
042199,000028:                                                                                                  ## www.ibiblio.org/apollo.  If for some reason you find that the images are
042200,000029:                                                                                                  ## illegible, contact me at info@sandroid.org about getting access to the 
042201,000030:                                                                                                  ## (much) higher-quality images which Paul actually created.
042202,000031:                                                                                                  ##
042203,000032:                                                                                                  ## Notations on the hardcopy document read, in part:
042204,000033:                                                                                                  ##
042205,000034:                                                                                                  ##      Assemble revision 055 of AGC program Comanche by NASA
042206,000035:                                                                                                  ##      2021113-051.  10:28 APR. 1, 1969  
042207,000036:                                                                                                  ##
042208,000037:                                                                                                  ##      This AGC program shall also be referred to as
042209,000038:                                                                                                  ##                      Colossus 2A
042210,000039: 

Page 945

042212,000041:                                                                                                  #  PROGRAM NAME....      TVCEXECUTIVE, CONSISTING OF TVCEXEC, NEEDLEUP, VARGAINS
042213,000042:                                                                                                  #                        1SHOTCHK, REPCHEK, CG.CORR, COPYCYCLES, ETC.
042214,000043:                                                                                                  #  LOG SECTION...        TVCEXECUTIVE            SUBROUTINE...DAPCSM
042215,000044:                                                                                                  #  MODIFIED BY SCHLUNDT                          21 OCTOBER 1968
042216,000045: 
042217,000046:                                                                                                  #  FUNCTIONAL DESCRIPTION....
042218,000047:                                                                                                  #       *A SELF-PERPETUATING WAITLIST TASK AT 1/2 SECOND INTERVALS WHICH:
042219,000048:                                                                                                  #        PREPARES THE ROLL DAP WITH OGA (CDUX)
042220,000049:                                                                                                  #        PREPARES THE ROLL FDAI NEEDLE (FLY-TO  OGA ERROR)
042221,000050:                                                                                                  #        PREPARES THE ROLL PHASE PLANE  OGAERR  (FLY-FROM  OGA ERROR)
042222,000051:                                                                                                  #        PREPARES THE TVC ROLLDAP TASK WAITLIST CALL (3 CS DELAY)
042223,000052:                                                                                                  #        UPDATES THE NEEDLES DISPLAY
042224,000053:                                                                                                  #        UPDATES VEHICLE MASS AND CALLS MASSPROP TO UPDATE INERTIA DATA
042225,000054:                                                                                                  #        UPDATES PITCH, YAW, AND ROLL DAP GAINS FROM MASSPROP DATA
042226,000055:                                                                                                  #        PERFORMS ONE-SHOT CORRECTION FOR TMC LOOP 0-3 SEC AFTER IGNITION
042227,000056:                                                                                                  #        PERFORMS REPETITIVE UPDATES FOR TMC LOOP AFTER THE ONE-SHOT CORR.
042228,000057: 
042229,000058:                                                                                                  #  CALLING SEQUENCE....
042230,000059:                                                                                                  #       *TVCEXEC CALLED AS A WAITLIST TASK, IN PARTICULAR BY TVCINIT4 AND BY
042231,000060:                                                                                                  #        ITSELF, BOTH AT 1/2 SECOND INTERVALS
042232,000061: 
042233,000062:                                                                                                  #  NORMAL EXIT MODE.... TASKOVER
042234,000063: 
042235,000064:                                                                                                  #  ALARM OR ABORT EXIT MODES.... NONE
042236,000065: 
042237,000066:                                                                                                  #  SUBROUTINES CALLED....NEEDLER, S40.15, MASSPROP, TASKOVER, IBNKCALL
042238,000067: 
042239,000068:                                                                                                  #  OTHER INTERFACES....
042240,000069:                                                                                                  #       *TVCRESTART PACKAGE FOR RESTARTS
042241,000070:                                                                                                  #       *PITCHDAP, YAWDAP FOR VARIABLE GAINS AND ENGINE TRIM ANGLES
042242,000071: 
042243,000072:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED....
042244,000073:                                                                                                  #       *SEE TVCDAPON....TVCINIT4
042245,000074:                                                                                                  #       *VARK AND 1/CONACC (S40.15 OF TVCINITIALIZE)
042246,000075:                                                                                                  #       *PAD LOAD EREPFRAC
042247,000076:                                                                                                  #       *BITS 15,14 OF FLAGWRD6 (T5 BITS)
042248,000077:                                                                                                  #       *TVCEXPHS FOR RESTARTS
042249,000078:                                                                                                  #       *ENGINE-ON BIT (11.13) FOR RESTARTS
042250,000079:                                                                                                  #       *CDUX, OGAD
042251,000080: 
042252,000081:                                                                                                  #  OUTPUT....
042253,000082:                                                                                                  #       *ROLL DAP OGANOW, FDAI NEEDLE (AK). AND PHASE PLANE OGAERR
042254,000083:                                                                                                  #       *VARIABLE GAINS FOR PITCH/YAW AND ROLL TVC DAPS
042255,000084:                                                                                                  #       *SINGLE-SHOT AND REPETITIVE CORRECTIONS TO ENGINE TRIM ANGLES
042256,000085:                                                                                                  #        PACTOFF AND YACTOFF
042257,000086: 
042258,000087:                                                                                                  #  DEBRIS....    MUCH, BUT SHAREABLE WITH RCS/ENTRY, ALL IN EBANK6
042259,000088: 

Page 946

042261,000090: 16,2720                                           BANK     16                                    
042262,000091: 16,2000                                           SETLOC   DAPROLL                               
042263,000092: 16,2000                                           BANK                                           
042264,000093: 16,2720  E6,1702                                  EBANK=   BZERO                                 
042265,000094: 16,2720                                           COUNT*   $$/TVCX                               
042266,000095: 
042267,000096: 16,2720           40102        TVCEXEC            CS       FLAGWRD6                              #  CHECK FOR TERMINATION (BITS 15,14 READ
042268,000097: 16,2721           74105                           MASK     OCT60000                              #        10 FROM TVCDAPON TO RCSDAPON)
042269,000098: 16,2722           00006                           EXTEND                                         
042270,000099: 16,2723           63134                           BZMF     TVCEXFIN                              #  TERMINATE
042271,000100: 
042272,000101: 16,2724           35036                           CAF      .5SEC                                 #  W.L. CALL TO PERPETUATE TVCEXEC
042273,000102: 16,2725           05245                           TC       WAITLIST                              
042274,000103: 16,2726  E6,1702                                  EBANK=   BZERO                                 
042275,000104: 16,2726           02720 34066                     2CADR    TVCEXEC                               
042276,000105: 
042277,000106: 16,2730           30032        ROLLPREP           CAE      CDUX                                  #  UPDATE ROLL LADDERS (NO NEED TO RESTART-
042278,000107: 16,2731           57662                           XCH      OGANOW                                #        PROTECT, SINCE ROLL DAPS RE-START)
042279,000108: 16,2732           57663                           XCH      OGAPAST                               
042280,000109: 
042281,000110: 16,2733           31450                           CAE      OGAD                                  #  PREPARE ROLL FDAI NEEDLE WITH FLY-TO
042282,000111: 16,2734           00006                           EXTEND                                         #        ERROR (COMMAND - MEASURED)
042283,000112: 16,2735           21662                           MSU      OGANOW                                
042284,000113: 16,2736           55476                           TS       AK                                    #  FLY-TO OGA ERROR, SC.AT B-1 REVS
042285,000114: 
042286,000115: 16,2737           00006                           EXTEND                                         #  PREPARE ROLL DAP PHASE PLANE OGAERR
042287,000116: 16,2740           77705                           MP       -BIT14                                
042288,000117: 16,2741           55664                           TS       OGAERR                                #  PHASE-PLANE (FLY-FROM) OGAERROR,
042289,000118:                                                                                                  #        SC.AT B+0 REVS
042290,000119: 
042291,000120: 16,2742           36214                           CAF      THREE                                 #  SET UP ROLL DAP TASK (ALLOW SOME TIME)
042292,000121: 16,2743           05245                           TC       WAITLIST                              
042293,000122: 16,2744  E6,1702                                  EBANK=   BZERO                                 
042294,000123: 16,2744           03272 34066                     2CADR    ROLLDAP                               
042295,000124: 
042296,000125: 16,2746           04740        NEEDLEUP           TC       IBNKCALL                              #  DO A NEEDLES UPDATE (RETURNS AFTER CADR)
042297,000126: 16,2747           42420                           CADR     NEEDLER                               #        (NEEDLES RESTARTS ITSELF)
042298,000127: 
042299,000128: 16,2750           35003        VARGAINS           CAF      BIT13                                 #  CHECK ENGINE-ON BIT TO INHIBIT VARIABLE
042300,000129: 16,2751           00006                           EXTEND                                         #        GAINS AND MASS IF ENGINE OFF
042301,000130: 16,2752           02011                           RAND     DSALMOUT                              #  CHANNEL 11
042302,000131: 16,2753           10000                           CCS      A                                     
042303,000132: 16,2754           12760                           TCF      +4                                    #        ON, SO OK TO UPDATE GAINS AND MASS
042304,000133: 16,2755           35016                 +5        CAF      TWO                                   #        OFF, SO BYPASS MASS/GAIN UPDATES,
042305,000134: 16,2756           55651                           TS       TVCEXPHS                              #                ALSO ENTRY FROM CCS BELOW WITH
042306,000135: 16,2757           13011                           TCF      1SHOTCHK                              #                VCNTR = -0 (V97 R40 ENGFAIL)
042307,000136: 16,2760           11643                           CCS      VCNTR                                 #        TEST FOR GAIN UPDATE TIME
042308,000137: 16,2761           12765                           TCF      +4                                    #                NOT YET

Page 947

042310,000139: 16,2762           12771                           TCF      GAINCHNG                              #                NOW
042311,000140: 16,2763           12763                           TCF      +0                                    #                NOT USED
042312,000141: 16,2764           12755                           TCF      VARGAINS   +5                         #                NO, LOTHRUST (S40.8 R40)
042313,000142: 
042314,000143: 16,2765           55653                 +4        TS       VCNTRTMP                              #        PROTECT VCNTR AND
042315,000144: 16,2766           31474                           CAE      CSMMASS                               #        CSMMASS DURING AN IMPULSIVE BURN
042316,000145: 16,2767           55652                           TS       MASSTMP                               
042317,000146: 16,2770           13002                           TCF      EXECCOPY                              
042318,000147: 
042319,000148: 16,2771           04740        GAINCHNG           TC       IBNKCALL                              #  UPDATE IXX, IAVG, IAVG/TLX
042320,000149: 16,2772           13422                           CADR     FIXCW                                 #  MASSPROP ENTRY (ALREADY INITIALIZED)
042321,000150: 16,2773           04740                           TC       IBNKCALL                              #  UPDATE 1/CONACC, VARK
042322,000151: 16,2774           36462                           CADR     S40.15                                #        (S40.15 IS IN TVCINITIALIZE)
042323,000152: 16,2775           41637                           CS       TENMDOT                               #  UPDATE MASS FOR NEXT 10 SEC. OF BURN
042324,000153: 16,2776           61474                           AD       CSMMASS                               
042325,000154: 16,2777           55652                           TS       MASSTMP                               #  KG B+16
042326,000155: 
042327,000156: 16,3000           34374                           CAF      NINETEEN                              #  RESET THE VARIABLE-GAIN UPDATE COUNTER
042328,000157: 16,3001           55653                           TS       VCNTRTMP                              
042329,000158: 
042330,000159: 16,3002           25651        EXECCOPY           INCR     TVCEXPHS                              #  RESTART-PROTECT THE COPYCYCLE         (1)
042331,000160: 
042332,000161: 16,3003           31652                           CAE      MASSTMP                               #  CSMMASS KG B+16
042333,000162: 16,3004           55474                           TS       CSMMASS                               
042334,000163: 
042335,000164: 16,3005           31653                           CAE      VCNTRTMP                              #  VCNTR
042336,000165: 16,3006           55643                           TS       VCNTR                                 
042337,000166: 16,3007           55444                           TS       V97VCNTR                              #  FOR ENGFAIL (R41) MASS UPDATES AT SPSOFF
042338,000167: 
042339,000168: 16,3010           25651                           INCR     TVCEXPHS                              #  COPYCYCLE OVER                        (2)
042340,000169: 
042341,000170: 16,3011           11447        1SHOTCHK           CCS      CNTR                                  #  CHECK TIME FOR ONE-SHOT OR REPCORR
042342,000171: 16,3012           13016                           TCF      +4                                    #        NOT YET
042343,000172: 16,3013           13031                           TCF      1SHOTOK                               #        NOW
042344,000173: 16,3014           13022                           TCF      REPCHEK                               #        ONE-SHOT OVER, ON TO REPCORR
042345,000174: 16,3015           13031                           TCF      1SHOTOK                               #        NOW (ONE-SHOT ONLY, NO REPCORR)
042346,000175: 
042347,000176: 16,3016           55676                 +4        TS       CNTRTMP                               #  COUNT DOWN
042348,000177: 16,3017           36211                           CAF      SIX                                   #  SETUP TVCEXPHS FOR ENTRY AT CNTRCOPY
042349,000178: 16,3020           55651                           TS       TVCEXPHS                              
042350,000179: 16,3021           13132                           TCF      CNTRCOPY                              
042351,000180: 
042352,000181: 16,3022           31642        REPCHEK            CAE      REPFRAC                               #  CHECK FOR REPETITIVE UPDATES
042353,000182: 16,3023           00006                           EXTEND                                         
042354,000183: 16,3024           63134                           BZMF     TVCEXFIN                              #        NO,  OVER-AND-OUT
042355,000184: 16,3025           55446                           TS       TEMPDAP    +1                         #        YES, SET UP CORRECTION FRACTION
042356,000185: 16,3026           35015                           CAF      FOUR                                  #  SET UP TVCEXPHS FOR ENTRY AT CORSETUP
042357,000186: 16,3027           55651                           TS       TVCEXPHS                              
042358,000187: 16,3030           13043                           TCF      CORSETUP                              

Page 948

042360,000189: 16,3031           35003        1SHOTOK            CAF      BIT13                                 #  CHECK ENGINE-ON BIT, NOT PERMITTING
042361,000190: 16,3032           00006                           EXTEND                                         #        ONE-SHOT DURING ENGINE-SHUTDOWN
042362,000191: 16,3033           02011                           RAND     DSALMOUT                              
042363,000192: 16,3034           10000                           CCS      A                                     
042364,000193: 16,3035           13037                           TCF      +2                                    #        ONE-SHOT OK
042365,000194: 16,3036           13134                           TCF      TVCEXFIN                              #        NO, TERMINATE
042366,000195: 
042367,000196: 16,3037           25651                           INCR     TVCEXPHS                              #                                        (3)
042368,000197: 
042369,000198: 16,3040           33137        TEMPSET            CAF      FCORFRAC                              #        SET UP CORRECTION FRACTION
042370,000199: 16,3041           55446                           TS       TEMPDAP    +1                         
042371,000200: 
042372,000201: 16,3042           25651                           INCR     TVCEXPHS                              #  ENTRY FROM REPCHEK AT NEXT LOCATION   (4)
042373,000202: 
042374,000203: 16,3043           31466        CORSETUP           CAE      DAPDATR1                              #  CHECK FOR LEM-OFF/ON
042375,000204: 16,3044           75003                           MASK     BIT13                                 #  (NOTE, SHOWS LEM-OFF)
042376,000205: 16,3045           00006                           EXTEND                                         
042377,000206: 16,3046           13050                           BZF      +2                                    #  LEM IS ON,  PICK UP   TEMPDAP+1
042378,000207: 16,3047           31446                           CAE      TEMPDAP    +1                         #  LEM IS OFF, PICK UP 2(TEMPDAP+1)
042379,000208: 16,3050           61446                           AD       TEMPDAP    +1                         
042380,000209: 16,3051           55445                           TS       TEMPDAP                               #  CG.CORR USES TEMPDAP
042381,000210: 
042382,000211: 16,3052           37716                           CAF      NEGONE                                #  SET UP FOR CNTR = -1 (ONE-SHOT DONE)
042383,000212: 16,3053           55676                           TS       CNTRTMP                               #        (COPYCYCLE AT .CNTRCOPY.)
042384,000213: 
042385,000214: 16,3054           00006        CG.CORR            EXTEND                                         #  PITCH TMC LOOP
042386,000215: 16,3055           31606                           DCA      PDELOFF                               
042387,000216: 16,3056           53673                           DXCH     PACTTMP                               
042388,000217: 16,3057           00006                           EXTEND                                         
042389,000218: 16,3060           41606                           DCS      PDELOFF                               
042390,000219: 16,3061           20001                           DDOUBL                                         
042391,000220: 16,3062           20001                           DDOUBL                                         
042392,000221: 16,3063           53612                           DXCH     TTMP1                                 
042393,000222: 16,3064           00006                           EXTEND                                         
042394,000223: 16,3065           31602                           DCA      DELPBAR                               
042395,000224: 16,3066           20001                           DDOUBL                                         
042396,000225: 16,3067           20001                           DDOUBL                                         
042397,000226: 16,3070           21612                           DAS      TTMP1                                 
042398,000227: 16,3071           00006                           EXTEND                                         
042399,000228: 16,3072           31612                           DCA      TTMP1                                 
042400,000229: 16,3073           00006                           EXTEND                                         
042401,000230: 16,3074           71445                           MP       TEMPDAP                               
042402,000231: 16,3075           21673                           DAS      PACTTMP                               
042403,000232: 
042404,000233: 16,3076           00006                           EXTEND                                         #  YAW TMC LOOP
042405,000234: 16,3077           31610                           DCA      YDELOFF                               
042406,000235: 16,3100           53675                           DXCH     YACTTMP                               
042407,000236: 16,3101           00006                           EXTEND                                         
042408,000237: 16,3102           41610                           DCS      YDELOFF                               
042409,000238: 16,3103           20001                           DDOUBL                                         

Page 949

042411,000240: 16,3104           20001                           DDOUBL                                         
042412,000241: 16,3105           53612                           DXCH     TTMP1                                 
042413,000242: 16,3106           00006                           EXTEND                                         
042414,000243: 16,3107           31604                           DCA      DELYBAR                               
042415,000244: 16,3110           20001                           DDOUBL                                         
042416,000245: 16,3111           20001                           DDOUBL                                         
042417,000246: 16,3112           21612                           DAS      TTMP1                                 
042418,000247: 16,3113           00006                           EXTEND                                         
042419,000248: 16,3114           31612                           DCA      TTMP1                                 
042420,000249: 16,3115           00006                           EXTEND                                         
042421,000250: 16,3116           71445                           MP       TEMPDAP                               
042422,000251: 16,3117           21675                           DAS      YACTTMP                               
042423,000252: 
042424,000253: 16,3120           25651        CORCOPY            INCR     TVCEXPHS                              #  RESTART PROTECT THE COPYCYCLE         (5)
042425,000254: 
042426,000255: 16,3121           00006                           EXTEND                                         #  TRIM-ESTIMATES, AND
042427,000256: 16,3122           31673                           DCA      PACTTMP                               
042428,000257: 16,3123           55423                           TS       PACTOFF                               #        TRIMS
042429,000258: 16,3124           53606                           DXCH     PDELOFF                               
042430,000259: 
042431,000260: 16,3125           00006                           EXTEND                                         
042432,000261: 16,3126           31675                           DCA      YACTTMP                               
042433,000262: 16,3127           55424                           TS       YACTOFF                               
042434,000263: 16,3130           53610                           DXCH     YDELOFF                               
042435,000264: 
042436,000265: 16,3131           25651                           INCR     TVCEXPHS                              #  ENTRY FROM 1SHOTCHK AT NEXT LOCATION  (6)
042437,000266: 
042438,000267: 16,3132           31676        CNTRCOPY           CAE      CNTRTMP                               #  UPDATE CNTR (RESTARTS OK, FOLLOWS CPYCY)
042439,000268: 16,3133           55447                           TS       CNTR                                  
042440,000269: 
042441,000270: 16,3134           35021        TVCEXFIN           CAF      ZERO                                  #  RESET TVCEXPHS
042442,000271: 16,3135           55651                           TS       TVCEXPHS                              
042443,000272: 16,3136           15324                           TCF      TASKOVER                              #  TVCEXECUTIVE FINISHED
042444,000273: 
042445,000274: 16,3137           10000        FCORFRAC           OCT      10000                                 #  ONE-SHOT CORRECTION FRACTION  
042446,000275: 

Page 950 This page is empty.

042449,000278: 
042450,000279: 

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