Source Code

These source-code files were obtained by digitally photographing an Artemis 72 (Apollo 15-17 Command Module) program listing from a private collection and then modifying pre-existing Comanche 55 (Apollo 11) source files to incorporate changes. Photography was by Ron Burkey, and transcription was performed by a team of volunteers. Note that the page images presented online are of reduced quality, and that additional images may be available. Report any conversion errors or legibility problems in page images to info@sandroid.org. Notations on the program listing read, in part:

	GAP: ASSEMBLE REVISION 072 OF AGC PROGRAM ARTEMIS 
	BY NASA 2021114-011 11:40 FEB. 26, 1971
Note that the date is the date of the printout, not the date of the program revision.

042366,000002:                                                                                                  ## Copyright:   Public domain.
042367,000003:                                                                                                  ## Filename:    TVCRESTARTS.agc
042368,000004:                                                                                                  ## Purpose:     Part of the source code for Artemis (i.e., Colossus 3),
042369,000005:                                                                                                  ##              build 072.  This is for the Command Module's (CM)
042370,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for
042371,000007:                                                                                                  ##              Apollo 15-17.
042372,000008:                                                                                                  ## Assembler:   yaYUL
042373,000009:                                                                                                  ## Contact:     Steve Case <case1780@adelphia.net>
042374,000010:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
042375,000011:                                                                                                  ## Page Scans:  www.ibiblio.org/apollo/ScansForConversion/Artemis072/
042376,000012:                                                                                                  ## Mod history: 2009-09-13 SMC  Adapted from Comanche055 files.
042377,000013:                                                                                                  ##              2009-09-14 JL   Fix typos. Fix page numbers. Remove change comments. Restore hard tabs.
042378,000014:                                                                                                  ##              2010-02-20 RSB  Un-##'d this header.
042379,000015:                                                                                                  ##              2017-02-09 RSB  Proofed comment text by diff'ing vs Comanche 55
042380,000016:                                                                                                  ##                              and/or octopus/ProoferComments as most-appropriate.
042381,000017: 

Page 959

