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.

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

Page 959

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

Page 960

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

Page 961

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

Page 962

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

Page 963

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

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