Source Code

These source-code files were derived from scans of the Colossus 237 (Apollo 8 Command Module) program listing from the private collection of original AGC developer Fred Martin. Scanning was by Ron Burkey. Pre-existing Colossus 249 (Apollo 9 CM) source files were used as a template, and changes between Colossus 249 and Colossus 237 were manually transcribed by a team of volunteers. Note that the page images presented online are of reduced quality, and that additional 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 237 OF AGC PROGRAM COLOSSUS 
	BY NASA 2021111-031  1:17 AUG. 24, 1968
Note that the date is the date of the printout, not the date of the program revision.

038990,000002:                                                                                                  ## Copyright:   Public domain.
038991,000003:                                                                                                  ## Filename:    TVCINITIALIZE.agc
038992,000004:                                                                                                  ## Purpose:     Part of the source code for Colossus build 237.
038993,000005:                                                                                                  ##              This is for the Command Module's (CM) Apollo Guidance
038994,000006:                                                                                                  ##              Computer (AGC), for Apollo 8.
038995,000007:                                                                                                  ## Assembler:   yaYUL
038996,000008:                                                                                                  ## Contact:     Jim Lawton <jim DOT lawton AT gmail DOT com>
038997,000009:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
038998,000010:                                                                                                  ## Page Scans:  www.ibiblio.org/apollo/ScansForConversion/Colossus237/
038999,000011:                                                                                                  ## Mod history: 2011-03-06 JL   Adapted from corresponding Colossus 249 file.
039000,000012:                                                                                                  ##              2011-04-17 JL   Removed temporary line.
039001,000013:                                                                                                  ##              2017-01-01 RSB  Proofed comment text using octopus/ProoferComments,
039002,000014:                                                                                                  ##                              and fixed errors found.
039003,000015: 

Page 896

039005,000017:                                                                                                  #  NAME     TVCDAPON (TVC DAP INITIALIZATION AND STARTUP CALL)
039006,000018:                                                                                                  #  MOD NO 3                        DATE  8 JUNE,1967
039007,000019:                                                                                                  #  MOD BY ENGEL                    LOG SECTION P40-P47
039008,000020: 
039009,000021:                                                                                                  #  FUNCTIONAL DESCRIPTION
039010,000022:                                                                                                  #       PERFORMS TVCDAP INITIALIZATION (GAINS, TIMING PARAMETERS, FILTER VARIABLES, ETC.)
039011,000023:                                                                                                  #       COMPUTES STEERING (S40.8) GAIN KPRIMEDT, AND ZEROES PASTDELV,+1 VARIABLE
039012,000024:                                                                                                  #       MAKES INITIALIZATION CALL TO ..NEEDLER.. FOR TVC DAP NEEDLES-SETUP
039013,000025:                                                                                                  #       PERFORMS INITIALIZATION FOR ROLL DAP
039014,000026:                                                                                                  #       CALLS TVCEXECUTIVE AT TVCEXEC, VIA WAITLIST
039015,000027:                                                                                                  #       CALLS TVCDAP CDU-RATE INITIALIZATION PKG AT DAPINIT  VIA T5
039016,000028:                                                                                                  #       MRCLEAN AND TVCINIT4 ARE POSSIBLE TVC-RESTART ENTRIES
039017,000029:                                                                                                  #  CALLING SEQUENCE - T5LOC=2CADR(TVCDAPON,EBANK=BZERO), T5=.6SECT5
039018,000030:                                                                                                  #       IN PARTICULAR, CALLED BY ..IGNOVER..
039019,000031:                                                                                                  #  NORMAL EXIT MODE
039020,000032:                                                                                                  #       TCF RESUME
039021,000033:                                                                                                  #  SUBROUTINES CALLED
039022,000034:                                                                                                  #       NEEDLER, MASSPROP
039023,000035:                                                                                                  #  ALARM OR ABORT EXIT MODES
039024,000036:                                                                                                  #       NONE
039025,000037:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED
039026,000038:                                                                                                  #       CSMMASS, LEMMASS, DAPDATR1 (FOR MASSPROP SUBROUTINE)
039027,000039:                                                                                                  #       TVC PAD LOADS (SEE LEVEL III DAP AND/OR P40 TESTS)
039028,000040:                                                                                                  #       PACTOFF, YACTOFF, CDUX
039029,000041:                                                                                                  #       TVCPHASE, T5BITS OF FLAGWRD6, FOR RESTART PROTECTION (SEE IGNOVER)
039030,000042:                                                                                                  #  OUTPUT
039031,000043:                                                                                                  #       ALL TVC AND ROLL DAP ERASABLES, FLAGWRD6 (BITS 13,14), T5, WAITLIST
039032,000044:                                                                                                  #  DEBRIS
039033,000045:                                                                                                  #       NONE
039034,000046: 
039035,000047: 31,3766                                           COUNT*   $$/INIT                               
039036,000048: 17,2032                                           BANK     17                                    
039037,000049: 17,2000                                           SETLOC   DAPS7                                 
039038,000050: 17,2000                                           BANK                                           
039039,000051: 
039040,000052: 17,2032  E6,1742                                  EBANK=   BZERO                                 
039041,000053: 
039042,000054: 17,2032           22016        TVCDAPON           LXCH     BANKRUPT                              #  T5 RUPT ARRIVAL (CALL BY DOTVCON - P40)
039043,000055: 17,2033           00006                           EXTEND                                         #  SAVE Q REQUIRED IN RESTARTS (MRCLEAN AND
039044,000056: 17,2034           22012                           QXCH     QRUPT                                 #       TVCINIT4 ARE ENTRIES)
039045,000057: 17,2035           32207        MRCLEAN            CAF      NZERO                                 #  NUMBER TO ZERO, LESS ONE  (MUST BE ODD)
039046,000058:                                                                                                  #                                               TVC RESTARTS ENTER HERE  (NEW BANK)
039047,000059: 17,2036           10000                 +1        CCS      A                                     
039048,000060: 17,2037           55447                           TS       CNTR                                  
039049,000061: 17,2040           34714                           CAF      ZERO                                  
039050,000062: 17,2041           54001                           TS       L                                     
039051,000063: 17,2042           51447                           INDEX    CNTR                                  
039052,000064: 17,2043           53530                           DXCH     OMEGAYC                               #  FIRST (LAST) TWO LOCATIONS
039053,000065: 17,2044           11447                           CCS      CNTR                                  
039054,000066: 17,2045           12036                           TCF      MRCLEAN    +1                         

