Source Code
These source-code files are part of a reconstructed copy of Comanche 44, the
initial release (though not the final mission release) of the Apollo 10
Command Module (CM) Apollo Guidance Computer (AGC) software. Subsequent releases
were Comanche 45 and Comanche 45/2 (the flown release on Apollo 10). The reconstruction
is believed to be exactly accurate, but in the absence of an actual Apollo-era
listing of Comanche 44, some explanation of the reconstruction process is needed
to insure confidence in that accuracy.
The starting point was the source code of Comanche 51 (separately previously reconstructed from an Apollo-era listing of Comanche 55, flown on Apollo 11). Comanche 51 source code was then modified by undoing changes known to have been made between revisions 44 and 51. The now-reconstructed Comanche 44 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 match those on the Comanche 55 printout, although the source code would likely have different page numbers in a contemporary Comanche 44 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 51. Here's a guide to the Apollo documentation referenced in those annotations:
Comments expected to have been present in the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC Project's GitHub repository. |
042259,000002: ## Copyright: Public domain.
042260,000003: ## Filename: TVCRESTARTS.agc
042261,000004: ## Purpose: A section of Comanche revision 044.
042262,000005: ## It is part of the reconstructed source code for the
042263,000006: ## original release of the flight software for the Command
042264,000007: ## Module's (CM) Apollo Guidance Computer (AGC) for Apollo 10.
042265,000008: ## The code has been recreated from a copy of Comanche 055. It
042266,000009: ## has been adapted such that the resulting bugger words
042267,000010: ## exactly match those specified for Comanche 44 in NASA drawing
042268,000011: ## 2021153D, which gives relatively high confidence that the
042269,000012: ## reconstruction is correct.
042270,000013: ## Assembler: yaYUL
042271,000014: ## Contact: Ron Burkey <info@sandroid.org>.
042272,000015: ## Website: www.ibiblio.org/apollo/index.html
042273,000016: ## Mod history: 2020-12-03 MAS Created from Comanche 51.
042274,000017:
Page 956 |
042276,000019: # NAME....TVCRESTART PACKAGE, CONSISTING OF REDOTVC, ENABL1, 2, CMDSOUT, PHSCHK2, ETC.
042277,000020: # LOG SECTION...TVCRESTARTS SUBROUTINE...DAPCSM
042278,000021: # MODIFIED BY SCHLUNDT 21 OCTOBER 1968
042279,000022:
042280,000023: # FUNCTIONAL DESCRIPTION....
042281,000024:
042282,000025: # *RESTART-PROOFS THE TVC DAPS, INCLUDING PITCHDAP, YAWDAP,
042283,000026: # TVCEXECUTIVE, ROLLDAP, TVCINIT4, TVCDAPON, AND CSM/.M V46 SWTCHOVR.
042284,000027:
042285,000028: # *TVC RESTARTS DESERVE SPECIAL CONSIDERATION IN SEVERAL AREAS.
042286,000029: # RESTART DOWN-TIME IS IMPORTANT BECAUSE OF THE TRANSIENTS INTRODUCED
042287,000030: # BY THE THRUST VECTOR RETURN TO THE ACTUATOR MECHANICAL NULLS
042288,000031: # FOLLOWING TVC- AND OPTICS-ERROR-COUNTER-DISENABLES (CHANNEL 12).
042289,000032: # TVC USES A MIXTURE OF WAITLIST, T5, T6, AND JOB CALLS. THERE IS
042290,000033: # FILTER MEMORY (UP TO 6TH ORDER) TO BE PROTECTED IF WILD TRANSIENTS
042291,000034: # ARE TO BE AVOIDED. COUNTERS ARE INVOLVED FOR ONE-SHOT
042292,000035: # CORRECTIONS AND GAIN UPDATES. THE GIMBAL TRIM ESTIMATORS AND THE
042293,000036: # BODY AXIS ATTITUDE ERROR INTEGRATORS INVOLVE DIGITAL SUMMATION.
042294,000037: # DIGITAL DIFFERENTIATORS ARE INVOLVED IN THE BODY AXIS RATE ESTIMA-
042295,000038: # TIONS AND IN THE OUTPUTTING OF ACTUATOR COMMANDS. THERE IS AN
042296,000039: # OFFSET-TRACKER-FILTER TO PROTECT. ETC., ETC.
042297,000040:
042298,000041: # *THOSE QUANTITIES WHICH MUST BE PROTECTED ARE STORED IN TEMPORARY
042299,000042: # REGISTERS AS THEY ARE COMPUTED, FOR UPDATING THE REAL REGISTERS
042300,000043: # DURING COPYCYCLES.
042301,000044:
042302,000045: # *THE SEVERAL COPYCYCLES ARE EACH PROTECTED BY PHASE POINTS AT THEIR
042303,000046: # BEGINNING AND AT THEIR TERMINATION. THE PHASE POINTS ARE SIMPLY
042304,000047: # ..INCR.. INSTRUCTIONS, EITHER ..INCR TVCEXPHS.. FOR COPYCYCLES
042305,000048: # IN THE TVCEXECUTIVE, OR ..INCR TVCPHASE.. FOR THE PITCH AND YAW
042306,000049: # COPYCYCLES. INDEXING ON EACH OF THESE POINTERS THEN PERMITS A
042307,000050: # RETURN TO THE APPROPRIATE RESTART POINTS.
042308,000051:
042309,000052: # *IF A RESTART OCCURS DURING EITHER COPYCYCLE, THAT COPYCYCLE IS
042310,000053: # COMPLETED. THEN THE NORMAL TVCINIT4....DAPINIT....PITCHDAP STARTUP
042311,000054: # SEQUENCE IS CALLED UPON TO GET THINGS GOING AGAIN.
042312,000055:
042313,000056: # *TVC-ENABLE AND OPTICS-ERROR-COUNTER ENABLE MUST BE SET ASAP
042314,000057: # (ALLOWING FOR PROCEDURAL DELAYS). THEN THE ENGINES ARE COMMANDED
042315,000058: # TO THE P,YACTOFF TRIM VALUES. THE DAPS ARE THEN READY TO GO ON THE
042316,000059: # AIR, WITH THE REGULAR STARTUP SEQUENCE, EITHER AT MRCLEAN FOR A
042317,000060: # COMPLETE INITIALIZATION OR AT TVCINIT4 FOR A PARTIAL INITIALIZATION
042318,000061:
042319,000062: # *FOR RESTARTS PRIOR TO THE SETTING OF THE T5 BITS AT DOTVCON THE
042320,000063: # PRE40.6 SECTION OF S40.6 TAKES CARE OF RE-ESTABLISHING TRIMS.
042321,000064:
042322,000065: # *IF A RESTART OCCURS DURING THE TVCEXEC....TVCEXFIN SEQUENCE THE
042323,000066: # COMPUTATIONS WILL BE COMPLETED, STARTING AT THE APPROPRIATE RESTART
042324,000067: # POINT, AFTER THE DAPS ARE READY TO GO ON THE AIR.
042325,000068:
042326,000069: # *IF A RESTART OCCURS PRIOR TO TVCINIT4 (TVCPHASE = -1) E.G. DURING
042327,000070: # THE EARLY DAP INITIALIZATION PHASE, THE DAP STARTUP SEQUENCE IS
042328,000071: # ENTERED AT MRCLEAN FOR A FULL INITIALIZATION.
042329,000072:
042330,000073: # *FOR RESTARTS DURING CSM/LM V46 SWITCH-OVER, TVCPHASE IS SET TO -2.
042331,000074: # AND THE RESTART LOGIC GOES BACK TO REDO SWITCH-OVER (AFTER THE
042332,000075: # NORMAL DAP RESTART SEQUENCE IS FOLLOWED).
042333,000076:
042334,000077: # *RESTARTS ARE NOT CRITICAL TO THE ROLL DAP PERFORMANCES HENCE THE
042335,000078: # THE ROLL DAP IS MERELY RESTARTED.
042336,000079:
042337,000080: # *RESTARTS DURING A STROKE TEST (STROKER IS NON-ZERO) WILL CAUSE THE
Page 957 |
042339,000082: # STROKE TEST TO BE TERMINATED. A NEW V68 ENTRY WILL BE REQUIRED
042340,000083: # TO GET IT GOING AGAIN (NO AUTOMATIC RESTART).
042341,000084: #
042342,000085: # *REDOTVC IS REACHED FOLLOWING ANY RESTART WHICH FINDS THE T5 BITS
042343,000086: # (BITS 15,14 OF FLAGWRD6) SET FOR TVC. DOTVCON SETS TVCPHASE = -1
042344,000087: # AND TVC EXPHS = 0 JUST BEFORE SETTING THESE BITS, JUST BEFORE
042345,000088: # MAKING THE T5 CALL TO TVCDAPON. ON A NORMAL SHUTDOWN DOTVCRCS
042346,000089: # CALLS RCSDAPON, WHICH RESETS THE T5 BITS FOR RCS.
042347,000090:
042348,000091: # CALLING SEQUENCE....T5, IN PARTICULAR BY ELRSKIP OF FRESH START/RESTART
042349,000092:
042350,000093: # NORMAL EXIT MODES....RESUME, NOQRSM, POSTJUMP (TO TVCINIT4 OR MRCLEAN)
042351,000094:
042352,000095: # ALARM OR ABORT EXIT MODES....NONE
042353,000096:
042354,000097: # SUBROUTINES CALLED....
042355,000098:
042356,000099: # *PCOPY+1, YCOPY+1 (PITCH AND YAW COPYCYCLES)
042357,000100: # *ENABLE1,2, CMDSOUT (RE-ESTABLISH ACTUATOR TRIMS)
042358,000101: # *MRCLEAN OR TVCINIT4 (TVCDAP INITIALIZATIONS)
042359,000102: # *SWICHOVR +5 (CSM/LM V46 SWITCH-OVER)
042360,000103: # *EXRSTRT AND TVCEXECUTIVE PHASE POINTS 1 THRU 6
042361,000104: # *WAITLIST, IBNKCALL, POSTJUMP, ISWCALL
042362,000105:
042363,000106: # OTHER INTERFACES....DOTVCON AND RCSDAPON (T5 BITS), ELRSKIP (CALLS IT)
042364,000107:
042365,000108: # ERASABLE INITIALIZATION REQUIRED....
042366,000109:
042367,000110: # *T5 BITS (1,0), TVCPHASE (-2,-1,0,1,2,3), TVCEXPHS (1 THRU 6)
042368,000111: # *TVC DAP VARIABLES
042369,000112: # *OPERATIONS PERFORMED BY REDOTVC ARE BASED ON THE ASSUMPTION THAT
042370,000113: # THE TVC DAPS ARE RUNNING NORMALLY
042371,000114:
042372,000115: # OUTPUT....
042373,000116:
042374,000117: # *PITCH AND YAW TVC DAP COPYCYCLES COMPLETED IF INTERUPTED
042375,000118: # *TVCEXECUTIVE COMPLETED IF INTERUPTED
042376,000119: # *STROKE TEST TERMINATED IF INTERRUPTED
042377,000120: # *CSM/LM V46 SWITCH-OVER REPEATED IF INTERRUPTED
042378,000121: # *ACTUATOR TRIMS RE-ESTABLISHED (ACTUATORS BACK ON THE AIR)
042379,000122: # *TVC DAP INITIALIZATION AS REQUIRED
042380,000123: # *ALL TVC DAP OPERATIONS ON THE AIR
042381,000124:
042382,000125: # DEBRIS....TVC TEMPORARIES IN EBANK6
042383,000126:
Page 958 |
042385,000128:
042386,000129: 16,3135 BANK 16
042387,000130: 16,2000 SETLOC DAPROLL
042388,000131: 16,2000 BANK
042389,000132: 16,3135 E6,1644 EBANK= TVCPHASE
042390,000133: 16,3135 COUNT* $$/RSRT
042391,000134:
042392,000135: 16,3135 22016 REDOTVC LXCH BANKRUPT # TVC RESTART PACKAGE
042393,000136: 16,3136 00006 EXTEND
042394,000137: 16,3137 22012 QXCH QRUPT # (..TCR.. IN ..FINCOPY..)
042395,000138:
042396,000139: 16,3140 11651 EXECPHS CCS TVCEXPHS # CHECK TVCEXECUTIVE PHASE
042397,000140: 16,3141 13143 TCF +2 # MUST RESTART TVCEXECUTIVE
042398,000141: 16,3142 13147 TCF TVCDAPHS # NO NEED TO RESTART TVCEXECUTIVE
042399,000142:
042400,000143: 16,3143 34334 CAF NINE # 9CS DELAY TO FORCE EXRSTRT TO OCCUR
042401,000144: 16,3144 05245 TC WAITLIST # BEFORE PITCHDAP, AFTER CMDSOUT
042402,000145: 16,3145 E6,1651 EBANK= TVCEXPHS
042403,000146: 16,3145 03250 34066 2CADR EXRSTRT
042404,000147:
042405,000148: 16,3147 47700 TVCDAPHS CS OCT37776 # CHECK BITS 15 AND 1 OF TVCPHASE TO SEE
042406,000149: 16,3150 71644 MASK TVCPHASE # DAP RESTART LOCATION (-1,1,2,3)
042407,000150: 16,3151 10000 CCS A
042408,000151: 16,3152 13235 TCF FINCOPY # FINISH THE COPYCYCLE FIRST
042409,000152: 16,3153 13160 TCF ENABL1 # JUST PREPARE THE OUTCOUNTERS AND GO
042410,000153:
042411,000154: 16,3154 41644 CS TVCPHASE # TEST FOR TVCPHASE = -2
042412,000155: 16,3155 75016 MASK BIT2 # (THIS INDICATES RESTART OCCURRED
042413,000156: 16,3156 00006 EXTEND # DURING CSM/LM V46 SWITCH-OVER)
042414,000157: 16,3157 13241 BZF TRIM/CMD # NO, TVCPHASE = -1, RSTRT WAS IN TVCINIT
042415,000158:
042416,000159: 16,3160 35010 ENABL1 CAF BIT8 # TVC ENABLE, FOLLOWED BY 40 MS (MIN) WAIT
042417,000160: 16,3161 65005 AD BIT11 # SET BIT FOR OPTICS-DAC-ENABLE ALSO
042418,000161: 16,3162 00006 EXTEND # (ENABL1 ENTERED FROM TVCDAPHS / FINCOPY)
042419,000162: 16,3163 05012 WOR CHAN12
042420,000163: 16,3164 33254 CAF TVCADDR # WAIT, CALLING ENABL2 (BBCON THERE)
042421,000164: 16,3165 55312 TS T5LOC
042422,000165: 16,3166 33260 CAF TVCADDR +4 # 60 MS (TVCEXADR)
042423,000166: 16,3167 54030 TS TIME5
042424,000167:
042425,000168: 16,3170 15333 TCF RESUME
042426,000169:
042427,000170: 16,3171 22016 ENABL2 LXCH BANKRUPT # CONTINUE PREPARATION OF OUTCOUNTERS
042428,000171:
042429,000172: 16,3172 35016 CAF BIT2 # OPTICS ERROR CNTR ENABLE, 4MS MIN WAIT
042430,000173: 16,3173 00006 EXTEND
042431,000174: 16,3174 05012 WOR CHAN12
Page 959 |
042433,000176: 16,3175 33256 CAF TVCADDR +2 # WAIT, CALLING CMDSOUT (BBCON THERE)
042434,000177: 16,3176 55312 TS T5LOC
042435,000178: 16,3177 37700 CAF OCT37776 # 20MS
042436,000179: 16,3200 54030 TS TIME5
042437,000180:
042438,000181: 16,3201 15335 TCF NOQRSM
042439,000182:
042440,000183: 16,3202 22016 CMDSOUT LXCH BANKRUPT # CONTINUE PREPARATION OF OUTCOUNTERS
042441,000184: 16,3203 00006 EXTEND
042442,000185: 16,3204 22012 QXCH QRUPT
042443,000186:
042444,000187: 16,3205 45021 CS ZERO # MOST RECENT ACTUATOR COMMANDS
042445,000188: 16,3206 61623 AD PCMD # (AVOID +0)
042446,000189: 16,3207 54054 TS TVCPITCH
042447,000190: 16,3210 45021 CS ZERO
042448,000191: 16,3211 61624 AD YCMD
042449,000192: 16,3212 54053 TS TVCYAW
042450,000193:
042451,000194: 16,3213 35062 CAF PRIO6 # RELEASE THE COUNTERS (BITS 11,12)
042452,000195: 16,3214 00006 EXTEND
042453,000196: 16,3215 05014 WOR CHAN14
042454,000197:
042455,000198: 16,3216 11644 PHSCHK2 CCS TVCPHASE # CHECK TVCPHASE AGAIN
042456,000199: 16,3217 13227 TCF CHKSTRK
042457,000200: 16,3220 13227 TCF CHKSTRK
042458,000201: 16,3221 10000 CCS A # A CONTAINS THE DIMINISHED ABSOLUTE OF
042459,000202: 16,3222 03225 TC +3 # TVCPHASE (-2 BECOMES +1. -1 BECOMES +0)
042460,000203:
042461,000204: 16,3223 04701 TC POSTJUMP # REPEAT TVC INITIALIZATION
042462,000205: 16,3224 36156 CADR MRCLEAN # (DO NOT RETURN)
042463,000206:
042464,000207: 16,3225 04740 +3 TC IBNKCALL # REPEAT CSM/LM V46 SWITCH-OVER
042465,000208: 16,3226 36361 CADR SWICHOVR +5 # (RETURN TO CHECK FOR STROKE TEST)
042466,000209:
042467,000210: 16,3227 11574 CHKSTRK CCS STROKER # CHECK FOR STROKE TEST IN PROGRESS
042468,000211: 16,3230 13245 TCF TSTINITJ # YES, KILL IT
042469,000212: 16,3231 13233 TCF +2 # NO, PROCEED
042470,000213: 16,3232 13245 TCF TSTINITJ # YES, KILL IT
042471,000214:
042472,000215: 16,3233 04701 +4 TC POSTJUMP # IF POSITIVE OR ZERO, RESTART AT
042473,000216: 16,3234 36324 CADR TVCINIT4 # TVCINIT4 (ZEROS TVCPHASE, AND
042474,000217: # CALLS TVC DAPS VIA DAPINIT)
042475,000218: 16,3235 51644 FINCOPY INDEX TVCPHASE # PICK UP THE APPROPRIATE COPYCYCLE
042476,000219: 16,3236 33254 CAF TVCCADR
042477,000220: 16,3237 04744 TCR ISWCALL # RE-ENTER THE COPYCYCLE, RETURN AT END
042478,000221: 16,3240 13160 TCF ENABL1 # NOW PREPARE THE OUTCOUNTERS
042479,000222:
042480,000223: 16,3241 00006 TRIM/CMD EXTEND # TVCDAPON INITIALIZATION NOT COMPLETED,
Page 960 |
042482,000225: 16,3242 31424 DCA PACTOFF # EG. P,YCMD MAY NOT BE SET. SET...
042483,000226: 16,3243 53624 DXCH PCMD
042484,000227: 16,3244 13160 TCF ENABL1 # NOW PREPARE THE OUTCOUNTERS
042485,000228:
042486,000229: 16,3245 35021 TSTINITJ CAF ZERO # DISABLE STROKE TEST (-0 SHOWS PRIOR V68)
042487,000230: 16,3246 55574 TS STROKER # (+0 MEANS NEW V68 REQUIRED FOR STARTUP)
042488,000231:
042489,000232: 16,3247 13233 TCF CHKSTRK +4
042490,000233:
042491,000234: 16,3250 51651 EXRSTRT INDEX TVCEXPHS # TVCEXECUTIVE RESTARTS....GO TO
042492,000235: 16,3251 33260 CAF TVCEXADR # APPROPRIATE RESTART POINT
042493,000236: 16,3252 50000 INDEX A
042494,000237: 16,3253 10000 TCF 0
042495,000238:
042496,000239: # TVC RESTART TABLES.... ORDER IS REQUIRED. HI-ORDER WORDS ONLY, OF 2CADRS, SINCE BBCON IS ALREADY THERE.
042497,000240:
042498,000241: 16,3254 16,3254 TVCADDR = TVCCADR # TABLE OF CADRS, UNUSED LOCS FOR GENADRS
042499,000242: 16,3254 03171 TVCCADR GENADR ENABL2 # (FOR T5 CALL, UNUSED TABLE LOC)
042500,000243: 16,3255 40675 +1 CADR PCOPY +1 # PITCH COPYCYCLE
042501,000244: 16,3256 03202 +2 GENADR CMDSOUT # (FOR T5 CALL, UNUSED TABLE LOC)
042502,000245: 16,3257 41051 +3 CADR YCOPY +1 # YAW COPYCYCLE
042503,000246: 16,3260 37772 TVCEXADR OCT 37772 # (UNUSED TABLE LOC, FILL WITH 60MS, T5)
042504,000247: 16,3261 03000 +1 GENADR EXECCOPY +1 # TVCEXECUTIVE RESTART POINTS (ORDERED)
042505,000248: 16,3262 03006 +2 GENADR 1SHOTCHK
042506,000249: 16,3263 03035 +3 GENADR TEMPSET
042507,000250: 16,3264 03040 +4 GENADR CORSETUP
042508,000251: 16,3265 03116 +5 GENADR CORCOPY +1
042509,000252: 16,3266 03127 +6 GENADR CNTRCOPY
End of include-file TVCRESTARTS.agc. Parent file is MAIN.agc