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.

039776,000002:                                                                                                  ## Copyright:   Public domain.
039777,000003:                                                                                                  ## Filename:    TVCRESTARTS.agc
039778,000004:                                                                                                  ## Purpose:     Part of the source code for Colossus build 237.
039779,000005:                                                                                                  ##              This is for the Command Module's (CM) Apollo Guidance
039780,000006:                                                                                                  ##              Computer (AGC), for Apollo 8.
039781,000007:                                                                                                  ## Assembler:   yaYUL
039782,000008:                                                                                                  ## Contact:     Jim Lawton <jim DOT lawton AT gmail DOT com>
039783,000009:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
039784,000010:                                                                                                  ## Page Scans:  www.ibiblio.org/apollo/ScansForConversion/Colossus237/
039785,000011:                                                                                                  ## Mod history: 2011-03-06 JL   Adapted from corresponding Colossus 249 file.
039786,000012:                                                                                                  ##              2017-01-01 RSB  Proofed comment text using octopus/ProoferComments,
039787,000013:                                                                                                  ##                              and fixed errors found.
039788,000014: 

Page 913

039790,000016:                                                                                                  #  NAME....TVCRESTART PACKAGE,  CONSISTING OF REDOTVC, ENABL1, 2, CMDSOUT, PHSCHK2, ETC.
039791,000017:                                                                                                  #  LOG SECTION....TVCRESTART PACKAGE    SUBROUTINE....DAPCSM
039792,000018:                                                                                                  #  MOD BY ENGEL                         DATE....19 OCT, 1967
039793,000019: 
039794,000020:                                                                                                  #  FUNCTIONAL DESCRIPTION....
039795,000021: 
039796,000022:                                                                                                  #      *RESTART-PROOFS THE TVC DAPS, INCLUDING PITCHDAP, YAWDAP,
039797,000023:                                                                                                  #       TVCEXECUTIVE, ROLL DAP, TVCINIT4, TVCDAPON, AND STROKE TEST
039798,000024:                                                                                                  #      *TVC RESTARTS DESERVE SPECIAL CONSIDERATION IN SEVERAL AREAS.
039799,000025:                                                                                                  #       RESTART DOWN-TIME IS IMPORTANT BECAUSE OF THE TRANSIENTS INTRODUCED
039800,000026:                                                                                                  #       BY THE THRUST VECTOR RETURN TO THE ACTUATOR MECHANICAL NULLS
039801,000027:                                                                                                  #       FOLLOWING TVC- AND OPTICS-ERROR-COUNTER-DISENABLES (CHANNEL 12).
039802,000028:                                                                                                  #       TVC    USES A MIXTURE OF WAITLIST, T5, T6, AND JOB CALLS. THERE IS
039803,000029:                                                                                                  #       FILTER MEMORY (UP TO 7TH ORDER) TO BE PROTECTED IF WILD TRANSIENTS
039804,000030:                                                                                                  #       ARE TO BE AVOIDED. SEVERAL COUNTERS ARE INVOLVED FOR TIMING TVC
039805,000031:                                                                                                  #       EVENTS SUCH AS SWITCHOVER AND STROKE TEST STARTUPS AND RE-STARTUPS.
039806,000032:                                                                                                  #       THE TVC GAINS ARE DECREMENTED. THE GIMBAL TRIM ESTIMATORS AND THE
039807,000033:                                                                                                  #       BODY AXIS ATTITUDE ERROR INTEGRATORS INVOLVE DIGITAL SUMMATION.
039808,000034:                                                                                                  #       DIGITAL DIFFERENTIATORS ARE INVOLVED IN THE BODY AXIS RATE ESTIMA-
039809,000035:                                                                                                  #       TIONS AND IN THE OUTPUTTING OF ACTUATOR COMMANDS. THERE IS AN
039810,000036:                                                                                                  #       OFFSET-TRACKER-FILTER TO PROTECT. ETC., ETC.
039811,000037:                                                                                                  #      *THOSE QUANTITIES WHICH MUST BE PROTECTED ARE STORED IN TEMPORARY
039812,000038:                                                                                                  #       REGISTERS AS THEY ARE COMPUTED, FOR UPDATING THE REAL REGISTERS
039813,000039:                                                                                                  #       DURING COPYCYCLES.
039814,000040:                                                                                                  #      *THE SEVERAL COPYCYCLES ARE EACH PROTECTED BY PHASE POINTS AT THEIR
039815,000041:                                                                                                  #       BEGINNING AND AT THEIR TERMINATION. THE PHASE POINTS ARE SIMPLY
039816,000042:                                                                                                  #       ..INCR.. INSTRUCTIONS,   EITHER ..INCR TVCEXPHS.. FOR COPYCYCLES
039817,000043:                                                                                                  #       IN THE TVCEXECUTIVE, OR ..INCR TVCPHASE.. FOR THE PITCH AND YAW
039818,000044:                                                                                                  #       COPYCYCLES. INDEXING ON EACH OF THESE POINTERS THEN PERMITS A
039819,000045:                                                                                                  #       RETURN TO THE APPROPRIATE RESTART POINTS.
039820,000046:                                                                                                  #      *IF A RESTART OCCURS DURING EITHER COPYCYCLE, THAT COPYCYCLE IS
039821,000047:                                                                                                  #       COMPLETED. THEN THE NORMAL TVCINIT4....DAPINIT....PITCHDAP STARTUP
039822,000048:                                                                                                  #       SEQUENCE IS CALLED UPON TO GET THINGS GOING AGAIN.
039823,000049:                                                                                                  #      *TVC-ENABLE AND OPTICS-ERROR-COUNTER ENABLE MUST BE SET ASAP
039824,000050:                                                                                                  #       (ALLOWING FOR PROCEDURAL DELAYS). THEN THE ENGINES ARE COMMANDED
039825,000051:                                                                                                  #       TO THE P,YACTOFF TRIM VALUES. THE DAPS ARE THEN READY TO GO ON THE
039826,000052:                                                                                                  #       AIR, WITH THE REGULAR STARTUP SEQUENCE, EITHER AT MRCLEAN FOR A
039827,000053:                                                                                                  #       COMPLETE INITIALIZATION OR AT TVCINIT4 FOR A PARTIAL INITIALIZATION
039828,000054:                                                                                                  #      *FOR RESTARTS PRIOR TO THE SETTING OF THE T5 BITS IN IGNOVER THE
039829,000055:                                                                                                  #       PRE40.6 SECTION OF S40.6 TAKES CARE OF RE-ESTABLISHING TRIMS.
039830,000056:                                                                                                  #      *IF A RESTART OCCURS DURING THE TVCEXEC....TVCEXFIN SEQUENCE THE
039831,000057:                                                                                                  #       COMPUTATIONS WILL BE COMPLETED, STARTING AT THE APPROPRIATE RESTART
039832,000058:                                                                                                  #       POINT, AFTER THE DAPS ARE READY TO GO ON THE AIR.
039833,000059:                                                                                                  #      *IF A RESTART OCCURS PRIOR TO TVCINIT4 (TVCPHASE = -1) E.G. DURING
039834,000060:                                                                                                  #       THE EARLY DAP INITIALIZATION PHASE, THE DAP STARTUP SEQUENCE IS
039835,000061:                                                                                                  #       ENTERED AT MRCLEAN FOR A FULL INITIALIZATION.
039836,000062:                                                                                                  #      *RESTARTS ARE NOT CRITICAL TO THE ROLL DAP PERFORMANCES HENCE THE
039837,000063:                                                                                                  #       THE ROLL DAP IS MERELY RESTARTED.
039838,000064:                                                                                                  #      *RESTARTS DURING A STROKE TEST (STROKER IS NON-ZERO) WILL CAUSE THE
039839,000065:                                                                                                  #       STROKE TEST TO BE TERMINATED. A NEW V68 ENTRY WILL BE REQUIRED