Page 897

039056,000068: 17,2046           00006                           EXTEND                                         #  SET UP ANOTHER T5 RUPT TO CONTINUE
039057,000069: 17,2047           32214                           DCA      INITLOC2                              #       INITIALIZATION AT TVCINIT1
039058,000070: 17,2050           53313                           DXCH     T5LOC                                 #  THE PHSCHK2 ENTRY (REDOTVC) AT TVCDAPON
039059,000071: 17,2051           34672                           CAF      POSMAX                                #       +3 IS IN ANOTHER BANK. MUST RESET
039060,000072: 17,2052           54030                           TS       TIME5                                 #       BBCON TOO (FULL 2CADR), FOR THAT
039061,000073: 17,2053           15222        ENDMRC             TCF      RESUME                                #       ENTRY.
039062,000074: 
039063,000075: 17,2054           22016        TVCINIT1           LXCH     BANKRUPT                              
039064,000076: 17,2055           00006                           EXTEND                                         
039065,000077: 17,2056           22012                           QXCH     QRUPT                                 
039066,000078: 
039067,000079: 17,2057           04633                           TC       IBNKCALL                              #  UPDATE IXX, IAVG/TLX FOR DAP GAINS (R03
039068,000080: 17,2060           13176                           CADR     MASSPROP                              #       OR NOUNS 46 AND 47 MUST BE CORRECT)
039069,000081: 
039070,000082: 17,2061           32030                           CAF      MDOTLO                                #  SPS FLOW RATE, SC.AT B+3 KG/CS
039071,000083: 17,2062           00006                           EXTEND                                         
039072,000084: 17,2063           72210                           MP       ONETHOU                               
039073,000085: 17,2064           55647                           TS       TENMDOT                               #  10-SEC MASS LOSS B+16 KG
039074,000086: 17,2065           40000                           COM                                            
039075,000087: 17,2066           61474                           AD       CSMMASS                               
039076,000088: 17,2067           55662                           TS       MASSTMP                               #  DECREMENT FOR FIRST 10 SEC OF BURN
039077,000089: 
039078,000090: 17,2070           31466                           CAE      DAPDATR1                              #  CHECK LEM-ON/OFF
039079,000091: 17,2071           74675                           MASK     BIT14                                 
039080,000092: 17,2072           10000                           CCS      A                                     
039081,000093: 17,2073           34712                           CAF      BIT1                                  #  LEM-ON (BIT1)
039082,000094: 17,2074           55447                           TS       CNTR                                  #  LEM-OFF (ZERO)
039083,000095: 
039084,000096: 17,2075           51447                           INDEX    CNTR                                  #  PICK UP LM-OFF,-ON KTLX/I
039085,000097: 17,2076           31416                           CAE      EKTLX/I                               
039086,000098: 17,2077           55646                           TS       KTLX/I                                
039087,000099: 
039088,000100: 17,2100           04633                           TC       IBNKCALL                              #  COMPUTE 1/CONACC, VARK
039089,000101: 17,2101           35145                           CADR     S40.15                                
039090,000102: 
039091,000103: 17,2102           31420        TVCINIT2           CAE      ETVCDT/2                              #  LEM-ON VALUE (PAD-LOAD,  CS / 2)
039092,000104: 17,2103           54001                           TS       L                                     
039093,000105: 17,2104           34711                           CAF      BIT2                                  #  LEM-OFF VALUE (4CS / 2)
039094,000106: 17,2105           51447                           INDEX    CNTR                                  
039095,000107: 17,2106           30000                           CAE      A                                     
039096,000108: 17,2107           55644                           TS       KPRIMEDT                              #  (TEMP STORE)
039097,000109: 
039098,000110: 17,2110           40000                           COM                                            #  PREPARE T5TVCDT
039099,000111: 17,2111           64672                           AD       POSMAX                                
039100,000112: 17,2112           64712                           AD       BIT1                                  
039101,000113: 17,2113           55635                           TS       T5TVCDT                               
039102,000114: 
039103,000115: 17,2114           44674                           CS       BIT15                                 #  RESET SWTOVER FLAG
039104,000116: 17,2115           70105                           MASK     FLAGWRD9                              
039105,000117: 17,2116           54105                           TS       FLAGWRD9                              