042383,000019: 
042384,000020:                                                                                                  #  NAME....TVCRESTART PACKAGE,  CONSISTING OF REDOTVC, ENABL1, 2, CMDSOUT, PHSCHK2, ETC.
042385,000021:                                                                                                  #  LOG SECTION...TVCRESTARTS                     SUBROUTINE...DAPCSM
042386,000022:                                                                                                  #  MODIFIED BY SCHLUNDT                          21 OCTOBER 1968
042387,000023:                                                                                                  #  MODIFIED BY BEALS TO ELIMINATE CSMMASS UPDATE LOGIC (NOW DONE IN S40.8)
042388,000024:                                                                                                  #  FUNCTIONAL DESCRIPTION....
042389,000025: 
042390,000026:                                                                                                  #       *RESTART-PROOFS THE TVC DAPS, INCLUDING PITCHDAP, YAWDAP,
042391,000027:                                                                                                  #        TVCEXECUTIVE, ROLLDAP, TVCINIT4, TVCDAPON, AND CSM/.M V46 SWTCHOVR.
042392,000028:                                                                                                  #       *TVC RESTARTS DESERVE SPECIAL CONSIDERATION IN SEVERAL AREAS.
042393,000029:                                                                                                  #        RESTART DOWN-TIME IS IMPORTANT BECAUSE OF THE TRANSIENTS INTRODUCED
042394,000030:                                                                                                  #        BY THE THRUST VECTOR RETURN TO THE ACTUATOR MECHANICAL NULLS
042395,000031:                                                                                                  #        FOLLOWING TVC- AND OPTICS-ERROR-COUNTER-DISENABLES (CHANNEL 12).
042396,000032:                                                                                                  #        TVC    USES A MIXTURE OF WAITLIST, T5, T6, AND JOB CALLS. THERE IS
042397,000033:                                                                                                  #        FILTER MEMORY (UP TO 6TH ORDER) TO BE PROTECTED IF WILD TRANSIENTS
042398,000034:                                                                                                  #        ARE TO BE AVOIDED. COUNTERS ARE INVOLVED FOR ONE-SHOT
042399,000035:                                                                                                  #        CORRECTIONS AND GAIN UPDATES. THE GIMBAL TRIM ESTIMATORS AND THE
042400,000036:                                                                                                  #        BODY AXIS ATTITUDE ERROR INTEGRATORS INVOLVE DIGITAL SUMMATION.
042401,000037:                                                                                                  #        DIGITAL DIFFERENTIATORS ARE INVOLVED IN THE BODY AXIS RATE ESTIMA-
042402,000038:                                                                                                  #        TIONS AND IN THE OUTPUTTING OF ACTUATOR COMMANDS. THERE IS AN
042403,000039:                                                                                                  #        OFFSET-TRACKER-FILTER TO PROTECT. ETC., ETC.
042404,000040:                                                                                                  #       *THOSE QUANTITIES WHICH MUST BE PROTECTED ARE STORED IN TEMPORARY
042405,000041:                                                                                                  #        REGISTERS AS THEY ARE COMPUTED, FOR UPDATING THE REAL REGISTERS
042406,000042:                                                                                                  #        DURING COPYCYCLES.
042407,000043:                                                                                                  #       *THE SEVERAL COPYCYCLES ARE EACH PROTECTED BY PHASE POINTS AT THEIR
042408,000044:                                                                                                  #        BEGINNING AND AT THEIR TERMINATION. THE PHASE POINTS ARE SIMPLY
042409,000045:                                                                                                  #        ..INCR.. INSTRUCTIONS, EITHER ..INCR TVCEXPHS.. FOR COPYCYCLES
042410,000046:                                                                                                  #        IN THE TVCEXECUTIVE, OR ..INCR TVCPHASE.. FOR THE PITCH AND YAW
042411,000047:                                                                                                  #        COPYCYCLES. INDEXING ON EACH OF THESE POINTERS THEN PERMITS A
042412,000048:                                                                                                  #        RETURN TO THE APPROPRIATE RESTART POINTS.
042413,000049:                                                                                                  #       *IF A RESTART OCCURS DURING EITHER COPYCYCLE, THAT COPYCYCLE IS
042414,000050:                                                                                                  #        COMPLETED. THEN THE NORMAL TVCINIT4....DAPINIT....PITCHDAP STARTUP
042415,000051:                                                                                                  #        SEQUENCE IS CALLED UPON TO GET THINGS GOING AGAIN.
042416,000052:                                                                                                  #       *TVC-ENABLE AND OPTICS-ERROR-COUNTER ENABLE MUST BE SET ASAP
042417,000053:                                                                                                  #        (ALLOWING FOR PROCEDURAL DELAYS). THEN THE ENGINES ARE COMMANDED
042418,000054:                                                                                                  #        TO THE P,YACTOFF TRIM VALUES. THE DAPS ARE THEN READY TO GO ON THE
042419,000055:                                                                                                  #        AIR, WITH THE REGULAR STARTUP SEQUENCE, EITHER AT MRCLEAN FOR A
042420,000056:                                                                                                  #        COMPLETE INITIALIZATION OR AT TVCINIT4 FOR A PARTIAL INITIALIZATION
042421,000057:                                                                                                  #       *FOR RESTARTS PRIOR TO THE SETTING OF THE T5 BITS AT DOTVCON THE
042422,000058:                                                                                                  #        PRE40.6 SECTION OF S40.6 TAKES CARE OF RE-ESTABLISHING TRIMS.
042423,000059:                                                                                                  #       *IF A RESTART OCCURS DURING THE TVCEXEC....TVCEXFIN SEQUENCE THE
042424,000060:                                                                                                  #        COMPUTATIONS WILL BE COMPLETED, STARTING AT THE APPROPRIATE RESTART
042425,000061:                                                                                                  #        POINT, AFTER THE DAPS ARE READY TO GO ON THE AIR.
042426,000062:                                                                                                  #       *IF A RESTART OCCURS PRIOR TO TVCINIT4 (TVCPHASE = -1) E.G. DURING
042427,000063:                                                                                                  #        THE EARLY DAP INITIALIZATION PHASE, THE DAP STARTUP SEQUENCE IS
042428,000064:                                                                                                  #        ENTERED AT MRCLEAN FOR A FULL INITIALIZATION.
042429,000065:                                                                                                  #       *FOR RESTARTS DURING CSM/LM V46 SWITCH-OVER, TVCPHASE IS SET TO -2.
042430,000066:                                                                                                  #        AND THE RESTART LOGIC GOES BACK TO REDO SWITCH-OVER (AFTER THE
042431,000067:                                                                                                  #        NORMAL DAP RESTART SEQUENCE IS FOLLOWED).
042432,000068:                                                                                                  #       *RESTARTS ARE NOT CRITICAL TO THE ROLL DAP PERFORMANCES HENCE THE
042433,000069:                                                                                                  #        THE ROLL DAP IS MERELY RESTARTED.

Page 960