Page 914

039841,000067:                                                                                                  #       TO GET IT GOING AGAIN (NO AUTOMATIC RESTART).
039842,000068:                                                                                                  #      *REDOTVC IS REACHED FOLLOWING ANY RESTART WHICH FINDS THE T5 BITS
039843,000069:                                                                                                  #       (BITS 15,14 OF FLAGWRD6) SET FOR TVC. IGNOVER PREPARES TVCPHASE =-1
039844,000070:                                                                                                  #       AND TVC EXPHS = 0 JUST BEFORE SETTING THESE BITS, JUST BEFORE
039845,000071:                                                                                                  #       MAKING THE T5 CALL TO TVCDAPON.  T.V.N.G. TAKES OVER THE T5 CLOCK
039846,000072:                                                                                                  #       TO CALL RCSUP/RCSDAPON WHICH RESETS THE T5 BITS(FOR RCS) ON A
039847,000073:                                                                                                  #       NORMAL SHUTDOWN.
039848,000074: 
039849,000075:                                                                                                  #  CALLING SEQUENCE....T5, IN PARTICULAR BY ELRSKIP OF FRESH START/RESTART
039850,000076: 
039851,000077:                                                                                                  #  NORMAL EXIT MODES....RESUME, NOQRSM, POSTJUMP (TO TVCINIT4 OR MRCLEAN)
039852,000078: 
039853,000079:                                                                                                  #  ALARM OR ABORT EXIT MODES....NONE
039854,000080: 
039855,000081:                                                                                                  #  SUBROUTINES CALLED....
039856,000082: 
039857,000083:                                                                                                  #      *PCOPY+1, YCOPY+1 (PITCH AND YAW COPYCYCLES)
039858,000084:                                                                                                  #      *ENABLE1,2, CMDSOUT (RE-ESTABLISH ACTUATOR TRIMS)
039859,000085:                                                                                                  #      *MRCLEAN OR TVCINIT4 (TVCDAP INITIALIZATIONS)
039860,000086:                                                                                                  #      *EXRSTRT AND TVCEXECUTIVE PHASE POINTS 1 THRU 9
039861,000087:                                                                                                  #      *WAITLIST, IBNKCALL, POSTJUMP, ISWCALL
039862,000088: 
039863,000089:                                                                                                  #  OTHER INTERFACES....IGNOVER AND RCSDAPON (T5 BITS), ELRSKIP (CALLS IT)
039864,000090: 
039865,000091:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED....
039866,000092: 
039867,000093:                                                                                                  #      *T5 BITS, TVCPHASE, TVCEXPHS
039868,000094:                                                                                                  #      *TVC DAP VARIABLES
039869,000095:                                                                                                  #      *OPERATIONS PERFORMED BY REDOTVC ARE BASED ON THE ASSUMPTION THAT
039870,000096:                                                                                                  #       THE TVC DAPS ARE RUNNING NORMALLY
039871,000097: 
039872,000098:                                                                                                  #  OUTPUT....
039873,000099: 
039874,000100:                                                                                                  #      *PITCH AND YAW TVC DAP COPYCYCLES COMPLETED IF INTERUPTED
039875,000101:                                                                                                  #      *TVCEXECUTIVE COMPLETED IF INTERUPTED
039876,000102:                                                                                                  #      *STROKE TEST TERMINATED IF INTERRUPTED
039877,000103:                                                                                                  #      *ACTUATOR TRIMS RE-ESTABLISHED (ACTUATORS BACK ON THE AIR)
039878,000104:                                                                                                  #      *TVC DAP INITIALIZATION AS REQUIRED
039879,000105:                                                                                                  #      *ALL TVC DAP OPERATIONS ON THE AIR
039880,000106: 
039881,000107:                                                                                                  #  DERIS....TVC TEMPORARIES IN EBANK6
039882,000108: 
039883,000109: 
039884,000110: 16,3165                                           BANK     16                                    
039885,000111: 16,2000                                           SETLOC   DAPROLL                               
039886,000112: 16,2000                                           BANK                                           
039887,000113: 16,3165  E6,1654                                  EBANK=   TVCPHASE                              
039888,000114: 
039889,000115: 16,3165                                           COUNT*   $$/RSRT                               
039890,000116: 16,3165           22016        REDOTVC            LXCH     BANKRUPT                              #  TVC RESTART PACKAGE

