Source Code
This is the source-code for the Apollo 9 Command Module's Guidance Computer.
These files were derived originally from the scan from MIT's Dibner Institute's
now-discontinued website titled "History of Recent Science and Technology", which
in turn was originally created by Gary Neff, though his high-quality scans were
unfortunately reduced in legibility when presented online.
The markings on the front of the
printout imply that it was the original AGC developer Norm Brodeur's copy.
A scan by Ron Burkey has superceded it, made from a more-legible copy from the collection of original
AGC developer Fred Martin. The source code was transcribed from
those images by Ron Burkey. Note that the page images
presented online are of reduced quality, and that higher-quality images
are available. Report any conversion errors or legibility
problems in page images to info@sandroid.org.
Notations on the program listing read, in part:ASSEMBLE REVISION 249 OF AGC PROGRAM COLOSSUS BY NASA 2021111-041 20'35 OCT. 28,1968Note that the date is the date of the printout, not the date of the program revision. |
040924,000002: ## Copyright: Public domain.
040925,000003: ## Filename: TVCRESTARTS.agc
040926,000004: ## Purpose: Part of the source code for Colossus, build 249.
040927,000005: ## It is part of the source code for the Command Module's (CM)
040928,000006: ## Apollo Guidance Computer (AGC), for Apollo 9.
040929,000007: ## Assembler: yaYUL
040930,000008: ## Reference: Starts on p. 916
040931,000009: ## Contact: Ron Burkey <info@sandroid.org>.
040932,000010: ## Website: www.ibiblio.org/apollo/index.html
040933,000011: ## Mod history: 08/23/04 RSB. Began transcribing.
040934,000012: ## 05/14/05 RSB Corrected website reference above.
040935,000013: ## 2010-10-24 JL Indentation fixes.
040936,000014: ## 2017-01-06 RSB Page numbers now agree with those on the
040937,000015: ## original harcopy, as opposed to the PDF page
040938,000016: ## numbers in 1701.pdf.
040939,000017: ## 2017-01-20 RSB Cross-diff'd comment text (not whitespace)
040940,000018: ## vs the already-proofed corresponding Colossus
040941,000019: ## 237 and Comanche 55 source-code files
040942,000020: ## and corrected errors found.
040943,000021: ##
040944,000022: ## The contents of the "Colossus249" files, in general, are transcribed
040945,000023: ## from a scanned copy of the program listing. Notations on this
040946,000024: ## document read, in part:
040947,000025: ##
040948,000026: ## Assemble revision 249 of AGC program Colossus by NASA
040949,000027: ## 2021111-041. October 28, 1968.
040950,000028: ##
040951,000029: ## This AGC program shall also be referred to as
040952,000030: ## Colossus 1A
040953,000031: ##
040954,000032: ## Prepared by
040955,000033: ## Massachusetts Institute of Technology
040956,000034: ## 75 Cambridge Parkway
040957,000035: ## Cambridge, Massachusetts
040958,000036: ## under NASA contract NAS 9-4065.
040959,000037: ##
040960,000038: ## Refer directly to the online document mentioned above for further information.
040961,000039: ## Please report any errors (relative to the scanned pages) to info@sandroid.org.
040962,000040: ##
040963,000041: ## In some cases, where the source code for Luminary 131 overlaps that of
040964,000042: ## Colossus 249, this code is instead copied from the corresponding Luminary 131
040965,000043: ## source file, and then is proofed to incorporate any changes.
040966,000044:
Page 916 |
040968,000046: # NAME....TVCRESTART PACKAGE, CONSISTING OF REDOTVC, ENABL1, 2, CMDSOUT, PHSCHK2, ETC.
040969,000047: # LOG SECTION....TVCRESTART PACKAGE SUBROUTINE....DAPCSM
040970,000048: # MOD BY ENGEL DATE....19 OCT, 1967
040971,000049:
040972,000050: # FUNCTIONAL DESCRIPTION....
040973,000051:
040974,000052: # *RESTART-PROOFS THE TVC DAPS, INCLUDING PITCHDAP, YAWDAP,
040975,000053: # TVCEXECUTIVE, ROLL DAP, TVCINIT4, TVCDAPON, AND STROKE TEST
040976,000054:
040977,000055: # *TVC RESTARTS DESERVE SPECIAL CONSIDERATION IN SEVERAL AREAS.
040978,000056: # RESTART DOWN-TIME IS IMPORTANT BECAUSE OF THE TRANSIENTS INTRODUCED
040979,000057: # BY THE THRUST VECTOR RETURN TO THE ACTUATOR MECHANICAL NULLS
040980,000058: # FOLLOWING TVC- AND OPTICS-ERROR-COUNTER-DISENABLES (CHANNEL 12).
040981,000059: # TVC USES A MIXTURE OF WAITLIST, T5, T6, AND JOB CALLS. THERE IS
040982,000060: # FILTER MEMORY (UP TO 7TH ORDER) TO BE PROTECTED IF WILD TRANSIENTS
040983,000061: # ARE TO BE AVOIDED. SEVERAL COUNTERS ARE INVOLVED FOR TIMING TVC
040984,000062: # EVENTS SUCH AS SWITCHOVER AND STROKE TEST STARTUPS AND RE-STARTUPS.
040985,000063: # THE TVC GAINS ARE DECREMENTED. THE GIMBAL TRIM ESTIMATORS AND THE
040986,000064: # BODY AXIS ATTITUDE ERROR INTEGRATORS INVOLVE DIGITAL SUMMATION.
040987,000065: # DIGITAL DIFFERENTIATORS ARE INVOLVED IN THE BODY AXIS RATE ESTIMA-
040988,000066: # TIONS AND IN THE OUTPUTTING OF ACTUATOR COMMANDS. THERE IS AN
040989,000067: # OFFSET-TRACKER-FILTER TO PROTECT. ETC., ETC.
040990,000068:
040991,000069: # *THOSE QUANTITIES WHICH MUST BE PROTECTED ARE STORED IN TEMPORARY
040992,000070: # REGISTERS AS THEY ARE COMPUTED, FOR UPDATING THE REAL REGISTERS
040993,000071: # DURING COPYCYCLES.
040994,000072:
040995,000073: # *THE SEVERAL COPYCYCLES ARE EACH PROTECTED BY PHASE POINTS AT THEIR
040996,000074: # BEGINNING AND AT THEIR TERMINATION. THE PHASE POINTS ARE SIMPLY
040997,000075: # ..INCR.. INSTRUCTIONS, EITHER ..INCR TVCEXPHS.. FOR COPYCYCLES
040998,000076: # IN THE TVCEXECUTIVE, OR ..INCR TVCPHASE.. FOR THE PITCH AND YAW
040999,000077: # COPYCYCLES. INDEXING ON EACH OF THESE POINTERS THEN PERMITS A
041000,000078: # RETURN TO THE APPROPRIATE RESTART POINTS.
041001,000079:
041002,000080: # *IF A RESTART OCCURS DURING EITHER COPYCYCLE, THAT COPYCYCLE IS
041003,000081: # COMPLETED. THEN THE NORMAL TVCINIT4....DAPINIT....PITCHDAP STARTUP
041004,000082: # SEQUENCE IS CALLED UPON TO GET THINGS GOING AGAIN.
041005,000083:
041006,000084: # *TVC-ENABLE AND OPTICS-ERROR-COUNTER ENABLE MUST BE SET ASAP
041007,000085: # (ALLOWING FOR PROCEDURAL DELAYS). THEN THE ENGINES ARE COMMANDED
041008,000086: # TO THE P,YACTOFF TRIM VALUES. THE DAPS ARE THEN READY TO GO ON THE
041009,000087: # AIR, WITH THE REGULAR STARTUP SEQUENCE, EITHER AT MRCLEAN FOR A
041010,000088: # COMPLETE INITIALIZATION OR AT TVCINIT4 FOR A PARTIAL INITIALIZATION
041011,000089:
041012,000090: # *FOR RESTARTS PRIOR TO THE SETTING OF THE T5 BITS IN IGNOVER THE
041013,000091: # PRE40.6 SECTION OF S40.6 TAKES CARE OF RE-ESTABLISHING TRIMS.
041014,000092:
041015,000093: # *IF A RESTART OCCURS DURING THE TVCEXEC....TVCEXFIN SEQUENCE THE
041016,000094: # COMPUTATIONS WILL BE COMPLETED, STARTING AT THE APPROPRIATE RESTART
041017,000095: # POINT, AFTER THE DAPS ARE READY TO GO ON THE AIR.
041018,000096:
041019,000097: # *IF A RESTART OCCURS PRIOR TO TVCINIT4 (TVCPHASE = -1) E.G. DURING
041020,000098: # THE EARLY DAP INITIALIZATION PHASE, THE DAP STARTUP SEQUENCE IS
041021,000099: # ENTERED AT MRCLEAN FOR A FULL INITIALIZATION.
041022,000100:
041023,000101: # *RESTARTS ARE NOT CRITICAL TO THE ROLL DAP PERFORMANCES HENCE THE
041024,000102: # THE ROLL DAP IS MERELY RESTARTED.
041025,000103:
041026,000104: # *RESTARTS DURING A STROKE TEST (STROKER IS NON-ZERO) WILL CAUSE THE
041027,000105: # STROKE TEST TO BE TERMINATED. A NEW V68 ENTRY WILL BE REQUIRED
Page 917 |
041029,000107: # TO GET IT GOING AGAIN (NO AUTOMATIC RESTART).
041030,000108: #
041031,000109: # *REDOTVC IS REACHED FOLLOWING ANY RESTART WHICH FINDS THE T5 BITS
041032,000110: # (BITS 15,14 OF FLAGWRD6) SET FOR TVC. IGNOVER PREPARES TVCPHASE = -1
041033,000111: # AND TVC EXPHS = 0 JUST BEFORE SETTING THESE BITS, JUST BEFORE
041034,000112: # MAKING THE T5 CALL TO TVCDAPON. T.V.N.G. TAKES OVER THE T5 CLOCK
041035,000113: # TO CALL RCSUP/RCSDAPON WHICH RESETS THE T5 BITS (FOR RCS) ON A
041036,000114: # NORMAL SHUTDOWN.
041037,000115:
041038,000116: # CALLING SEQUENCE....T5, IN PARTICULAR BY ELRSKIP OF FRESH START/RESTART
041039,000117:
041040,000118: # NORMAL EXIT MODES....RESUME, NOQRSM, POSTJUMP (TO TVCINIT4 OR MRCLEAN)
041041,000119:
041042,000120: # ALARM OR ABORT EXIT MODES....NONE
041043,000121:
041044,000122: # SUBROUTINES CALLED....
041045,000123:
041046,000124: # *PCOPY+1, YCOPY+1 (PITCH AND YAW COPYCYCLES)
041047,000125:
041048,000126: # *ENABLE1,2, CMDSOUT (RE-ESTABLISH ACTUATOR TRIMS)
041049,000127:
041050,000128: # *MRCLEAN OR TVCINIT4 (TVCDAP INITIALIZATIONS)
041051,000129:
041052,000130: # *EXRSTRT AND TVCEXECUTIVE PHASE POINTS 1 THRU 9
041053,000131:
041054,000132: # *WAITLIST, IBNKCALL, POSTJUMP, ISWCALL
041055,000133:
041056,000134: # OTHER INTERFACES....IGNOVER AND RCSDAPON (T5 BITS), ELRSKIP (CALLS IT)
041057,000135:
041058,000136: # ERASABLE INITIALIZATION REQUIRED....
041059,000137:
041060,000138: # *T5 BITS, TVCPHASE, TVCEXPHS
041061,000139:
041062,000140: # *TVC DAP VARIABLES
041063,000141:
041064,000142: # *OPERATIONS PERFORMED BY REDOTVC ARE BASED ON THE ASSUMPTION THAT
041065,000143: # THE TVC DAPS ARE RUNNING NORMALLY
041066,000144:
041067,000145: # OUTPUT....
041068,000146:
041069,000147: # *PITCH AND YAW TVC DAP COPYCYCLES COMPLETED IF INTERUPTED
041070,000148:
041071,000149: # *TVCEXECUTIVE COMPLETED IF INTERUPTED
041072,000150:
041073,000151: # *STROKE TEST TERMINATED IF INTERRUPTED
041074,000152:
041075,000153: # *ACTUATOR TRIMS RE-ESTABLISHED (ACTUATORS BACK ON THE AIR)
041076,000154:
041077,000155: # *TVC DAP INITIALIZATION AS REQUIRED
041078,000156:
041079,000157: # *ALL TVC DAP OPERATIONS ON THE AIR
041080,000158:
041081,000159: # DERIS....TVC TEMPORARIES IN EBANK6
041082,000160:
041083,000161: 16,3165 BANK 16
041084,000162: 16,2000 SETLOC DAPROLL
041085,000163: 16,2000 BANK
041086,000164: 16,3165 E6,1654 EBANK= TVCPHASE
041087,000165:
041088,000166: 16,3165 COUNT* $$/RSRT
041089,000167: 16,3165 22016 REDOTVC LXCH BANKRUPT # TVC RESTART PACKAGE
Page 918 |
041091,000169: 16,3166 00006 EXTEND
041092,000170: 16,3167 22012 QXCH QRUPT # (..TCR.. IN ..FINCOPY..)
041093,000171:
041094,000172: 16,3170 11661 EXECPHS CCS TVCEXPHS # CHECK TVCEXECUTIVE PHASE
041095,000173: 16,3171 13173 TCF +2 # MUST RESTART TVCEXECUTIVE
041096,000174: 16,3172 13177 TCF TVCDAPHS # NO NEED TO RESTART TVCEXECUTIVE
041097,000175:
041098,000176: 16,3173 34334 CAF NINE # 9CS DELAY TO FORCE EXRSTRT TO OCCUR
041099,000177: 16,3174 05140 TC WAITLIST # BEFORE PITCHDAP, AFTER CMDSOUT
041100,000178: 16,3175 E6,1661 EBANK= TVCEXPHS
041101,000179: 16,3175 03271 34066 2CADR EXRSTRT
041102,000180:
041103,000181: 16,3177 47700 TVCDAPHS CS OCT37776 # CHECK BITS 15 AND 1 OF TVCPHASE TO SEE
041104,000182: 16,3200 71654 MASK TVCPHASE # DAP RESTART LOCATION (-1,1,2,3)
041105,000183: 16,3201 10000 CCS A
041106,000184: 16,3202 13256 TCF FINCOPY # FINISH THE COPYCYCLE FIRST
041107,000185: 16,3203 13205 TCF ENABL1 # JUST PREPARE THE OUTCOUNTERS AND GO
041108,000186: 16,3204 13262 TCF TRIM/CMD # (RE-)DO P,YCMD INITIALIZATION FIRST
041109,000187: 16,3205 34703 ENABL1 CAF BIT8 # TVC ENABLE, FOLLOWED BY 40 MS (MIN) WAIT
041110,000188: 16,3206 64700 AD BIT11 # OPTICS DAC DISENGAGE TOO
041111,000189: 16,3207 00006 EXTEND # (ENABL1 ENTRIES..+0,- CCS, FINCOPY)
041112,000190: 16,3210 05012 WOR CHAN12
041113,000191: 16,3211 33275 CAF TVCADDR # WAIT, CALLING ENABL2 (BBCON THERE)
041114,000192: 16,3212 55312 TS T5LOC
041115,000193: 16,3213 33301 CAF TVCADDR +4 # 60 MS (TVCEXADR)
041116,000194: 16,3214 54030 TS TIME5
041117,000195:
041118,000196: 16,3215 15222 TCF RESUME
041119,000197: 16,3216 22016 ENABL2 LXCH BANKRUPT # CONTINUE PREPARATION OF OUTCOUNTERS
041120,000198:
041121,000199: 16,3217 34711 CAF BIT2 # OPTICS ERROR CNTR ENABLE, 4MS MIN WAIT
041122,000200: 16,3220 00006 EXTEND
041123,000201: 16,3221 05012 WOR CHAN12
041124,000202: 16,3222 33277 CAF TVCADDR +2 # WAIT, CALLING CMDSOUT (BBCON THERE)
041125,000203: 16,3223 55312 TS T5LOC
041126,000204: 16,3224 37700 CAF OCT37776 # 20MS
041127,000205: 16,3225 54030 TS TIME5
041128,000206:
041129,000207: 16,3226 15224 TCF NOQRSM
041130,000208: 16,3227 22016 CMDSOUT LXCH BANKRUPT # CONTINUE PREPARATION OF OUTCOUNTERS
041131,000209: 16,3230 00006 EXTEND
041132,000210: 16,3231 22012 QXCH QRUPT
Page 919 |
041134,000212: 16,3232 44714 CS ZERO # MOST RECENT ACTUATOR COMMANDS
041135,000213: 16,3233 61631 AD PCMD # (AVOID +0)
041136,000214: 16,3234 54054 TS TVCPITCH
041137,000215: 16,3235 44714 CS ZERO
041138,000216: 16,3236 61632 AD YCMD
041139,000217: 16,3237 54053 TS TVCYAW
041140,000218:
041141,000219: 16,3240 34755 CAF PRIO6 # RELEASE THE COUNTERS (BITS 11,12)
041142,000220: 16,3241 00006 EXTEND
041143,000221: 16,3242 05014 WOR CHAN14
041144,000222:
041145,000223: 16,3243 41654 PHSCHK2 CS TVCPHASE # CHECK TVCPHASE AGAIN
041146,000224: 16,3244 00006 EXTEND
041147,000225: 16,3245 63250 BZMF +3
041148,000226: 16,3246 04574 TC POSTJUMP # IF NEGATIVE, RESTART AT MRCLEAN
041149,000227: 16,3247 36033 CADR MRCLEAN # FOR FULL INITIALIZATION
041150,000228:
041151,000229: 16,3250 11614 CHKSTRK CCS STROKER # CHECK FOR STROKE TEST IN PROGRESS
041152,000230: 16,3251 13266 TCF TSTINITJ # YES, KILL IT
041153,000231: 16,3252 13254 TCF +2 # NO, PROCEED
041154,000232: 16,3253 13266 TCF TSTINITJ # YES, KILL IT
041155,000233:
041156,000234: 16,3254 04574 +4 TC POSTJUMP # IF POSITIVE OR ZERO, RESTART AT
041157,000235: 16,3255 36160 CADR TVCINIT4 # TVCINIT4 (ZEROS TVCPHASE, AND
041158,000236: # CALLS TVC DAPS)
041159,000237: 16,3256 51654 FINCOPY INDEX TVCPHASE # PICK UP THE APPROPRIATE COPYCYCLE
041160,000238: 16,3257 33275 CAF TVCCADR
041161,000239: 16,3260 04637 TCR ISWCALL # RE-ENTER THE COPYCYCLE, RETURN AT END
041162,000240: 16,3261 13205 TCF ENABL1 # NOW PREPARE THE OUTCOUNTERS
041163,000241: 16,3262 00006 TRIM/CMD EXTEND # TVCDAPON INITIALIZATION NOT COMPLETED,
041164,000242: 16,3263 31426 DCA PACTOFF # EG. P,YCMD MAY NOT BE SET. SET...
041165,000243: 16,3264 53632 DXCH PCMD
041166,000244: 16,3265 13205 TCF ENABL1 # NOW PREPARE THE OUTCOUNTERS
041167,000245: 16,3266 34714 TSTINITJ CAF ZERO # DISABLE STROKE TEST (-0 SHOWS PRIOR V68)
041168,000246: 16,3267 55614 TS STROKER # (+0 MEANS NEW V68 REQUIRED FOR STARTUP)
041169,000247: 16,3270 13254 TCF CHKSTRK +4
041170,000248:
041171,000249: 16,3271 51661 EXRSTRT INDEX TVCEXPHS # TVCEXECUTIVE RESTARTS....GO TO
041172,000250: 16,3272 33301 CAF TVCEXADR # APPROPRIATE RESTART POINT
041173,000251: 16,3273 50000 INDEX A
041174,000252: 16,3274 10000 TCF 0
041175,000253:
Page 920 |
041177,000255: # TVC RESTART TABLES.... ORDER IS REQUIRED. HI-ORDER WORDS ONLY, OF 2CADRS, SINCE BBCON IS ALREADY THERE.
041178,000256:
041179,000257: 16,3275 16,3275 TVCADDR = TVCCADR # TABLE OF CADRS, UNUSED LOCS FOR GENADRS
041180,000258: 16,3275 03216 TVCCADR GENADR ENABL2 # (FOR T5 CALL, UNUSED TABLE LOC)
041181,000259: 16,3276 40561 +1 CADR PCOPY +1 # PITCH COPYCYCLE
041182,000260: 16,3277 03227 +2 GENADR CMDSOUT # (FOR T5 CALL, UNUSED TABLE LOC)
041183,000261: 16,3300 41037 +3 CADR YCOPY +1 # YAW COPYCYCLE
041184,000262: 16,3301 37772 TVCEXADR OCT 37772 # (UNUSED TABLE LOC, FILL WITH 60MS, T5)
041185,000263: 16,3302 02742 +1 GENADR EXECCOPY +1 # TVCEXECUTIVE RESTART POINTS (ORDERED)
041186,000264: 16,3303 02750 +2 GENADR SWT/COR
041187,000265: 16,3304 03030 +3 GENADR SWTCOPY +1
041188,000266: 16,3305 03050 +4 GENADR TEMPSET
041189,000267: 16,3306 03053 +5 GENADR CORSETUP
041190,000268: 16,3307 03111 +6 GENADR CORCOPY +1
041191,000269: 16,3310 03122 +7 GENADR CNTRCOPY
041192,000270: 16,3311 03125 +8D GENADR STRKUP
041193,000271: 16,3312 03140 +9D GENADR STRKTCPY +1
End of include-file TVCRESTARTS.agc. Parent file is MAIN.agc