Source Code

These source-code files are part of a reconstructed copy of Comanche 67, the Apollo Guidance Computer (AGC) Command Module (CM) software for Apollo 12.

They have been adapted from sources files for Comanche 55, and updated via disassembly of binary dumps of original core rope memory modules, part numbers 2003972-1081, 2003972-1091, 2003972-1111, 2003972-1121, 2003972-1131, and 2003972-1141.

Since only binary dumps (rather than listings) of Comanche 67 are available as source material, all comments and labels are approximate. They have been taken from other AGC programs where possible, or, in some places, written from scratch to match what we believe would have been in the original listing.

040770,000002:                                                                                                  ## Copyright:   Public domain.
040771,000003:                                                                                                  ## Filename:    TVCRESTARTS.agc
040772,000004:                                                                                                  ## Purpose:     A section of Comanche revision 067.
040773,000005:                                                                                                  ##              It is part of the reconstructed source code for the flight
040774,000006:                                                                                                  ##              software for the Command Module's (CM) Apollo Guidance Computer
040775,000007:                                                                                                  ##              (AGC) for Apollo 12. No original listings of this program are
040776,000008:                                                                                                  ##              available; instead, this file was created via dissassembly of
040777,000009:                                                                                                  ##              dumps of Comanche 067 core rope modules and comparison with
040778,000010:                                                                                                  ##              other AGC programs.
040779,000011:                                                                                                  ## Assembler:   yaYUL
040780,000012:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
040781,000013:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
040782,000014:                                                                                                  ## Mod history: 2023-08-16 MAS  Created from Comanche 055.
040783,000015: 
040784,000016:                                                                                                  #  NAME....TVCRESTART PACKAGE, CONSISTING OF REDOTVC, ENABL1, 2, CMDSOUT, PHSCHK2, ETC.
040785,000017:                                                                                                  #  LOG SECTION...TVCRESTARTS                     SUBROUTINE...DAPCSM
040786,000018:                                                                                                  #  MODIFIED BY SCHLUNDT                          21 OCTOBER 1968
040787,000019: 
040788,000020:                                                                                                  #  FUNCTIONAL DESCRIPTION....
040789,000021: 
040790,000022:                                                                                                  #       *RESTART-PROOFS THE TVC DAPS, INCLUDING PITCHDAP, YAWDAP,
040791,000023:                                                                                                  #        TVCEXECUTIVE, ROLLDAP, TVCINIT4, TVCDAPON, AND CSM/.M V46 SWTCHOVR.
040792,000024: 
040793,000025:                                                                                                  #       *TVC RESTARTS DESERVE SPECIAL CONSIDERATION IN SEVERAL AREAS.
040794,000026:                                                                                                  #        RESTART DOWN-TIME IS IMPORTANT BECAUSE OF THE TRANSIENTS INTRODUCED
040795,000027:                                                                                                  #        BY THE THRUST VECTOR RETURN TO THE ACTUATOR MECHANICAL NULLS
040796,000028:                                                                                                  #        FOLLOWING TVC- AND OPTICS-ERROR-COUNTER-DISENABLES (CHANNEL 12).
040797,000029:                                                                                                  #        TVC USES A MIXTURE OF WAITLIST, T5, T6, AND JOB CALLS.  THERE IS
040798,000030:                                                                                                  #        FILTER MEMORY (UP TO 6TH ORDER) TO BE PROTECTED IF WILD TRANSIENTS
040799,000031:                                                                                                  #        ARE TO BE AVOIDED.  COUNTERS ARE INVOLVED FOR ONE-SHOT
040800,000032:                                                                                                  #        CORRECTIONS AND GAIN UPDATES.  THE GIMBAL TRIM ESTIMATORS AND THE
040801,000033:                                                                                                  #        BODY AXIS ATTITUDE ERROR INTEGRATORS INVOLVE DIGITAL SUMMATION.
040802,000034:                                                                                                  #        DIGITAL DIFFERENTIATORS ARE INVOLVED IN THE BODY AXIS RATE ESTIMA-
040803,000035:                                                                                                  #        TIONS AND IN THE OUTPUTTING OF ACTUATOR COMMANDS.  THERE IS AN
040804,000036:                                                                                                  #        OFFSET-TRACKER-FILTER TO PROTECT.  ETC., ETC.
040805,000037: 
040806,000038:                                                                                                  #       *THOSE QUANTITIES WHICH MUST BE PROTECTED ARE STORED IN TEMPORARY
040807,000039:                                                                                                  #        REGISTERS AS THEY ARE COMPUTED, FOR UPDATING THE REAL REGISTERS
040808,000040:                                                                                                  #        DURING COPYCYCLES.
040809,000041: 
040810,000042:                                                                                                  #       *THE SEVERAL COPYCYCLES ARE EACH PROTECTED BY PHASE POINTS AT THEIR
040811,000043:                                                                                                  #        BEGINNING AND AT THEIR TERMINATION.  THE PHASE POINTS ARE SIMPLY
040812,000044:                                                                                                  #        ..INCR.. INSTRUCTIONS, EITHER ..INCR TVCEXPHS.. FOR COPYCYCLES
040813,000045:                                                                                                  #        IN THE TVCEXECUTIVE, OR ..INCR TVCPHASE.. FOR THE PITCH AND YAW
040814,000046:                                                                                                  #        COPYCYCLES.  INDEXING ON EACH OF THESE POINTERS THEN PERMITS A
040815,000047:                                                                                                  #        RETURN TO THE APPROPRIATE RESTART POINTS.
040816,000048: 
040817,000049:                                                                                                  #       *IF A RESTART OCCURS DURING EITHER COPYCYCLE, THAT COPYCYCLE IS
040818,000050:                                                                                                  #        COMPLETED.  THEN THE NORMAL TVCINIT4....DAPINIT....PITCHDAP STARTUP
040819,000051:                                                                                                  #        SEQUENCE IS CALLED UPON TO GET THINGS GOING AGAIN.
040820,000052: 
040821,000053:                                                                                                  #       *TVC-ENABLE AND OPTICS-ERROR-COUNTER ENABLE MUST BE SET ASAP
040822,000054:                                                                                                  #        (ALLOWING FOR PROCEDURAL DELAYS).  THEN THE ENGINES ARE COMMANDED
040823,000055:                                                                                                  #        TO THE P,YACTOFF TRIM VALUES.  THE DAPS ARE THEN READY TO GO ON THE
040824,000056:                                                                                                  #        AIR, WITH THE REGULAR STARTUP SEQUENCE, EITHER AT MRCLEAN FOR A
040825,000057:                                                                                                  #        COMPLETE INITIALIZATION OR AT TVCINIT4 FOR A PARTIAL INITIALIZATION
040826,000058: 
040827,000059:                                                                                                  #       *FOR RESTARTS PRIOR TO THE SETTING OF THE T5 BITS AT DOTVCON THE
040828,000060:                                                                                                  #        PRE40.6 SECTION OF S40.6 TAKES CARE OF RE-ESTABLISHING TRIMS.
040829,000061: 
040830,000062:                                                                                                  #       *IF A RESTART OCCURS DURING THE TVCEXEC....TVCEXFIN SEQUENCE THE
040831,000063:                                                                                                  #        COMPUTATIONS WILL BE COMPLETED, STARTING AT THE APPROPRIATE RESTART
040832,000064:                                                                                                  #        POINT, AFTER THE DAPS ARE READY TO GO ON THE AIR.
040833,000065: 
040834,000066:                                                                                                  #       *IF A RESTART OCCURS PRIOR TO TVCINIT4 (TVCPHASE = -1) E.G. DURING
040835,000067:                                                                                                  #        THE EARLY DAP INITIALIZATION PHASE, THE DAP STARTUP SEQUENCE IS
040836,000068:                                                                                                  #        ENTERED AT MRCLEAN FOR A FULL INITIALIZATION.
040837,000069: 
040838,000070:                                                                                                  #       *FOR RESTARTS DURING CSM/LM V46 SWITCH-OVER, TVCPHASE IS SET TO -2.
040839,000071:                                                                                                  #        AND THE RESTART LOGIC GOES BACK TO REDO SWITCH-OVER (AFTER THE
040840,000072:                                                                                                  #        NORMAL DAP RESTART SEQUENCE IS FOLLOWED).
040841,000073: 
040842,000074:                                                                                                  #       *RESTARTS ARE NOT CRITICAL TO THE ROLL DAP PERFORMANCES HENCE THE
040843,000075:                                                                                                  #        THE ROLL DAP IS MERELY RESTARTED.
040844,000076: 
040845,000077:                                                                                                  #       *RESTARTS DURING A STROKE TEST (STROKER IS NON-ZERO) WILL CAUSE THE
040846,000078:                                                                                                  #        STROKE TEST TO BE TERMINATED.  A NEW V68 ENTRY WILL BE REQUIRED
040847,000079:                                                                                                  #        TO GET IT GOING AGAIN (NO AUTOMATIC RESTART).
040848,000080:                                                                                                  #   
040849,000081:                                                                                                  #       *REDOTVC IS REACHED FOLLOWING ANY RESTART WHICH FINDS THE T5 BITS
040850,000082:                                                                                                  #        (BITS 15,14 OF FLAGWRD6) SET FOR TVC.  DOTVCON SETS TVCPHASE = -1
040851,000083:                                                                                                  #        AND TVC EXPHS = 0 JUST BEFORE SETTING THESE BITS, JUST BEFORE
040852,000084:                                                                                                  #        MAKING THE T5 CALL TO TVCDAPON.  ON A NORMAL SHUTDOWN DOTVCRCS
040853,000085:                                                                                                  #        CALLS RCSDAPON, WHICH RESETS THE T5 BITS FOR RCS.
040854,000086: 
040855,000087:                                                                                                  #  CALLING SEQUENCE....T5, IN PARTICULAR BY ELRSKIP OF FRESH START/RESTART
040856,000088: 
040857,000089:                                                                                                  #  NORMAL EXIT MODES....RESUME, NOQRSM, POSTJUMP (TO TVCINIT4 OR MRCLEAN)
040858,000090: 
040859,000091:                                                                                                  #  ALARM OR ABORT EXIT MODES....NONE
040860,000092: 
040861,000093:                                                                                                  #  SUBROUTINES CALLED....
040862,000094: 
040863,000095:                                                                                                  #       *PCOPY+1, YCOPY+1 (PITCH AND YAW COPYCYCLES)
040864,000096:                                                                                                  #       *ENABLE1,2, CMDSOUT (RE-ESTABLISH ACTUATOR TRIMS)
040865,000097:                                                                                                  #       *MRCLEAN OR TVCINIT4 (TVCDAP INITIALIZATIONS)
040866,000098:                                                                                                  #       *SWICHOVR +5 (CSM/LM V46 SWITCH-OVER)
040867,000099:                                                                                                  #       *EXRSTRT AND TVCEXECUTIVE PHASE POINTS 1 THRU 6
040868,000100:                                                                                                  #       *WAITLIST, IBNKCALL, POSTJUMP, ISWCALL
040869,000101: 
040870,000102:                                                                                                  #  OTHER INTERFACES....DOTVCON AND RCSDAPON (T5 BITS), ELRSKIP (CALLS IT)
040871,000103: 
040872,000104:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED....
040873,000105: 
040874,000106:                                                                                                  #       *T5 BITS (1,0), TVCPHASE (-2,-1,0,1,2,3), TVCEXPHS (1 THRU 6)
040875,000107:                                                                                                  #       *TVC DAP VARIABLES
040876,000108:                                                                                                  #       *OPERATIONS PERFORMED BY REDOTVC ARE BASED ON THE ASSUMPTION THAT
040877,000109:                                                                                                  #        THE TVC DAPS ARE RUNNING NORMALLY
040878,000110: 
040879,000111:                                                                                                  #  OUTPUT....
040880,000112: 
040881,000113:                                                                                                  #       *PITCH AND YAW TVC DAP COPYCYCLES COMPLETED IF INTERUPTED
040882,000114:                                                                                                  #       *TVCEXECUTIVE COMPLETED IF INTERUPTED
040883,000115:                                                                                                  #       *STROKE TEST TERMINATED IF INTERRUPTED
040884,000116:                                                                                                  #       *CSM/LM V46 SWITCH-OVER REPEATED IF INTERRUPTED
040885,000117:                                                                                                  #       *ACTUATOR TRIMS RE-ESTABLISHED (ACTUATORS BACK ON THE AIR)
040886,000118:                                                                                                  #       *TVC DAP INITIALIZATION AS REQUIRED
040887,000119:                                                                                                  #       *ALL TVC DAP OPERATIONS ON THE AIR
040888,000120: 
040889,000121:                                                                                                  #  DEBRIS....TVC TEMPORARIES IN EBANK6
040890,000122: 
040891,000123: 
040892,000124: 16,3212                                           BANK     16                                    
040893,000125: 16,2000                                           SETLOC   DAPROLL                               
040894,000126: 16,2000                                           BANK                                           
040895,000127: 16,3212  E6,1644                                  EBANK=   TVCPHASE                              
040896,000128: 16,3212                                           COUNT*   $$/RSRT                               
040897,000129: 
040898,000130: 16,3212           22016        REDOTVC            LXCH     BANKRUPT                              #  TVC RESTART PACKAGE
040899,000131: 16,3213           00006                           EXTEND                                         
040900,000132: 16,3214           22012                           QXCH     QRUPT                                 #  (..TCR.. IN ..FINCOPY..)
040901,000133: 
040902,000134: 16,3215           11653        EXECPHS            CCS      TVCEXPHS                              #  CHECK TVCEXECUTIVE PHASE
040903,000135: 16,3216           13220                           TCF      +2                                    #        MUST RESTART TVCEXECUTIVE
040904,000136: 16,3217           13224                           TCF      TVCDAPHS                              #        NO NEED TO RESTART TVCEXECUTIVE
040905,000137: 
040906,000138: 16,3220           34334                           CAF      NINE                                  #  9CS DELAY TO FORCE EXRSTRT TO OCCUR
040907,000139: 16,3221           05261                           TC       WAITLIST                              #        BEFORE PITCHDAP, AFTER CMDSOUT
040908,000140: 16,3222  E6,1653                                  EBANK=   TVCEXPHS                              
040909,000141: 16,3222           03325 34066                     2CADR    EXRSTRT                               
040910,000142: 
040911,000143: 16,3224           47700        TVCDAPHS           CS       OCT37776                              #  CHECK BITS 15 AND 1 OF TVCPHASE TO SEE
040912,000144: 16,3225           71644                           MASK     TVCPHASE                              #        DAP RESTART LOCATION (-1,1,2,3)
040913,000145: 16,3226           10000                           CCS      A                                     
040914,000146: 16,3227           13312                           TCF      FINCOPY                               #        FINISH THE COPYCYCLE FIRST
040915,000147: 16,3230           13235                           TCF      ENABL1                                #        JUST PREPARE THE OUTCOUNTERS AND GO
040916,000148: 
040917,000149: 16,3231           41644                           CS       TVCPHASE                              #  TEST FOR TVCPHASE = -2
040918,000150: 16,3232           75032                           MASK     BIT2                                  #        (THIS INDICATES RESTART OCCURRED
040919,000151: 16,3233           00006                           EXTEND                                         #         DURING CSM/LM V46 SWITCH-OVER)
040920,000152: 16,3234           13316                           BZF      TRIM/CMD                              #  NO, TVCPHASE = -1, RSTRT WAS IN TVCINIT
040921,000153: 
040922,000154: 16,3235           35024        ENABL1             CAF      BIT8                                  #  TVC ENABLE, FOLLOWED BY 40 MS (MIN) WAIT
040923,000155: 16,3236           65021                           AD       BIT11                                 #        SET BIT FOR OPTICS-DAC-ENABLE ALSO
040924,000156: 16,3237           00006                           EXTEND                                         #        (ENABL1 ENTERED FROM TVCDAPHS / FINCOPY)
040925,000157: 16,3240           05012                           WOR      CHAN12                                
040926,000158: 16,3241           33331                           CAF      TVCADDR                               #  WAIT, CALLING ENABL2 (BBCON THERE)
040927,000159: 16,3242           55312                           TS       T5LOC                                 
040928,000160: 16,3243           33335                           CAF      TVCADDR    +4                         #        60 MS (TVCEXADR)
040929,000161: 16,3244           54030                           TS       TIME5                                 
040930,000162: 
040931,000163: 16,3245           15347                           TCF      RESUME                                
040932,000164: 
040933,000165: 16,3246           22016        ENABL2             LXCH     BANKRUPT                              #  CONTINUE PREPARATION OF OUTCOUNTERS
040934,000166: 
040935,000167: 16,3247           35032                           CAF      BIT2                                  #  OPTICS ERROR CNTR ENABLE, 4MS MIN WAIT
040936,000168: 16,3250           00006                           EXTEND                                         
040937,000169: 16,3251           05012                           WOR      CHAN12                                
040938,000170: 16,3252           33333                           CAF      TVCADDR    +2                         #  WAIT, CALLING CMDSOUT (BBCON THERE)
040939,000171: 16,3253           55312                           TS       T5LOC                                 
040940,000172: 16,3254           37700                           CAF      OCT37776                              #        20MS
040941,000173: 16,3255           54030                           TS       TIME5                                 
040942,000174: 
040943,000175: 16,3256           15351                           TCF      NOQRSM                                
040944,000176: 
040945,000177: 16,3257           22016        CMDSOUT            LXCH     BANKRUPT                              #  CONTINUE PREPARATION OF OUTCOUNTERS
040946,000178: 16,3260           00006                           EXTEND                                         
040947,000179: 16,3261           22012                           QXCH     QRUPT                                 
040948,000180: 
040949,000181: 16,3262           45035                           CS       ZERO                                  #  MOST RECENT ACTUATOR COMMANDS
040950,000182: 16,3263           61623                           AD       PCMD                                  #        (AVOID +0)
040951,000183: 16,3264           54054                           TS       TVCPITCH                              
040952,000184: 16,3265           45035                           CS       ZERO                                  
040953,000185: 16,3266           61624                           AD       YCMD                                  
040954,000186: 16,3267           54053                           TS       TVCYAW                                
040955,000187: 
040956,000188: 16,3270           35076                           CAF      PRIO6                                 #  RELEASE THE COUNTERS (BITS 11,12)
040957,000189: 16,3271           00006                           EXTEND                                         
040958,000190: 16,3272           05014                           WOR      CHAN14                                
040959,000191: 
040960,000192: 16,3273           11644        PHSCHK2            CCS      TVCPHASE                              #  CHECK TVCPHASE AGAIN
040961,000193: 16,3274           13304                           TCF      CHKSTRK                               
040962,000194: 16,3275           13304                           TCF      CHKSTRK                               
040963,000195: 16,3276           10000                           CCS      A                                     #  A CONTAINS THE DIMINISHED ABSOLUTE OF
040964,000196: 16,3277           03302                           TC       +3                                    #  TVCPHASE (-2 BECOMES +1. -1 BECOMES +0)
040965,000197: 
040966,000198: 16,3300           04715                           TC       POSTJUMP                              #        REPEAT TVC INITIALIZATION
040967,000199: 16,3301           36210                           CADR     MRCLEAN                               #        (DO NOT RETURN)
040968,000200: 
040969,000201: 16,3302           04754                 +3        TC       IBNKCALL                              #        REPEAT CSM/LM V46 SWITCH-OVER
040970,000202: 16,3303           36417                           CADR     SWICHOVR   +5                         #        (RETURN TO CHECK FOR STROKE TEST)
040971,000203: 
040972,000204: 16,3304           11574        CHKSTRK            CCS      STROKER                               #  CHECK FOR STROKE TEST IN PROGRESS
040973,000205: 16,3305           13322                           TCF      TSTINITJ                              #  YES, KILL IT
040974,000206: 16,3306           13310                           TCF      +2                                    #  NO, PROCEED
040975,000207: 16,3307           13322                           TCF      TSTINITJ                              #  YES, KILL IT
040976,000208: 
040977,000209: 16,3310           04715                 +4        TC       POSTJUMP                              #        IF POSITIVE OR ZERO, RESTART AT
040978,000210: 16,3311           36362                           CADR     TVCINIT4                              #                TVCINIT4 (ZEROS TVCPHASE, AND
040979,000211:                                                                                                  #                CALLS TVC DAPS VIA DAPINIT)
040980,000212: 16,3312           51644        FINCOPY            INDEX    TVCPHASE                              #  PICK UP THE APPROPRIATE COPYCYCLE
040981,000213: 16,3313           33331                           CAF      TVCCADR                               
040982,000214: 16,3314           04760                           TCR      ISWCALL                               #  RE-ENTER THE COPYCYCLE, RETURN AT END
040983,000215: 16,3315           13235                           TCF      ENABL1                                #  NOW PREPARE THE OUTCOUNTERS
040984,000216: 
040985,000217: 16,3316           00006        TRIM/CMD           EXTEND                                         #  TVCDAPON INITIALIZATION NOT COMPLETED,
040986,000218: 16,3317           31424                           DCA      PACTOFF                               #        EG. P,YCMD MAY NOT BE SET.  SET...
040987,000219: 16,3320           53624                           DXCH     PCMD                                  
040988,000220: 16,3321           13235                           TCF      ENABL1                                #  NOW PREPARE THE OUTCOUNTERS
040989,000221: 
040990,000222: 16,3322           35035        TSTINITJ           CAF      ZERO                                  #  DISABLE STROKE TEST (-0 SHOWS PRIOR V68)
040991,000223: 16,3323           55574                           TS       STROKER                               #  (+0 MEANS NEW V68 REQUIRED FOR STARTUP)
040992,000224: 
040993,000225: 16,3324           13310                           TCF      CHKSTRK    +4                         
040994,000226: 
040995,000227: 16,3325           51653        EXRSTRT            INDEX    TVCEXPHS                              #  TVCEXECUTIVE RESTARTS....GO TO
040996,000228: 16,3326           33335                           CAF      TVCEXADR                              #        APPROPRIATE RESTART POINT
040997,000229: 16,3327           50000                           INDEX    A                                     
040998,000230: 16,3330           10000                           TCF      0                                     
040999,000231: 
041000,000232:                                                                                                  #  TVC RESTART TABLES.... ORDER IS REQUIRED.  HI-ORDER WORDS ONLY, OF 2CADRS, SINCE BBCON IS ALREADY THERE.
041001,000233: 
041002,000234: 16,3331  16,3331               TVCADDR            =        TVCCADR                               #  TABLE OF CADRS, UNUSED LOCS FOR GENADRS
041003,000235: 16,3331           03246        TVCCADR            GENADR   ENABL2                                #  (FOR T5 CALL, UNUSED TABLE LOC)
041004,000236: 16,3332           40714                 +1        CADR     PCOPY      +1                         #  PITCH COPYCYCLE
041005,000237: 16,3333           03257                 +2        GENADR   CMDSOUT                               #  (FOR T5 CALL, UNUSED TABLE LOC)
041006,000238: 16,3334           41104                 +3        CADR     YCOPY      +1                         #  YAW COPYCYCLE
041007,000239: 16,3335           37772        TVCEXADR           OCT      37772                                 #  (UNUSED TABLE LOC, FILL WITH 60MS, T5)
041008,000240: 16,3336           03055                 +1        GENADR   EXECCOPY   +1                         #  TVCEXECUTIVE RESTART POINTS (ORDERED)
041009,000241: 16,3337           03063                 +2        GENADR   1SHOTCHK                              
041010,000242: 16,3340           03112                 +3        GENADR   TEMPSET                               
041011,000243: 16,3341           03115                 +4        GENADR   CORSETUP                              
041012,000244: 16,3342           03173                 +5        GENADR   CORCOPY    +1                         
041013,000245: 16,3343           03204                 +6        GENADR   CNTRCOPY                              

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