Page 898

039107,000119: 17,2117           51447                           INDEX    CNTR                                  #  PICK UP LEM-OFF,-ON KPRIME
039108,000120: 17,2120           31413                           CAE      EKPRIME                               
039109,000121: 17,2121           00006                           EXTEND                                         
039110,000122: 17,2122           71644                           MP       KPRIMEDT                              #  (TVCDT/2, SC.AT B+14CS)
039111,000123: 17,2123           22000                           LXCH     A                                     #       SC.AT PI/8    (DIMENSIONLESS)
039112,000124: 17,2124           53645                           DXCH     KPRIMEDT                              
039113,000125: 
039114,000126: 17,2125           51447                           INDEX    CNTR                                  #  PICK UP LEM-OFF,-ON REPFRAC
039115,000127: 17,2126           31423                           CAE      EREPFRAC                              
039116,000128: 17,2127           55652                           TS       REPFRAC                               
039117,000129: 
039118,000130: 17,2130           37716                           CAF      NEGONE                                #  PREVENT STROKE TEST UNTIL CALLED
039119,000131: 17,2131           55664                           TS       STRKTIME                              
039120,000132: 
039121,000133: 17,2132           34374                           CAF      NINETEEN                              #  SET VCNTR FOR VARIABLE-GAIN UPDATES IN
039122,000134: 17,2133           55653                           TS       VCNTR                                 #       10 SECONDS (TVCEXEC 1/2 SEC RATE)
039123,000135: 17,2134           55444                           TS       V97VCNTR                              #  FOR ENGFAIL (R41) LOGIC
039124,000136: 
039125,000137: 17,2135           31421                           CAE      ETSWITCH                              #  PREPARE SWITCHOVER COUNTER
039126,000138: 17,2136           54001                           TS       L                                     
039127,000139: 17,2137           60000                           DOUBLE                                         #  (COUNTER DECREMENTS EVERY 1/2 SEC)
039128,000140: 17,2140           22000                           LXCH     A                                     #  LEM-OFF IN A, LEM-ON IN L
039129,000141: 17,2141           51447                           INDEX    CNTR                                  
039130,000142: 17,2142           30000                           CAE      A                                     
039131,000143: 17,2143           67716                           AD       NEGONE                                
039132,000144: 17,2144           55447                           TS       CNTR                                  #  CNTR = 2(SWITCHOVER TIME, SEC) -1
039133,000145: 
039134,000146: 
039135,000147: 17,2145           31425        TVCINIT3           CAE      PACTOFF                               #  TRIM VALUES TO TRIM-TRACKERS, OUTPUT
039136,000148: 17,2146           55625                           TS       PDELOFF                               #       TRACKERS, OFFSET-UPDATES, AND
039137,000149: 17,2147           55631                           TS       PCMD                                  #       OFFSET-TRACKER FILTERS
039138,000150: 17,2150           55621                           TS       DELPBAR                               #       NOTE, LO-ORDER DELOFF,DELBAR ZEROED
039139,000151: 
039140,000152: 17,2151           31426                           CAE      YACTOFF                               
039141,000153: 17,2152           55627                           TS       YDELOFF                               
039142,000154: 17,2153           55632                           TS       YCMD                                  
039143,000155: 17,2154           55623                           TS       DELYBAR                               
039144,000156: 
039145,000157: 17,2155           41501        NEEDLEIN           CS       RCSFLAGS                              #  SET BIT 3 FOR INITIALIZATION PASS AND GO
039146,000158: 17,2156           74710                           MASK     BIT3                                  #       TO NEEDLER.  WILL CLEAR FOR TVC DAP
039147,000159: 17,2157           27501                           ADS      RCSFLAGS                              #       (RETURNS AFTER CADR)
039148,000160: 17,2160           04633                           TC       IBNKCALL                              
039149,000161: 17,2161           42404                           CADR     NEEDLER                               
039150,000162: 
039151,000163: 17,2162           34714        TVCINIT4           CAF      ZERO                                  #  SET TVCPHASE TO INDICATE TVCDAPON-THRU-
039152,000164: 17,2163           55654                           TS       TVCPHASE                              #       NEEDLEIN INITIALIZATION FINISHED.
039153,000165:                                                                                                  #                                               (POSSIBLE TVC-RESTART ENTRY)
039154,000166: 
039155,000167: 17,2164           30032                           CAE      CDUX                                  #  PREPARE ROLL DAP LADDERS
039156,000168: 17,2165           55672                           TS       OGANOW                                