042435,000071:                                                                                                  #       *REDOTVC IS REACHED FOLLOWING ANY RESTART WHICH FINDS THE T5 BITS
042436,000072:                                                                                                  #        (BITS 15,14 OF FLAGWRD6) SET FOR TVC. DOTVCON SETS TVCPHASE = -1
042437,000073:                                                                                                  #        AND TVC EXPHS = 0 JUST BEFORE SETTING THESE BITS, JUST BEFORE
042438,000074:                                                                                                  #        MAKING THE T5 CALL TO TVCDAPON. ON A NORMAL SHUTDOWN DOTVCRCS
042439,000075:                                                                                                  #        CALLS RCSDAPON, WHICH RESETS THE T5 BITS FOR RCS.
042440,000076:                                                                                                  #  CALLING SEQUENCE....T5, IN PARTICULAR BY ELRSKIP OF FRESH START/RESTART
042441,000077: 
042442,000078:                                                                                                  #  NORMAL EXIT MODES....RESUME, NOQRSM, POSTJUMP (TO TVCINIT4 OR MRCLEAN)
042443,000079: 
042444,000080:                                                                                                  #  ALARM OR ABORT EXIT MODES....NONE
042445,000081: 
042446,000082:                                                                                                  #  SUBROUTINES CALLED....
042447,000083: 
042448,000084:                                                                                                  #       *PCOPY+1, YCOPY+1 (PITCH AND YAW COPYCYCLES)
042449,000085:                                                                                                  #       *ENABLE1,2, CMDSOUT (RE-ESTABLISH ACTUATOR TRIMS)
042450,000086:                                                                                                  #       *MRCLEAN OR TVCINIT4 (TVCDAP INITIALIZATIONS)
042451,000087:                                                                                                  #       *SWICHOVR +5  (CSM/LM V46 SWITCH-OVER)
042452,000088:                                                                                                  #       *EXRSTRT AND TVCEXECUTIVE PHASE POINTS 1 THRU 6
042453,000089:                                                                                                  #       *WAITLIST, IBNKCALL, POSTJUMP, ISWCALL
042454,000090: 
042455,000091:                                                                                                  #  OTHER INTERFACES....DOTVCON AND RCSDAPON (T5 BITS), ELRSKIP (CALLS IT)
042456,000092:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED....
042457,000093: 
042458,000094:                                                                                                  #       *T5 BITS (1,0), TVCPHASE (-2,-1,0,1,2,3), TVCEXPHS (1 THRU 6)
042459,000095:                                                                                                  #       *TVC DAP VARIABLES
042460,000096:                                                                                                  #       *OPERATIONS PERFORMED BY REDOTVC ARE BASED ON THE ASSUMPTION THAT
042461,000097:                                                                                                  #        THE TVC DAPS ARE RUNNING NORMALLY
042462,000098: 
042463,000099:                                                                                                  #  OUTPUT....
042464,000100: 
042465,000101:                                                                                                  #       *PITCH AND YAW TVC DAP COPYCYCLES COMPLETED IF INTERUPTED
042466,000102:                                                                                                  #       *TVCEXECUTIVE COMPLETED IF INTERUPTED
042467,000103:                                                                                                  #       *CSM/LM V46 SWITCH-OVER REPEATED IF INTERRUPTED
042468,000104:                                                                                                  #       *ACTUATOR TRIMS RE-ESTABLISHED (ACTUATORS BACK ON THE AIR)
042469,000105:                                                                                                  #       *TVC DAP INITIALIZATION AS REQUIRED
042470,000106:                                                                                                  #       *ALL TVC DAP OPERATIONS ON THE AIR
042471,000107: 
042472,000108:                                                                                                  #  DEBRIS....TVC TEMPORARIES IN EBANK6
042473,000109: 

Page 961

