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.

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

Page 945

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

Page 946

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

Page 947

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

Page 948

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

Page 949

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

Page 950 This page is empty.

042464,000278: 
042465,000279: 

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