Page 899

039158,000170:                                                                                                  #                                          ROLL DAPS RE-START UPON A RESTART, BUT
039159,000171:                                                                                                  #                                               RETAIN ORIGINAL OGAD (IGNOVER CDUX)
039160,000172: 
039161,000173: 17,2166           34676                           CAF      BIT13                                 #  IF ENGINE IS ALREADY OFF, ENGINOFF HAS
039162,000174: 17,2167           00006                           EXTEND                                         #       ALREADY ESTABLISHED THE POST-BURN
039163,000175: 17,2170           02011                           RAND     DSALMOUT                              #       CSMMASS (MASSBACK DOES IT). DONT
039164,000176: 17,2171           00006                           EXTEND                                         #       TOUCH CSMMASS.  IF ENGINE IS ON,
039165,000177: 17,2172           12175                           BZF      +3                                    #       THEN ITS OK TO DO THE COPYCYCLE
039166,000178:                                                                                                  #                                               EVEN BURNS LESS THAN 0.4 SEC ARE AOK
039167,000179: 
039168,000180: 17,2173           31662                           CAE      MASSTMP                               #  COPYCYCLE
039169,000181: 17,2174           55474                           TS       CSMMASS                               
039170,000182: 
039171,000183: 17,2175           34731                 +3        CAF      .5SEC                                 #  CALL TVCEXECUTIVE (ROLLDAP CALL, ETC)
039172,000184: 17,2176           05140                           TC       WAITLIST                              
039173,000185: 17,2177  E6,1742                                  EBANK=   BZERO                                 
039174,000186: 17,2177           02660 34066                     2CADR    TVCEXEC                               
039175,000187: 
039176,000188: 
039177,000189: 17,2201           00006                           EXTEND                                         #  CALL FOR DAPINIT
039178,000190: 17,2202           32212                           DCA      DAPINIT5                              
039179,000191: 17,2203           53313                           DXCH     T5LOC                                 
039180,000192: 17,2204           31635                           CAE      T5TVCDT                               #  (ALLOW TIME FOR RESTART COMPUTATIONS)
039181,000193: 17,2205           54030                           TS       TIME5                                 
039182,000194: 
039183,000195: 17,2206           15222        ENDTVCIN           TCF      RESUME                                
039184,000196: 
039185,000197: 
039186,000198: 17,2207           00101        NZERO              DEC      65         B-14                       #  MUST BE ODD FOR MRCLEAN
039187,000199: 
039188,000200: 17,2210     4374               NINETEEN           =        VD1                                   
039189,000201: 
039190,000202: 17,2210           03720        ONETHOU            DEC      1000       B-13                       #  KG/CS B3 TO KG/10SEC B16 CONVERSION
039191,000203: 
039192,000204: 17,2211  E6,1742                                  EBANK=   BZERO                                 
039193,000205: 17,2211           03075 40066  DAPINIT5           2CADR    DAPINIT                               
039194,000206: 
039195,000207: 
039196,000208: 17,2213  E6,1742                                  EBANK=   BZERO                                 
039197,000209: 17,2213           02054 36066  INITLOC2           2CADR    TVCINIT1                              

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