042475,000111: 16,2000                                           SETLOC   DAPROLL                               
042476,000112: 16,2000                                           BANK                                           
042477,000113: 16,3222  E6,1635                                  EBANK=   TVCPHASE                              
042478,000114: 16,3222                                           COUNT*   $$/RSRT                               
042479,000115: 
042480,000116: 16,3222           22016        REDOTVC            LXCH     BANKRUPT                              #  TVC RESTART PACKAGE
042481,000117: 16,3223           00006                           EXTEND                                         
042482,000118: 16,3224           22012                           QXCH     QRUPT                                 #  (  ..TCR..  IN  ..FINCOPY..  )
042483,000119: 
042484,000120: 16,3225           11644        EXECPHS            CCS      TVCEXPHS                              #  CHECK TVCEXECUTIVE PHASE
042485,000121: 16,3226           13230                           TCF      +2                                    #        MUST RESTART TVCEXECUTIVE
042486,000122: 16,3227           13233                           TCF      TVCDAPHS                              #        NO NEED TO RESTART TVCEXECUTIVE
042487,000123: 
042488,000124: 16,3230           34322                           CAF      NINE                                  #  9CS DELAY TO FORCE EXRSTRT TO OCCUR
042489,000125: 16,3231           05223                           TC       TWIDDLE                               #        BEFORE PITCHDAP, AFTER CMDSOUT
042490,000126: 16,3232           03325                           ADRES    EXRSTRT                               
042491,000127: 16,3233           47663        TVCDAPHS           CS       OCT37776                              #  CHECK BITS 15 AND 1 OF TVCPHASE TO SEE
042492,000128: 16,3234           71635                           MASK     TVCPHASE                              #        DAP RESTART LOCATION (-1,1,2,3)
042493,000129: 16,3235           10000                           CCS      A                                     
042494,000130: 16,3236           13315                           TCF      FINCOPY                               #        FINISH THE COPYCYCLE FIRST
042495,000131: 16,3237           13244                           TCF      ENABL1                                #        JUST PREPARE THE OUTCOUNTERS AND GO
042496,000132: 
042497,000133: 16,3240           41635                           CS       TVCPHASE                              #  TEST FOR TVCPHASE = -2
042498,000134: 16,3241           74767                           MASK     BIT2                                  #        (THIS INDICATES RESTART OCCURRED
042499,000135: 16,3242           00006                           EXTEND                                         #        DURING CSM/LM V46 SWITCH-OVER)
042500,000136: 16,3243           13321                           BZF      TRIM/CMD                              #  NO, TVCPHASE = -1, RSTRT WAS IN TVCINIT
042501,000137: 
042502,000138: 16,3244           34761        ENABL1             CAF      BIT8                                  #  TVC ENABLE, FOLLOWED BY 40 MS (MIN) WAIT
042503,000139: 16,3245           64756                           AD       BIT11                                 #  SET BIT FOR OPTICS-DAC-ENABLE ALSO
042504,000140: 16,3246           00006                           EXTEND                                         #  (ENABL1 ENTERED FROM TVCDAPHS / FINCOPY)
042505,000141: 16,3247           05012                           WOR      CHAN12                                
042506,000142: 16,3250           33331                           CAF      TVCADDR                               #  WAIT,  CALLING ENABL2  (BBCON THERE)
042507,000143: 16,3251           54112                           TS       T5LOC                                 
042508,000144: 16,3252           33335                           CAF      TVCADDR    +4                         #        60 MS  (TVCEXADR)
042509,000145: 16,3253           54030                           TS       TIME5                                 
042510,000146: 
042511,000147: 16,3254           15323                           TCF      RESUME                                
042512,000148: 
042513,000149: 16,3255           22016        ENABL2             LXCH     BANKRUPT                              #  CONTINUE PREPARATION OF OUTCOUNTERS
042514,000150: 
042515,000151: 16,3256           34767                           CAF      BIT2                                  #  OPTICS ERROR CNTR ENABLE, 4MS MIN WAIT
042516,000152: 16,3257           00006                           EXTEND                                         
042517,000153: 16,3260           05012                           WOR      CHAN12                                
042518,000154: 16,3261           33333                           CAF      TVCADDR    +2                         #  WAIT, CALLING CMDSOUT (BBCON THERE)
042519,000155: 16,3262           54112                           TS       T5LOC                                 
042520,000156: 16,3263           37663                           CAF      OCT37776                              #        20MS
042521,000157: 16,3264           54030                           TS       TIME5                                 

Page 962

