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.

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

Page 913

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

Page 914

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

Page 915

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

Page 916

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

Page 917

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

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