Page 915

039892,000118: 16,3166           00006                           EXTEND                                         
039893,000119: 16,3167           22012                           QXCH     QRUPT                                 #  (  ..TCR..  IN  ..FINCOPY..  )
039894,000120: 
039895,000121: 16,3170           11661        EXECPHS            CCS      TVCEXPHS                              #  CHECK TVCEXECUTIVE PHASE
039896,000122: 16,3171           13173                           TCF      +2                                    #       MUST RESTART TVCEXECUTIVE
039897,000123: 16,3172           13177                           TCF      TVCDAPHS                              #       NO NEED TO RESTART TVCEXECUTIVE
039898,000124: 
039899,000125: 16,3173           34334                           CAF      NINE                                  #  9CS DELAY TO FORCE EXRSTRT TO OCCUR
039900,000126: 16,3174           05140                           TC       WAITLIST                              #       BEFORE PITCHDAP, AFTER CMDSOUT
039901,000127: 16,3175  E6,1661                                  EBANK=   TVCEXPHS                              
039902,000128: 16,3175           03270 34066                     2CADR    EXRSTRT                               
039903,000129: 
039904,000130: 
039905,000131: 16,3177           47700        TVCDAPHS           CS       OCT37776                              #  CHECK BITS 15 AND 1 OF TVCPHASE TO SEE
039906,000132: 16,3200           71654                           MASK     TVCPHASE                              #       DAP RESTART LOCATION  (-1,1,2,3)
039907,000133: 16,3201           10000                           CCS      A                                     
039908,000134: 16,3202           13255                           TCF      FINCOPY                               #       FINISH THE COPYCYCLE FIRST
039909,000135: 16,3203           13205                           TCF      ENABL1                                #       JUST PREPARE THE OUTCOUNTERS AND GO
039910,000136: 16,3204           13261                           TCF      TRIM/CMD                              #       (RE-)DO P,YCMD INITIALIZATION FIRST
039911,000137: 
039912,000138: 
039913,000139: 16,3205           34703        ENABL1             CAF      BIT8                                  #  TVC ENABLE, FOLLOWED BY 40 MS (MIN) WAIT
039914,000140: 16,3206           00006                           EXTEND                                         #       (ENABL1 ENTRIES..+0,- CCS, FINCOPY)
039915,000141: 16,3207           05012                           WOR      CHAN12                                
039916,000142: 16,3210           33274                           CAF      TVCADDR                               #  WAIT,  CALLING ENABL2  (BBCON THERE)
039917,000143: 16,3211           55312                           TS       T5LOC                                 
039918,000144: 16,3212           33300                           CAF      TVCADDR    +4                         #       60MS  (TVCEXADR)
039919,000145: 16,3213           54030                           TS       TIME5                                 
039920,000146: 
039921,000147: 16,3214           15222                           TCF      RESUME                                
039922,000148: 
039923,000149: 
039924,000150: 16,3215           22016        ENABL2             LXCH     BANKRUPT                              #  CONTINUE PREPARATION OF OUTCOUNTERS
039925,000151: 
039926,000152: 16,3216           34711                           CAF      BIT2                                  #  OPTICS ERROR CNTR ENABLE, 4MS MIN WAIT
039927,000153: 16,3217           00006                           EXTEND                                         
039928,000154: 16,3220           05012                           WOR      CHAN12                                
039929,000155: 16,3221           33276                           CAF      TVCADDR    +2                         #  WAIT, CALLING CMDSOUT (BBCON THERE)
039930,000156: 16,3222           55312                           TS       T5LOC                                 
039931,000157: 16,3223           37700                           CAF      OCT37776                              #       20MS
039932,000158: 16,3224           54030                           TS       TIME5                                 
039933,000159: 
039934,000160: 16,3225           15224                           TCF      NOQRSM                                
039935,000161: 
039936,000162: 
039937,000163: 16,3226           22016        CMDSOUT            LXCH     BANKRUPT                              #  CONTINUE PREPARATION OF OUTCOUNTERS
039938,000164: 16,3227           00006                           EXTEND                                         
039939,000165: 16,3230           22012                           QXCH     QRUPT                                 
039940,000166: 