042523,000159: 16,3265           15325                           TCF      NOQRSM                                
042524,000160: 
042525,000161: 16,3266           22016        CMDSOUT            LXCH     BANKRUPT                              #  CONTINUE PREPARATION OF OUTCOUNTERS
042526,000162: 16,3267           00006                           EXTEND                                         
042527,000163: 16,3270           22012                           QXCH     QRUPT                                 
042528,000164: 
042529,000165: 16,3271           44772                           CS       ZERO                                  #  MOST RECENT ACTUATOR COMMANDS
042530,000166: 16,3272           61623                           AD       PCMD                                  #        (AVOID +0)
042531,000167: 16,3273           54054                           TS       TVCPITCH                              
042532,000168: 16,3274           44772                           CS       ZERO                                  
042533,000169: 16,3275           61624                           AD       YCMD                                  
042534,000170: 16,3276           54053                           TS       TVCYAW                                
042535,000171: 
042536,000172: 16,3277           35050                           CAF      PRIO6                                 #  RELEASE THE COUNTERS (BITS 11,12)
042537,000173: 16,3300           00006                           EXTEND                                         
042538,000174: 16,3301           05014                           WOR      CHAN14                                
042539,000175: 
042540,000176: 16,3302           11635        PHSCHK2            CCS      TVCPHASE                              #  CHECK TVCPHASE AGAIN
042541,000177: 16,3303           13313                           TCF      JUMPTVC4                              
042542,000178: 16,3304           13313                           TCF      JUMPTVC4                              
042543,000179: 16,3305           10000                           CCS      A                                     #  A CONTAINS THE DIMINISHED ABSOLUTE OF
042544,000180: 16,3306           03311                           TC       +3                                    #  TVCPHASE (-2 BECOMES +1. -1 BECOMES +0)
042545,000181: 
042546,000182: 16,3307           04655                           TC       POSTJUMP                              #        REPEAT TVC INITIALIZATION
042547,000183: 16,3310           36166                           CADR     MRCLEAN                               #        (DO NOT RETURN)
042548,000184: 
042549,000185: 16,3311           04714                 +3        TC       IBNKCALL                              #        REPEAT CSM/LM V46 SWITCH-OVER
042550,000186: 16,3312           36351                           CADR     SWICHOVR   +5                         #        (RETURN TO CHECK FOR STROKE TEST)
042551,000187: 
042552,000188: 16,3313           04655        JUMPTVC4           TC       POSTJUMP                              #        IF POSITIVE OR ZERO, RESTART AT
042553,000189: 16,3314           36326                           CADR     TVCINIT4                              #                TVCINIT4 (ZEROS TVCPHASE, AND
042554,000190:                                                                                                  #                CALLS TVC DAPS VIA DAPINIT)
042555,000191: 16,3315           51635        FINCOPY            INDEX    TVCPHASE                              #  PICK UP THE APPROPRIATE COPYCYCLE
042556,000192: 16,3316           33331                           CAF      TVCCADR                               
042557,000193: 16,3317           04720                           TCR      ISWCALL                               #  RE-ENTER THE COPYCYCLE, RETURN AT END
042558,000194: 16,3320           13244                           TCF      ENABL1                                #  NOW PREPARE THE OUTCOUNTERS
042559,000195: 
042560,000196: 
042561,000197: 16,3321           00006        TRIM/CMD           EXTEND                                         #  TVCDAPON INITIALIZATION NOT COMPLETED,
042562,000198: 16,3322           31424                           DCA      PACTOFF                               #        EG.  P,YCMD MAY NOT BE SET.  SET...
042563,000199: 16,3323           53624                           DXCH     PCMD                                  
042564,000200: 16,3324           13244                           TCF      ENABL1                                #  NOW PREPARE THE OUTCOUNTERS
042565,000201: 
042566,000202: 
042567,000203: 16,3325           51644        EXRSTRT            INDEX    TVCEXPHS                              #  TVCEXECUTIVE RESTARTS....GO TO
042568,000204: 16,3326           33335                           CAF      TVCEXADR                              #        APPROPRIATE RESTART POINT
042569,000205: 16,3327           50000                           INDEX    A                                     
042570,000206: 16,3330           10000                           TCF      0                                     
042571,000207: 

Page 963

042573,000209: 
042574,000210:                                                                                                  #  TVC RESTART TABLES.... ORDER IS REQUIRED.   HI-ORDER WORDS ONLY, OF 2CADRS, SINCE BBCON IS ALREADY THERE.
042575,000211: 
042576,000212: 16,3331  16,3331               TVCADDR            =        TVCCADR                               #  TABLE OF CADRS, UNUSED LOCS FOR GENADRS
042577,000213: 16,3331           03255        TVCCADR            GENADR   ENABL2                                #  (FOR T5 CALL, UNUSED TABLE LOC)
042578,000214: 16,3332           41005                 +1        CADR     PCOPY      +1                         #  PITCH COPYCYCLE
042579,000215: 16,3333           03266                 +2        GENADR   CMDSOUT                               #  (FOR T5 CALL, UNUSED TABLE LOC)
042580,000216: 16,3334           41171                 +3        CADR     YCOPY      +1                         #  YAW COPYCYCLE
042581,000217: 16,3335           37772        TVCEXADR           OCT      37772                                 #  (UNUSED TABLE LOC, FILL WITH 60MS, T5)
042582,000218: 16,3336           03123                 +1        GENADR   TEMPSET                               #  TVCEXECUTIVE RESTART POINTS (ORDERED)
042583,000219: 16,3337           03126                 +2        GENADR   CORSETUP                              
042584,000220: 16,3340           03204                 +3        GENADR   CORCOPY    +1                         
042585,000221: 16,3341           03215                 +4        GENADR   CNTRCOPY                              

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