Source Code
These source-code files are part of a reconstructed copy of Skylark 048, the
Block II Command Module (CM) Apollo Guidance Computer (AGC) software for the
Skylab-2, Skylab-3, Skylab-4, and Apollo-Soyuz Test Project missions.
They have been created via disassembly of binary dumps of the original core rope memory modules actually flown on Skylab-2, part numbers 2010802-541, 2010802-551, 2010802-561, 2010802-571, 2010802-581, and 2010802-591. Access to these modules was provided by the New Mexico Museum of Space History, who we are much indebted to. The source code for the Apollo 15, 16, and 17 software, Artemis 072, was used as a starting point. Heavy use was made of TRW 4900.5-244, Programmed Guidance Equations for Skylark Command Module Earth Orbital Program, dated 14 February 1972. This document contains pseudocode of essentially all of Skylark, using original program labels which have been copied for this source reconstruction. Since only binary dumps (rather than listings) of Skylark are available as source material, all comments and labels are approximate. They have been taken from the Programmed Guidance Equations or other AGC programs where possible, or, in some places, written from scratch to match what we believe would have been in the original listing. |
038362,000002: ## Copyright: Public domain.
038363,000003: ## Filename: TVCRESTARTS.agc
038364,000004: ## Purpose: A section of Skylark revision 048.
038365,000005: ## It is part of the source code for the Apollo Guidance Computer (AGC)
038366,000006: ## for Skylab-2, Skylab-3, Skylab-4, and ASTP. No original listings of
038367,000007: ## this software are available; instead, this file was created via
038368,000008: ## disassembly of dumps of the core rope modules actually flown on
038369,000009: ## Skylab-2. Access to these modules was provided by the New Mexico
038370,000010: ## Museum of Space History.
038371,000011: ## Assembler: yaYUL
038372,000012: ## Contact: Ron Burkey <info@sandroid.org>.
038373,000013: ## Website: www.ibiblio.org/apollo/index.html
038374,000014: ## Mod history: 2023-09-04 MAS Created from Artemis 072.
038375,000015:
038376,000016:
038377,000017: # NAME....TVCRESTART PACKAGE, CONSISTING OF REDOTVC, ENABL1, 2, CMDSOUT, PHSCHK2, ETC.
038378,000018: # LOG SECTION...TVCRESTARTS SUBROUTINE...DAPCSM
038379,000019: # MODIFIED BY SCHLUNDT 21 OCTOBER 1968
038380,000020: # MODIFIED BY BEALS TO ELIMINATE CSMMASS UPDATE LOGIC (NOW DONE IN S40.8)
038381,000021: # FUNCTIONAL DESCRIPTION....
038382,000022:
038383,000023: # *RESTART-PROOFS THE TVC DAPS, INCLUDING PITCHDAP, YAWDAP,
038384,000024: # TVCEXECUTIVE, ROLLDAP, TVCINIT4, TVCDAPON, AND CSM/.M V46 SWTCHOVR.
038385,000025: # *TVC RESTARTS DESERVE SPECIAL CONSIDERATION IN SEVERAL AREAS.
038386,000026: # RESTART DOWN-TIME IS IMPORTANT BECAUSE OF THE TRANSIENTS INTRODUCED
038387,000027: # BY THE THRUST VECTOR RETURN TO THE ACTUATOR MECHANICAL NULLS
038388,000028: # FOLLOWING TVC- AND OPTICS-ERROR-COUNTER-DISENABLES (CHANNEL 12).
038389,000029: # TVC USES A MIXTURE OF WAITLIST, T5, T6, AND JOB CALLS. THERE IS
038390,000030: # FILTER MEMORY (UP TO 6TH ORDER) TO BE PROTECTED IF WILD TRANSIENTS
038391,000031: # ARE TO BE AVOIDED. COUNTERS ARE INVOLVED FOR ONE-SHOT
038392,000032: # CORRECTIONS AND GAIN UPDATES. THE GIMBAL TRIM ESTIMATORS AND THE
038393,000033: # BODY AXIS ATTITUDE ERROR INTEGRATORS INVOLVE DIGITAL SUMMATION.
038394,000034: # DIGITAL DIFFERENTIATORS ARE INVOLVED IN THE BODY AXIS RATE ESTIMA-
038395,000035: # TIONS AND IN THE OUTPUTTING OF ACTUATOR COMMANDS. THERE IS AN
038396,000036: # OFFSET-TRACKER-FILTER TO PROTECT. ETC., ETC.
038397,000037: # *THOSE QUANTITIES WHICH MUST BE PROTECTED ARE STORED IN TEMPORARY
038398,000038: # REGISTERS AS THEY ARE COMPUTED, FOR UPDATING THE REAL REGISTERS
038399,000039: # DURING COPYCYCLES.
038400,000040: # *THE SEVERAL COPYCYCLES ARE EACH PROTECTED BY PHASE POINTS AT THEIR
038401,000041: # BEGINNING AND AT THEIR TERMINATION. THE PHASE POINTS ARE SIMPLY
038402,000042: # ..INCR.. INSTRUCTIONS, EITHER ..INCR TVCEXPHS.. FOR COPYCYCLES
038403,000043: # IN THE TVCEXECUTIVE, OR ..INCR TVCPHASE.. FOR THE PITCH AND YAW
038404,000044: # COPYCYCLES. INDEXING ON EACH OF THESE POINTERS THEN PERMITS A
038405,000045: # RETURN TO THE APPROPRIATE RESTART POINTS.
038406,000046: # *IF A RESTART OCCURS DURING EITHER COPYCYCLE, THAT COPYCYCLE IS
038407,000047: # COMPLETED. THEN THE NORMAL TVCINIT4....DAPINIT....PITCHDAP STARTUP
038408,000048: # SEQUENCE IS CALLED UPON TO GET THINGS GOING AGAIN.
038409,000049: # *TVC-ENABLE AND OPTICS-ERROR-COUNTER ENABLE MUST BE SET ASAP
038410,000050: # (ALLOWING FOR PROCEDURAL DELAYS). THEN THE ENGINES ARE COMMANDED
038411,000051: # TO THE P,YACTOFF TRIM VALUES. THE DAPS ARE THEN READY TO GO ON THE
038412,000052: # AIR, WITH THE REGULAR STARTUP SEQUENCE, EITHER AT MRCLEAN FOR A
038413,000053: # COMPLETE INITIALIZATION OR AT TVCINIT4 FOR A PARTIAL INITIALIZATION
038414,000054: # *FOR RESTARTS PRIOR TO THE SETTING OF THE T5 BITS AT DOTVCON THE
038415,000055: # PRE40.6 SECTION OF S40.6 TAKES CARE OF RE-ESTABLISHING TRIMS.
038416,000056: # *IF A RESTART OCCURS DURING THE TVCEXEC....TVCEXFIN SEQUENCE THE
038417,000057: # COMPUTATIONS WILL BE COMPLETED, STARTING AT THE APPROPRIATE RESTART
038418,000058: # POINT, AFTER THE DAPS ARE READY TO GO ON THE AIR.
038419,000059: # *IF A RESTART OCCURS PRIOR TO TVCINIT4 (TVCPHASE = -1) E.G. DURING
038420,000060: # THE EARLY DAP INITIALIZATION PHASE, THE DAP STARTUP SEQUENCE IS
038421,000061: # ENTERED AT MRCLEAN FOR A FULL INITIALIZATION.
038422,000062: # *FOR RESTARTS DURING CSM/LM V46 SWITCH-OVER, TVCPHASE IS SET TO -2.
038423,000063: # AND THE RESTART LOGIC GOES BACK TO REDO SWITCH-OVER (AFTER THE
038424,000064: # NORMAL DAP RESTART SEQUENCE IS FOLLOWED).
038425,000065: # *RESTARTS ARE NOT CRITICAL TO THE ROLL DAP PERFORMANCES HENCE THE
038426,000066: # THE ROLL DAP IS MERELY RESTARTED.
038427,000067: # *REDOTVC IS REACHED FOLLOWING ANY RESTART WHICH FINDS THE T5 BITS
038428,000068: # (BITS 15,14 OF FLAGWRD6) SET FOR TVC. DOTVCON SETS TVCPHASE = -1
038429,000069: # AND TVC EXPHS = 0 JUST BEFORE SETTING THESE BITS, JUST BEFORE
038430,000070: # MAKING THE T5 CALL TO TVCDAPON. ON A NORMAL SHUTDOWN DOTVCRCS
038431,000071: # CALLS RCSDAPON, WHICH RESETS THE T5 BITS FOR RCS.
038432,000072: # CALLING SEQUENCE....T5, IN PARTICULAR BY ELRSKIP OF FRESH START/RESTART
038433,000073:
038434,000074: # NORMAL EXIT MODES....RESUME, NOQRSM, POSTJUMP (TO TVCINIT4 OR MRCLEAN)
038435,000075:
038436,000076: # ALARM OR ABORT EXIT MODES....NONE
038437,000077:
038438,000078: # SUBROUTINES CALLED....
038439,000079:
038440,000080: # *PCOPY+1, YCOPY+1 (PITCH AND YAW COPYCYCLES)
038441,000081: # *ENABLE1,2, CMDSOUT (RE-ESTABLISH ACTUATOR TRIMS)
038442,000082: # *MRCLEAN OR TVCINIT4 (TVCDAP INITIALIZATIONS)
038443,000083: # *SWICHOVR +5 (CSM/LM V46 SWITCH-OVER)
038444,000084: # *EXRSTRT AND TVCEXECUTIVE PHASE POINTS 1 THRU 6
038445,000085: # *WAITLIST, IBNKCALL, POSTJUMP, ISWCALL
038446,000086:
038447,000087: # OTHER INTERFACES....DOTVCON AND RCSDAPON (T5 BITS), ELRSKIP (CALLS IT)
038448,000088: # ERASABLE INITIALIZATION REQUIRED....
038449,000089:
038450,000090: # *T5 BITS (1,0), TVCPHASE (-2,-1,0,1,2,3), TVCEXPHS (1 THRU 6)
038451,000091: # *TVC DAP VARIABLES
038452,000092: # *OPERATIONS PERFORMED BY REDOTVC ARE BASED ON THE ASSUMPTION THAT
038453,000093: # THE TVC DAPS ARE RUNNING NORMALLY
038454,000094:
038455,000095: # OUTPUT....
038456,000096:
038457,000097: # *PITCH AND YAW TVC DAP COPYCYCLES COMPLETED IF INTERUPTED
038458,000098: # *TVCEXECUTIVE COMPLETED IF INTERUPTED
038459,000099: # *CSM/LM V46 SWITCH-OVER REPEATED IF INTERRUPTED
038460,000100: # *ACTUATOR TRIMS RE-ESTABLISHED (ACTUATORS BACK ON THE AIR)
038461,000101: # *TVC DAP INITIALIZATION AS REQUIRED
038462,000102: # *ALL TVC DAP OPERATIONS ON THE AIR
038463,000103:
038464,000104: # DEBRIS....TVC TEMPORARIES IN EBANK6
038465,000105:
038466,000106: 16,2000 SETLOC DAPROLL
038467,000107: 16,2000 BANK
038468,000108: 16,3176 E6,1664 EBANK= TVCPHASE
038469,000109: 16,3176 COUNT* $$/RSRT
038470,000110:
038471,000111: 16,3176 22016 REDOTVC LXCH BANKRUPT # TVC RESTART PACKAGE
038472,000112: 16,3177 00006 EXTEND
038473,000113: 16,3200 22012 QXCH QRUPT # ( ..TCR.. IN ..FINCOPY.. )
038474,000114:
038475,000115: 16,3201 11673 EXECPHS CCS TVCEXPHS # CHECK TVCEXECUTIVE PHASE
038476,000116: 16,3202 13204 TCF +2 # MUST RESTART TVCEXECUTIVE
038477,000117: 16,3203 13207 TCF TVCDAPHS # NO NEED TO RESTART TVCEXECUTIVE
038478,000118:
038479,000119: 16,3204 34322 CAF NINE # 9CS DELAY TO FORCE EXRSTRT TO OCCUR
038480,000120: 16,3205 05236 TC TWIDDLE # BEFORE PITCHDAP, AFTER CMDSOUT
038481,000121: 16,3206 03301 ADRES EXRSTRT
038482,000122: 16,3207 47663 TVCDAPHS CS OCT37776 # CHECK BITS 15 AND 1 OF TVCPHASE TO SEE
038483,000123: 16,3210 71664 MASK TVCPHASE # DAP RESTART LOCATION (-1,1,2,3)
038484,000124: 16,3211 10000 CCS A
038485,000125: 16,3212 13271 TCF FINCOPY # FINISH THE COPYCYCLE FIRST
038486,000126: 16,3213 13220 TCF ENABL1 # JUST PREPARE THE OUTCOUNTERS AND GO
038487,000127:
038488,000128: 16,3214 41664 CS TVCPHASE # TEST FOR TVCPHASE = -2
038489,000129: 16,3215 75000 MASK BIT2 # (THIS INDICATES RESTART OCCURRED
038490,000130: 16,3216 00006 EXTEND # DURING CSM/LM V46 SWITCH-OVER)
038491,000131: 16,3217 13275 BZF TRIM/CMD # NO, TVCPHASE = -1, RSTRT WAS IN TVCINIT
038492,000132:
038493,000133: 16,3220 34772 ENABL1 CAF BIT8 # TVC ENABLE, FOLLOWED BY 40 MS (MIN) WAIT
038494,000134: 16,3221 64767 AD BIT11 # SET BIT FOR OPTICS-DAC-ENABLE ALSO
038495,000135: 16,3222 00006 EXTEND # (ENABL1 ENTERED FROM TVCDAPHS / FINCOPY)
038496,000136: 16,3223 05012 WOR CHAN12
038497,000137: 16,3224 33305 CAF TVCADDR # WAIT, CALLING ENABL2 (BBCON THERE)
038498,000138: 16,3225 54112 TS T5LOC
038499,000139: 16,3226 33311 CAF TVCADDR +4 # 60 MS (TVCEXADR)
038500,000140: 16,3227 54030 TS TIME5
038501,000141:
038502,000142: 16,3230 15336 TCF RESUME
038503,000143:
038504,000144: 16,3231 22016 ENABL2 LXCH BANKRUPT # CONTINUE PREPARATION OF OUTCOUNTERS
038505,000145:
038506,000146: 16,3232 35000 CAF BIT2 # OPTICS ERROR CNTR ENABLE, 4MS MIN WAIT
038507,000147: 16,3233 00006 EXTEND
038508,000148: 16,3234 05012 WOR CHAN12
038509,000149: 16,3235 33307 CAF TVCADDR +2 # WAIT, CALLING CMDSOUT (BBCON THERE)
038510,000150: 16,3236 54112 TS T5LOC
038511,000151: 16,3237 37663 CAF OCT37776 # 20MS
038512,000152: 16,3240 54030 TS TIME5
038513,000153: 16,3241 15340 TCF NOQRSM
038514,000154:
038515,000155: 16,3242 22016 CMDSOUT LXCH BANKRUPT # CONTINUE PREPARATION OF OUTCOUNTERS
038516,000156: 16,3243 00006 EXTEND
038517,000157: 16,3244 22012 QXCH QRUPT
038518,000158:
038519,000159: 16,3245 45003 CS ZERO # MOST RECENT ACTUATOR COMMANDS
038520,000160: 16,3246 61652 AD PCMD # (AVOID +0)
038521,000161: 16,3247 54054 TS TVCPITCH
038522,000162: 16,3250 45003 CS ZERO
038523,000163: 16,3251 61653 AD YCMD
038524,000164: 16,3252 54053 TS TVCYAW
038525,000165:
038526,000166: 16,3253 35062 CAF PRIO6 # RELEASE THE COUNTERS (BITS 11,12)
038527,000167: 16,3254 00006 EXTEND
038528,000168: 16,3255 05014 WOR CHAN14
038529,000169:
038530,000170: 16,3256 11664 PHSCHK2 CCS TVCPHASE # CHECK TVCPHASE AGAIN
038531,000171: 16,3257 13267 TCF JUMPTVC4
038532,000172: 16,3260 13267 TCF JUMPTVC4
038533,000173: 16,3261 10000 CCS A # A CONTAINS THE DIMINISHED ABSOLUTE OF
038534,000174: 16,3262 03265 TC +3 # TVCPHASE (-2 BECOMES +1. -1 BECOMES +0)
038535,000175:
038536,000176: 16,3263 04666 TC POSTJUMP # REPEAT TVC INITIALIZATION
038537,000177: 16,3264 36224 CADR MRCLEAN # (DO NOT RETURN)
038538,000178:
038539,000179: 16,3265 04725 +3 TC IBNKCALL # REPEAT CSM/LM V46 SWITCH-OVER
038540,000180: 16,3266 36407 CADR SWICHOVR +5 # (RETURN TO CHECK FOR STROKE TEST)
038541,000181:
038542,000182: 16,3267 04666 JUMPTVC4 TC POSTJUMP # IF POSITIVE OR ZERO, RESTART AT
038543,000183: 16,3270 36364 CADR TVCINIT4 # TVCINIT4 (ZEROS TVCPHASE, AND
038544,000184: # CALLS TVC DAPS VIA DAPINIT)
038545,000185: 16,3271 51664 FINCOPY INDEX TVCPHASE # PICK UP THE APPROPRIATE COPYCYCLE
038546,000186: 16,3272 33305 CAF TVCCADR
038547,000187: 16,3273 04731 TCR ISWCALL # RE-ENTER THE COPYCYCLE, RETURN AT END
038548,000188: 16,3274 13220 TCF ENABL1 # NOW PREPARE THE OUTCOUNTERS
038549,000189:
038550,000190:
038551,000191: 16,3275 00006 TRIM/CMD EXTEND # TVCDAPON INITIALIZATION NOT COMPLETED,
038552,000192: 16,3276 31411 DCA PACTOFF # EG. P,YCMD MAY NOT BE SET. SET...
038553,000193: 16,3277 53653 DXCH PCMD
038554,000194: 16,3300 13220 TCF ENABL1 # NOW PREPARE THE OUTCOUNTERS
038555,000195:
038556,000196:
038557,000197: 16,3301 51673 EXRSTRT INDEX TVCEXPHS # TVCEXECUTIVE RESTARTS....GO TO
038558,000198: 16,3302 33311 CAF TVCEXADR # APPROPRIATE RESTART POINT
038559,000199: 16,3303 50000 INDEX A
038560,000200: 16,3304 10000 TCF 0
038561,000201:
038562,000202:
038563,000203: # TVC RESTART TABLES.... ORDER IS REQUIRED. HI-ORDER WORDS ONLY, OF 2CADRS, SINCE BBCON IS ALREADY THERE.
038564,000204:
038565,000205: 16,3305 16,3305 TVCADDR = TVCCADR # TABLE OF CADRS, UNUSED LOCS FOR GENADRS
038566,000206: 16,3305 03231 TVCCADR GENADR ENABL2 # (FOR T5 CALL, UNUSED TABLE LOC)
038567,000207: 16,3306 40742 +1 CADR PCOPY +1 # PITCH COPYCYCLE
038568,000208: 16,3307 03242 +2 GENADR CMDSOUT # (FOR T5 CALL, UNUSED TABLE LOC)
038569,000209: 16,3310 41126 +3 CADR YCOPY +1 # YAW COPYCYCLE
038570,000210: 16,3311 37772 TVCEXADR OCT 37772 # (UNUSED TABLE LOC, FILL WITH 60MS, T5)
038571,000211: 16,3312 03077 +1 GENADR TEMPSET # TVCEXECUTIVE RESTART POINTS (ORDERED)
038572,000212: 16,3313 03102 +2 GENADR CORSETUP
038573,000213: 16,3314 03160 +3 GENADR CORCOPY +1
038574,000214: 16,3315 03171 +4 GENADR CNTRCOPY
End of include-file TVCRESTARTS.agc. Parent file is MAIN.agc