Page 916

039942,000168: 16,3231           44714                           CS       ZERO                                  #  MOST RECENT ACTUATOR COMMANDS
039943,000169: 16,3232           61631                           AD       PCMD                                  #       (AVOID +0)
039944,000170: 16,3233           54054                           TS       TVCPITCH                              
039945,000171: 16,3234           44714                           CS       ZERO                                  
039946,000172: 16,3235           61632                           AD       YCMD                                  
039947,000173: 16,3236           54053                           TS       TVCYAW                                
039948,000174: 
039949,000175: 16,3237           34755                           CAF      PRIO6                                 #  RELEASE THE COUNTERS (BITS 11,12)
039950,000176: 16,3240           00006                           EXTEND                                         
039951,000177: 16,3241           05014                           WOR      CHAN14                                
039952,000178: 
039953,000179: 16,3242           41654        PHSCHK2            CS       TVCPHASE                              #  CHECK TVCPHASE AGAIN
039954,000180: 16,3243           00006                           EXTEND                                         
039955,000181: 16,3244           63247                           BZMF     +3                                    
039956,000182: 16,3245           04574                           TC       POSTJUMP                              #       IF NEGATIVE, RESTART AT MRCLEAN
039957,000183: 16,3246           36035                           CADR     MRCLEAN                               #            FOR FULL INITIALIZATION
039958,000184: 
039959,000185: 16,3247           11614        CHKSTRK            CCS      STROKER                               #  CHECK FOR STROKE TEST IN PROGRESS
039960,000186: 16,3250           13265                           TCF      TSTINITJ                              #  YES, KILL IT
039961,000187: 16,3251           13253                           TCF      +2                                    #  NO, PROCEED
039962,000188: 16,3252           13265                           TCF      TSTINITJ                              #  YES, KILL IT
039963,000189: 
039964,000190: 16,3253           04574                 +4        TC       POSTJUMP                              #       IF POSITIVE OR ZERO, RESTART AT
039965,000191: 16,3254           36162                           CADR     TVCINIT4                              #            TVCINIT4 (ZEROS TVCPHASE, AND
039966,000192:                                                                                                  #                                                    CALLS TVC DAPS)
039967,000193: 
039968,000194: 
039969,000195: 16,3255           51654        FINCOPY            INDEX    TVCPHASE                              #  PICK UP THE APPROPRIATE COPYCYCLE
039970,000196: 16,3256           33274                           CAF      TVCCADR                               
039971,000197: 16,3257           04637                           TCR      ISWCALL                               #  RE-ENTER THE COPYCYCLE, RETURN AT END
039972,000198: 16,3260           13205                           TCF      ENABL1                                #  NOW PREPARE THE OUTCOUNTERS
039973,000199: 
039974,000200: 
039975,000201: 16,3261           00006        TRIM/CMD           EXTEND                                         #  TVCDAPON INITIALIZATION NOT COMPLETED,
039976,000202: 16,3262           31426                           DCA      PACTOFF                               #       EG.  P,YCMD MAY NOT BE SET.  SET...
039977,000203: 16,3263           53632                           DXCH     PCMD                                  
039978,000204: 16,3264           13205                           TCF      ENABL1                                #  NOW PREPARE THE OUTCOUNTERS
039979,000205: 
039980,000206: 
039981,000207: 16,3265           34714        TSTINITJ           CAF      ZERO                                  #  DISABLE STROKE TEST (-0 SHOWS PRIOR V68)
039982,000208: 16,3266           55614                           TS       STROKER                               #  (+0 MEANS NEW V68 REQUIRED FOR STARTUP)
039983,000209: 
039984,000210: 
039985,000211: 16,3267           13253                           TCF      CHKSTRK    +4                         
039986,000212: 
039987,000213: 16,3270           51661        EXRSTRT            INDEX    TVCEXPHS                              #  TVCEXECUTIVE RESTARTS....GO TO
039988,000214: 16,3271           33300                           CAF      TVCEXADR                              #       APPROPRIATE RESTART POINT
039989,000215: 16,3272           50000                           INDEX    A                                     
039990,000216: 16,3273           10000                           TCF      0                                     
039991,000217: 

