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.

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

Page 896

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

Page 897

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

Page 898

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

Page 899

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

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