Source Code
These source-code files are part of a reconstructed copy of Comanche 45/2 (AKA Manche45 revision 2),
the final, flown mission release of the Apollo 10 Command Module (CM) Apollo Guidance
Computer (AGC) software. Comanche 45/2 was preceded by Comanche 44 and Comanche 45. The
reconstruction is believed to be exactly accurate, but in the absence of an actual Apollo-era
listing of Comanche 45/2, some explanation of the reconstruction process is needed
to insure confidence in that accuracy.
The starting point was the source code of Comanche 45 (itself previously accurately reconstructed). Comanche 45 source code was then modified by incorporating changes known from contemporary documentation to have been made between revisions 45 and 45/2. The now-reconstructed Comanche 45/2 source code was verified by assembling it and checking that the assembled code had the expected known-correct memory-bank checksums. Note that page numbers in the reconstructed code tend to match those in the Comanche 55, the most-similar revision of Comanche for which we have access to an actual non-reconstructed hardcopy; the source code would likely have different page numbers in a contemporary Comanche 45 listing. Annotations that were not present in the contemporary source code have been added to the reconstructed code to justify each change relative to Comanche 44. Here's a guide to the Apollo documentation referenced in those annotations:
|
041683,000002: ## Copyright: Public domain.
041684,000003: ## Filename: TVCRESTARTS.agc
041685,000004: ## Purpose: A section of Manche45 revision 2.
041686,000005: ## It is part of the reconstructed source code for the
041687,000006: ## final, flown release of the flight software for the Command
041688,000007: ## Module's (CM) Apollo Guidance Computer (AGC) for Apollo 10.
041689,000008: ## The code has been recreated from a copy of Comanche 055. It
041690,000009: ## has been adapted such that the resulting bugger words
041691,000010: ## exactly match those specified for Manche 45/2 in NASA drawing
041692,000011: ## 2021153D, which gives relatively high confidence that the
041693,000012: ## reconstruction is correct.
041694,000013: ## Assembler: yaYUL
041695,000014: ## Contact: Ron Burkey <info@sandroid.org>.
041696,000015: ## Website: www.ibiblio.org/apollo/index.html
041697,000016: ## Mod history: 2020-12-24 MAS Created from Comanche 45.
041698,000017:
Page 956 |
041700,000019: # NAME....TVCRESTART PACKAGE, CONSISTING OF REDOTVC, ENABL1, 2, CMDSOUT, PHSCHK2, ETC.
041701,000020: # LOG SECTION...TVCRESTARTS SUBROUTINE...DAPCSM
041702,000021: # MODIFIED BY SCHLUNDT 21 OCTOBER 1968
041703,000022:
041704,000023: # FUNCTIONAL DESCRIPTION....
041705,000024:
041706,000025: # *RESTART-PROOFS THE TVC DAPS, INCLUDING PITCHDAP, YAWDAP,
041707,000026: # TVCEXECUTIVE, ROLLDAP, TVCINIT4, TVCDAPON, AND CSM/.M V46 SWTCHOVR.
041708,000027:
041709,000028: # *TVC RESTARTS DESERVE SPECIAL CONSIDERATION IN SEVERAL AREAS.
041710,000029: # RESTART DOWN-TIME IS IMPORTANT BECAUSE OF THE TRANSIENTS INTRODUCED
041711,000030: # BY THE THRUST VECTOR RETURN TO THE ACTUATOR MECHANICAL NULLS
041712,000031: # FOLLOWING TVC- AND OPTICS-ERROR-COUNTER-DISENABLES (CHANNEL 12).
041713,000032: # TVC USES A MIXTURE OF WAITLIST, T5, T6, AND JOB CALLS. THERE IS
041714,000033: # FILTER MEMORY (UP TO 6TH ORDER) TO BE PROTECTED IF WILD TRANSIENTS
041715,000034: # ARE TO BE AVOIDED. COUNTERS ARE INVOLVED FOR ONE-SHOT
041716,000035: # CORRECTIONS AND GAIN UPDATES. THE GIMBAL TRIM ESTIMATORS AND THE
041717,000036: # BODY AXIS ATTITUDE ERROR INTEGRATORS INVOLVE DIGITAL SUMMATION.
041718,000037: # DIGITAL DIFFERENTIATORS ARE INVOLVED IN THE BODY AXIS RATE ESTIMA-
041719,000038: # TIONS AND IN THE OUTPUTTING OF ACTUATOR COMMANDS. THERE IS AN
041720,000039: # OFFSET-TRACKER-FILTER TO PROTECT. ETC., ETC.
041721,000040:
041722,000041: # *THOSE QUANTITIES WHICH MUST BE PROTECTED ARE STORED IN TEMPORARY
041723,000042: # REGISTERS AS THEY ARE COMPUTED, FOR UPDATING THE REAL REGISTERS
041724,000043: # DURING COPYCYCLES.
041725,000044:
041726,000045: # *THE SEVERAL COPYCYCLES ARE EACH PROTECTED BY PHASE POINTS AT THEIR
041727,000046: # BEGINNING AND AT THEIR TERMINATION. THE PHASE POINTS ARE SIMPLY
041728,000047: # ..INCR.. INSTRUCTIONS, EITHER ..INCR TVCEXPHS.. FOR COPYCYCLES
041729,000048: # IN THE TVCEXECUTIVE, OR ..INCR TVCPHASE.. FOR THE PITCH AND YAW
041730,000049: # COPYCYCLES. INDEXING ON EACH OF THESE POINTERS THEN PERMITS A
041731,000050: # RETURN TO THE APPROPRIATE RESTART POINTS.
041732,000051:
041733,000052: # *IF A RESTART OCCURS DURING EITHER COPYCYCLE, THAT COPYCYCLE IS
041734,000053: # COMPLETED. THEN THE NORMAL TVCINIT4....DAPINIT....PITCHDAP STARTUP
041735,000054: # SEQUENCE IS CALLED UPON TO GET THINGS GOING AGAIN.
041736,000055:
041737,000056: # *TVC-ENABLE AND OPTICS-ERROR-COUNTER ENABLE MUST BE SET ASAP
041738,000057: # (ALLOWING FOR PROCEDURAL DELAYS). THEN THE ENGINES ARE COMMANDED
041739,000058: # TO THE P,YACTOFF TRIM VALUES. THE DAPS ARE THEN READY TO GO ON THE
041740,000059: # AIR, WITH THE REGULAR STARTUP SEQUENCE, EITHER AT MRCLEAN FOR A
041741,000060: # COMPLETE INITIALIZATION OR AT TVCINIT4 FOR A PARTIAL INITIALIZATION
041742,000061:
041743,000062: # *FOR RESTARTS PRIOR TO THE SETTING OF THE T5 BITS AT DOTVCON THE
041744,000063: # PRE40.6 SECTION OF S40.6 TAKES CARE OF RE-ESTABLISHING TRIMS.
041745,000064:
041746,000065: # *IF A RESTART OCCURS DURING THE TVCEXEC....TVCEXFIN SEQUENCE THE
041747,000066: # COMPUTATIONS WILL BE COMPLETED, STARTING AT THE APPROPRIATE RESTART
041748,000067: # POINT, AFTER THE DAPS ARE READY TO GO ON THE AIR.
041749,000068:
041750,000069: # *IF A RESTART OCCURS PRIOR TO TVCINIT4 (TVCPHASE = -1) E.G. DURING
041751,000070: # THE EARLY DAP INITIALIZATION PHASE, THE DAP STARTUP SEQUENCE IS
041752,000071: # ENTERED AT MRCLEAN FOR A FULL INITIALIZATION.
041753,000072:
041754,000073: # *FOR RESTARTS DURING CSM/LM V46 SWITCH-OVER, TVCPHASE IS SET TO -2.
041755,000074: # AND THE RESTART LOGIC GOES BACK TO REDO SWITCH-OVER (AFTER THE
041756,000075: # NORMAL DAP RESTART SEQUENCE IS FOLLOWED).
041757,000076:
041758,000077: # *RESTARTS ARE NOT CRITICAL TO THE ROLL DAP PERFORMANCES HENCE THE
041759,000078: # THE ROLL DAP IS MERELY RESTARTED.
041760,000079:
041761,000080: # *RESTARTS DURING A STROKE TEST (STROKER IS NON-ZERO) WILL CAUSE THE
Page 957 |
041763,000082: # STROKE TEST TO BE TERMINATED. A NEW V68 ENTRY WILL BE REQUIRED
041764,000083: # TO GET IT GOING AGAIN (NO AUTOMATIC RESTART).
041765,000084: #
041766,000085: # *REDOTVC IS REACHED FOLLOWING ANY RESTART WHICH FINDS THE T5 BITS
041767,000086: # (BITS 15,14 OF FLAGWRD6) SET FOR TVC. DOTVCON SETS TVCPHASE = -1
041768,000087: # AND TVC EXPHS = 0 JUST BEFORE SETTING THESE BITS, JUST BEFORE
041769,000088: # MAKING THE T5 CALL TO TVCDAPON. ON A NORMAL SHUTDOWN DOTVCRCS
041770,000089: # CALLS RCSDAPON, WHICH RESETS THE T5 BITS FOR RCS.
041771,000090:
041772,000091: # CALLING SEQUENCE....T5, IN PARTICULAR BY ELRSKIP OF FRESH START/RESTART
041773,000092:
041774,000093: # NORMAL EXIT MODES....RESUME, NOQRSM, POSTJUMP (TO TVCINIT4 OR MRCLEAN)
041775,000094:
041776,000095: # ALARM OR ABORT EXIT MODES....NONE
041777,000096:
041778,000097: # SUBROUTINES CALLED....
041779,000098:
041780,000099: # *PCOPY+1, YCOPY+1 (PITCH AND YAW COPYCYCLES)
041781,000100: # *ENABLE1,2, CMDSOUT (RE-ESTABLISH ACTUATOR TRIMS)
041782,000101: # *MRCLEAN OR TVCINIT4 (TVCDAP INITIALIZATIONS)
041783,000102: # *SWICHOVR +5 (CSM/LM V46 SWITCH-OVER)
041784,000103: # *EXRSTRT AND TVCEXECUTIVE PHASE POINTS 1 THRU 6
041785,000104: # *WAITLIST, IBNKCALL, POSTJUMP, ISWCALL
041786,000105:
041787,000106: # OTHER INTERFACES....DOTVCON AND RCSDAPON (T5 BITS), ELRSKIP (CALLS IT)
041788,000107:
041789,000108: # ERASABLE INITIALIZATION REQUIRED....
041790,000109:
041791,000110: # *T5 BITS (1,0), TVCPHASE (-2,-1,0,1,2,3), TVCEXPHS (1 THRU 6)
041792,000111: # *TVC DAP VARIABLES
041793,000112: # *OPERATIONS PERFORMED BY REDOTVC ARE BASED ON THE ASSUMPTION THAT
041794,000113: # THE TVC DAPS ARE RUNNING NORMALLY
041795,000114:
041796,000115: # OUTPUT....
041797,000116:
041798,000117: # *PITCH AND YAW TVC DAP COPYCYCLES COMPLETED IF INTERUPTED
041799,000118: # *TVCEXECUTIVE COMPLETED IF INTERUPTED
041800,000119: # *STROKE TEST TERMINATED IF INTERRUPTED
041801,000120: # *CSM/LM V46 SWITCH-OVER REPEATED IF INTERRUPTED
041802,000121: # *ACTUATOR TRIMS RE-ESTABLISHED (ACTUATORS BACK ON THE AIR)
041803,000122: # *TVC DAP INITIALIZATION AS REQUIRED
041804,000123: # *ALL TVC DAP OPERATIONS ON THE AIR
041805,000124:
041806,000125: # DEBRIS....TVC TEMPORARIES IN EBANK6
041807,000126:
Page 958 |
041809,000128:
041810,000129: 16,3135 BANK 16
041811,000130: 16,2000 SETLOC DAPROLL
041812,000131: 16,2000 BANK
041813,000132: 16,3135 E6,1644 EBANK= TVCPHASE
041814,000133: 16,3135 COUNT* $$/RSRT
041815,000134:
041816,000135: 16,3135 22016 REDOTVC LXCH BANKRUPT # TVC RESTART PACKAGE
041817,000136: 16,3136 00006 EXTEND
041818,000137: 16,3137 22012 QXCH QRUPT # (..TCR.. IN ..FINCOPY..)
041819,000138:
041820,000139: 16,3140 11651 EXECPHS CCS TVCEXPHS # CHECK TVCEXECUTIVE PHASE
041821,000140: 16,3141 13143 TCF +2 # MUST RESTART TVCEXECUTIVE
041822,000141: 16,3142 13147 TCF TVCDAPHS # NO NEED TO RESTART TVCEXECUTIVE
041823,000142:
041824,000143: 16,3143 34334 CAF NINE # 9CS DELAY TO FORCE EXRSTRT TO OCCUR
041825,000144: 16,3144 05245 TC WAITLIST # BEFORE PITCHDAP, AFTER CMDSOUT
041826,000145: 16,3145 E6,1651 EBANK= TVCEXPHS
041827,000146: 16,3145 03250 34066 2CADR EXRSTRT
041828,000147:
041829,000148: 16,3147 47700 TVCDAPHS CS OCT37776 # CHECK BITS 15 AND 1 OF TVCPHASE TO SEE
041830,000149: 16,3150 71644 MASK TVCPHASE # DAP RESTART LOCATION (-1,1,2,3)
041831,000150: 16,3151 10000 CCS A
041832,000151: 16,3152 13235 TCF FINCOPY # FINISH THE COPYCYCLE FIRST
041833,000152: 16,3153 13160 TCF ENABL1 # JUST PREPARE THE OUTCOUNTERS AND GO
041834,000153:
041835,000154: 16,3154 41644 CS TVCPHASE # TEST FOR TVCPHASE = -2
041836,000155: 16,3155 75016 MASK BIT2 # (THIS INDICATES RESTART OCCURRED
041837,000156: 16,3156 00006 EXTEND # DURING CSM/LM V46 SWITCH-OVER)
041838,000157: 16,3157 13241 BZF TRIM/CMD # NO, TVCPHASE = -1, RSTRT WAS IN TVCINIT
041839,000158:
041840,000159: 16,3160 35010 ENABL1 CAF BIT8 # TVC ENABLE, FOLLOWED BY 40 MS (MIN) WAIT
041841,000160: 16,3161 65005 AD BIT11 # SET BIT FOR OPTICS-DAC-ENABLE ALSO
041842,000161: 16,3162 00006 EXTEND # (ENABL1 ENTERED FROM TVCDAPHS / FINCOPY)
041843,000162: 16,3163 05012 WOR CHAN12
041844,000163: 16,3164 33254 CAF TVCADDR # WAIT, CALLING ENABL2 (BBCON THERE)
041845,000164: 16,3165 55312 TS T5LOC
041846,000165: 16,3166 33260 CAF TVCADDR +4 # 60 MS (TVCEXADR)
041847,000166: 16,3167 54030 TS TIME5
041848,000167:
041849,000168: 16,3170 15333 TCF RESUME
041850,000169:
041851,000170: 16,3171 22016 ENABL2 LXCH BANKRUPT # CONTINUE PREPARATION OF OUTCOUNTERS
041852,000171:
041853,000172: 16,3172 35016 CAF BIT2 # OPTICS ERROR CNTR ENABLE, 4MS MIN WAIT
041854,000173: 16,3173 00006 EXTEND
041855,000174: 16,3174 05012 WOR CHAN12
Page 959 |
041857,000176: 16,3175 33256 CAF TVCADDR +2 # WAIT, CALLING CMDSOUT (BBCON THERE)
041858,000177: 16,3176 55312 TS T5LOC
041859,000178: 16,3177 37700 CAF OCT37776 # 20MS
041860,000179: 16,3200 54030 TS TIME5
041861,000180:
041862,000181: 16,3201 15335 TCF NOQRSM
041863,000182:
041864,000183: 16,3202 22016 CMDSOUT LXCH BANKRUPT # CONTINUE PREPARATION OF OUTCOUNTERS
041865,000184: 16,3203 00006 EXTEND
041866,000185: 16,3204 22012 QXCH QRUPT
041867,000186:
041868,000187: 16,3205 45021 CS ZERO # MOST RECENT ACTUATOR COMMANDS
041869,000188: 16,3206 61623 AD PCMD # (AVOID +0)
041870,000189: 16,3207 54054 TS TVCPITCH
041871,000190: 16,3210 45021 CS ZERO
041872,000191: 16,3211 61624 AD YCMD
041873,000192: 16,3212 54053 TS TVCYAW
041874,000193:
041875,000194: 16,3213 35062 CAF PRIO6 # RELEASE THE COUNTERS (BITS 11,12)
041876,000195: 16,3214 00006 EXTEND
041877,000196: 16,3215 05014 WOR CHAN14
041878,000197:
041879,000198: 16,3216 11644 PHSCHK2 CCS TVCPHASE # CHECK TVCPHASE AGAIN
041880,000199: 16,3217 13227 TCF CHKSTRK
041881,000200: 16,3220 13227 TCF CHKSTRK
041882,000201: 16,3221 10000 CCS A # A CONTAINS THE DIMINISHED ABSOLUTE OF
041883,000202: 16,3222 03225 TC +3 # TVCPHASE (-2 BECOMES +1. -1 BECOMES +0)
041884,000203:
041885,000204: 16,3223 04701 TC POSTJUMP # REPEAT TVC INITIALIZATION
041886,000205: 16,3224 36156 CADR MRCLEAN # (DO NOT RETURN)
041887,000206:
041888,000207: 16,3225 04740 +3 TC IBNKCALL # REPEAT CSM/LM V46 SWITCH-OVER
041889,000208: 16,3226 36361 CADR SWICHOVR +5 # (RETURN TO CHECK FOR STROKE TEST)
041890,000209:
041891,000210: 16,3227 11574 CHKSTRK CCS STROKER # CHECK FOR STROKE TEST IN PROGRESS
041892,000211: 16,3230 13245 TCF TSTINITJ # YES, KILL IT
041893,000212: 16,3231 13233 TCF +2 # NO, PROCEED
041894,000213: 16,3232 13245 TCF TSTINITJ # YES, KILL IT
041895,000214:
041896,000215: 16,3233 04701 +4 TC POSTJUMP # IF POSITIVE OR ZERO, RESTART AT
041897,000216: 16,3234 36324 CADR TVCINIT4 # TVCINIT4 (ZEROS TVCPHASE, AND
041898,000217: # CALLS TVC DAPS VIA DAPINIT)
041899,000218: 16,3235 51644 FINCOPY INDEX TVCPHASE # PICK UP THE APPROPRIATE COPYCYCLE
041900,000219: 16,3236 33254 CAF TVCCADR
041901,000220: 16,3237 04744 TCR ISWCALL # RE-ENTER THE COPYCYCLE, RETURN AT END
041902,000221: 16,3240 13160 TCF ENABL1 # NOW PREPARE THE OUTCOUNTERS
041903,000222:
041904,000223: 16,3241 00006 TRIM/CMD EXTEND # TVCDAPON INITIALIZATION NOT COMPLETED,
Page 960 |
041906,000225: 16,3242 31424 DCA PACTOFF # EG. P,YCMD MAY NOT BE SET. SET...
041907,000226: 16,3243 53624 DXCH PCMD
041908,000227: 16,3244 13160 TCF ENABL1 # NOW PREPARE THE OUTCOUNTERS
041909,000228:
041910,000229: 16,3245 35021 TSTINITJ CAF ZERO # DISABLE STROKE TEST (-0 SHOWS PRIOR V68)
041911,000230: 16,3246 55574 TS STROKER # (+0 MEANS NEW V68 REQUIRED FOR STARTUP)
041912,000231:
041913,000232: 16,3247 13233 TCF CHKSTRK +4
041914,000233:
041915,000234: 16,3250 51651 EXRSTRT INDEX TVCEXPHS # TVCEXECUTIVE RESTARTS....GO TO
041916,000235: 16,3251 33260 CAF TVCEXADR # APPROPRIATE RESTART POINT
041917,000236: 16,3252 50000 INDEX A
041918,000237: 16,3253 10000 TCF 0
041919,000238:
041920,000239: # TVC RESTART TABLES.... ORDER IS REQUIRED. HI-ORDER WORDS ONLY, OF 2CADRS, SINCE BBCON IS ALREADY THERE.
041921,000240:
041922,000241: 16,3254 16,3254 TVCADDR = TVCCADR # TABLE OF CADRS, UNUSED LOCS FOR GENADRS
041923,000242: 16,3254 03171 TVCCADR GENADR ENABL2 # (FOR T5 CALL, UNUSED TABLE LOC)
041924,000243: 16,3255 40675 +1 CADR PCOPY +1 # PITCH COPYCYCLE
041925,000244: 16,3256 03202 +2 GENADR CMDSOUT # (FOR T5 CALL, UNUSED TABLE LOC)
041926,000245: 16,3257 41051 +3 CADR YCOPY +1 # YAW COPYCYCLE
041927,000246: 16,3260 37772 TVCEXADR OCT 37772 # (UNUSED TABLE LOC, FILL WITH 60MS, T5)
041928,000247: 16,3261 03000 +1 GENADR EXECCOPY +1 # TVCEXECUTIVE RESTART POINTS (ORDERED)
041929,000248: 16,3262 03006 +2 GENADR 1SHOTCHK
041930,000249: 16,3263 03035 +3 GENADR TEMPSET
041931,000250: 16,3264 03040 +4 GENADR CORSETUP
041932,000251: 16,3265 03116 +5 GENADR CORCOPY +1
041933,000252: 16,3266 03127 +6 GENADR CNTRCOPY
End of include-file TVCRESTARTS.agc. Parent file is MAIN.agc