Page 917

039993,000219:                                                                                                  #  TVC RESTART TABLES.... ORDER IS REQUIRED.   HI-ORDER WORDS ONLY, OF 2CADRS, SINCE BBCON IS ALREADY THERE.
039994,000220: 
039995,000221: 16,3274  16,3274               TVCADDR            =        TVCCADR                               #  TABLE OF CADRS, UNUSED LOCS FOR GENADRS
039996,000222: 16,3274           03215        TVCCADR            GENADR   ENABL2                                #  (FOR T5 CALL, UNUSED TABLE LOC)
039997,000223: 16,3275           40545                 +1        CADR     PCOPY      +1                         #  PITCH COPYCYCLE
039998,000224: 16,3276           03226                 +2        GENADR   CMDSOUT                               #  (FOR T5 CALL, UNUSED TABLE LOC)
039999,000225: 16,3277           41023                 +3        CADR     YCOPY      +1                         #  YAW COPYCYCLE
040000,000226: 16,3300           37772        TVCEXADR           OCT      37772                                 #  (UNUSED TABLE LOC, FILL WITH 60MS, T5)
040001,000227: 16,3301           02742                 +1        GENADR   EXECCOPY   +1                         #  TVCEXECUTIVE RESTART POINTS (ORDERED)
040002,000228: 16,3302           02750                 +2        GENADR   SWT/COR                               
040003,000229: 16,3303           03030                 +3        GENADR   SWTCOPY    +1                         
040004,000230: 16,3304           03050                 +4        GENADR   TEMPSET                               
040005,000231: 16,3305           03053                 +5        GENADR   CORSETUP                              
040006,000232: 16,3306           03111                 +6        GENADR   CORCOPY    +1                         
040007,000233: 16,3307           03122                 +7        GENADR   CNTRCOPY                              
040008,000234: 16,3310           03125                 +8D       GENADR   STRKUP                                
040009,000235: 16,3311           03140                 +9D       GENADR   STRKTCPY   +1                         

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