Source Code

These source-code files are part of a reconstructed copy of Artemis 071, the first release of the Apollo 15 through 17 Command Module (CM) Apollo Guidance Computer (AGC) software.

The reconstruction began with source code of Artemis 072 previously transcribed from a digitized copy of that program. The code was then updated by undoing changes between the two versions. The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021154-. Note that page numbers in the reconstructed code match those on the Artemis 072 printout, although the changed code would likely have changed page numbers for a real Artemis 071 listing.

Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository.

042234,000002:                                                                                                  ## Copyright:   Public domain.
042235,000003:                                                                                                  ## Filename:    TVCRESTARTS.agc
042236,000004:                                                                                                  ## Purpose:     A section of Artemis revision 071.
042237,000005:                                                                                                  ##              It is part of the reconstructed source code for the first
042238,000006:                                                                                                  ##              release of the flight software for the Command Module's
042239,000007:                                                                                                  ##              (CM) Apollo Guidance Computer (AGC) for Apollo 15 through
042240,000008:                                                                                                  ##              17. The code has been recreated from a copy of Artemis 072.
042241,000009:                                                                                                  ##              It has been adapted such that the resulting bugger words
042242,000010:                                                                                                  ##              exactly match those specified for Artemis 071 in NASA
042243,000011:                                                                                                  ##              drawing 2021154-, which gives relatively high confidence
042244,000012:                                                                                                  ##              that the reconstruction is correct.
042245,000013:                                                                                                  ## Reference:   959
042246,000014:                                                                                                  ## Assembler:   yaYUL
042247,000015:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
042248,000016:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
042249,000017:                                                                                                  ## Mod history: 2019-08-14 MAS  Created from Artemis 072.
042250,000018: 

Page 959

042252,000020: 
042253,000021:                                                                                                  #  NAME....TVCRESTART PACKAGE,  CONSISTING OF REDOTVC, ENABL1, 2, CMDSOUT, PHSCHK2, ETC.
042254,000022:                                                                                                  #  LOG SECTION...TVCRESTARTS                     SUBROUTINE...DAPCSM
042255,000023:                                                                                                  #  MODIFIED BY SCHLUNDT                          21 OCTOBER 1968
042256,000024:                                                                                                  #  MODIFIED BY BEALS TO ELIMINATE CSMMASS UPDATE LOGIC (NOW DONE IN S40.8)
042257,000025:                                                                                                  #  FUNCTIONAL DESCRIPTION....
042258,000026: 
042259,000027:                                                                                                  #       *RESTART-PROOFS THE TVC DAPS, INCLUDING PITCHDAP, YAWDAP,
042260,000028:                                                                                                  #        TVCEXECUTIVE, ROLLDAP, TVCINIT4, TVCDAPON, AND CSM/.M V46 SWTCHOVR.
042261,000029:                                                                                                  #       *TVC RESTARTS DESERVE SPECIAL CONSIDERATION IN SEVERAL AREAS.
042262,000030:                                                                                                  #        RESTART DOWN-TIME IS IMPORTANT BECAUSE OF THE TRANSIENTS INTRODUCED
042263,000031:                                                                                                  #        BY THE THRUST VECTOR RETURN TO THE ACTUATOR MECHANICAL NULLS
042264,000032:                                                                                                  #        FOLLOWING TVC- AND OPTICS-ERROR-COUNTER-DISENABLES (CHANNEL 12).
042265,000033:                                                                                                  #        TVC    USES A MIXTURE OF WAITLIST, T5, T6, AND JOB CALLS. THERE IS
042266,000034:                                                                                                  #        FILTER MEMORY (UP TO 6TH ORDER) TO BE PROTECTED IF WILD TRANSIENTS
042267,000035:                                                                                                  #        ARE TO BE AVOIDED. COUNTERS ARE INVOLVED FOR ONE-SHOT
042268,000036:                                                                                                  #        CORRECTIONS AND GAIN UPDATES. THE GIMBAL TRIM ESTIMATORS AND THE
042269,000037:                                                                                                  #        BODY AXIS ATTITUDE ERROR INTEGRATORS INVOLVE DIGITAL SUMMATION.
042270,000038:                                                                                                  #        DIGITAL DIFFERENTIATORS ARE INVOLVED IN THE BODY AXIS RATE ESTIMA-
042271,000039:                                                                                                  #        TIONS AND IN THE OUTPUTTING OF ACTUATOR COMMANDS. THERE IS AN
042272,000040:                                                                                                  #        OFFSET-TRACKER-FILTER TO PROTECT. ETC., ETC.
042273,000041:                                                                                                  #       *THOSE QUANTITIES WHICH MUST BE PROTECTED ARE STORED IN TEMPORARY
042274,000042:                                                                                                  #        REGISTERS AS THEY ARE COMPUTED, FOR UPDATING THE REAL REGISTERS
042275,000043:                                                                                                  #        DURING COPYCYCLES.
042276,000044:                                                                                                  #       *THE SEVERAL COPYCYCLES ARE EACH PROTECTED BY PHASE POINTS AT THEIR
042277,000045:                                                                                                  #        BEGINNING AND AT THEIR TERMINATION. THE PHASE POINTS ARE SIMPLY
042278,000046:                                                                                                  #        ..INCR.. INSTRUCTIONS, EITHER ..INCR TVCEXPHS.. FOR COPYCYCLES
042279,000047:                                                                                                  #        IN THE TVCEXECUTIVE, OR ..INCR TVCPHASE.. FOR THE PITCH AND YAW
042280,000048:                                                                                                  #        COPYCYCLES. INDEXING ON EACH OF THESE POINTERS THEN PERMITS A
042281,000049:                                                                                                  #        RETURN TO THE APPROPRIATE RESTART POINTS.
042282,000050:                                                                                                  #       *IF A RESTART OCCURS DURING EITHER COPYCYCLE, THAT COPYCYCLE IS
042283,000051:                                                                                                  #        COMPLETED. THEN THE NORMAL TVCINIT4....DAPINIT....PITCHDAP STARTUP
042284,000052:                                                                                                  #        SEQUENCE IS CALLED UPON TO GET THINGS GOING AGAIN.
042285,000053:                                                                                                  #       *TVC-ENABLE AND OPTICS-ERROR-COUNTER ENABLE MUST BE SET ASAP
042286,000054:                                                                                                  #        (ALLOWING FOR PROCEDURAL DELAYS). THEN THE ENGINES ARE COMMANDED
042287,000055:                                                                                                  #        TO THE P,YACTOFF TRIM VALUES. THE DAPS ARE THEN READY TO GO ON THE
042288,000056:                                                                                                  #        AIR, WITH THE REGULAR STARTUP SEQUENCE, EITHER AT MRCLEAN FOR A
042289,000057:                                                                                                  #        COMPLETE INITIALIZATION OR AT TVCINIT4 FOR A PARTIAL INITIALIZATION
042290,000058:                                                                                                  #       *FOR RESTARTS PRIOR TO THE SETTING OF THE T5 BITS AT DOTVCON THE
042291,000059:                                                                                                  #        PRE40.6 SECTION OF S40.6 TAKES CARE OF RE-ESTABLISHING TRIMS.
042292,000060:                                                                                                  #       *IF A RESTART OCCURS DURING THE TVCEXEC....TVCEXFIN SEQUENCE THE
042293,000061:                                                                                                  #        COMPUTATIONS WILL BE COMPLETED, STARTING AT THE APPROPRIATE RESTART
042294,000062:                                                                                                  #        POINT, AFTER THE DAPS ARE READY TO GO ON THE AIR.
042295,000063:                                                                                                  #       *IF A RESTART OCCURS PRIOR TO TVCINIT4 (TVCPHASE = -1) E.G. DURING
042296,000064:                                                                                                  #        THE EARLY DAP INITIALIZATION PHASE, THE DAP STARTUP SEQUENCE IS
042297,000065:                                                                                                  #        ENTERED AT MRCLEAN FOR A FULL INITIALIZATION.
042298,000066:                                                                                                  #       *FOR RESTARTS DURING CSM/LM V46 SWITCH-OVER, TVCPHASE IS SET TO -2.
042299,000067:                                                                                                  #        AND THE RESTART LOGIC GOES BACK TO REDO SWITCH-OVER (AFTER THE
042300,000068:                                                                                                  #        NORMAL DAP RESTART SEQUENCE IS FOLLOWED).
042301,000069:                                                                                                  #       *RESTARTS ARE NOT CRITICAL TO THE ROLL DAP PERFORMANCES HENCE THE
042302,000070:                                                                                                  #        THE ROLL DAP IS MERELY RESTARTED.

Page 960

042304,000072:                                                                                                  #       *REDOTVC IS REACHED FOLLOWING ANY RESTART WHICH FINDS THE T5 BITS
042305,000073:                                                                                                  #        (BITS 15,14 OF FLAGWRD6) SET FOR TVC. DOTVCON SETS TVCPHASE = -1
042306,000074:                                                                                                  #        AND TVC EXPHS = 0 JUST BEFORE SETTING THESE BITS, JUST BEFORE
042307,000075:                                                                                                  #        MAKING THE T5 CALL TO TVCDAPON. ON A NORMAL SHUTDOWN DOTVCRCS
042308,000076:                                                                                                  #        CALLS RCSDAPON, WHICH RESETS THE T5 BITS FOR RCS.
042309,000077:                                                                                                  #  CALLING SEQUENCE....T5, IN PARTICULAR BY ELRSKIP OF FRESH START/RESTART
042310,000078: 
042311,000079:                                                                                                  #  NORMAL EXIT MODES....RESUME, NOQRSM, POSTJUMP (TO TVCINIT4 OR MRCLEAN)
042312,000080: 
042313,000081:                                                                                                  #  ALARM OR ABORT EXIT MODES....NONE
042314,000082: 
042315,000083:                                                                                                  #  SUBROUTINES CALLED....
042316,000084: 
042317,000085:                                                                                                  #       *PCOPY+1, YCOPY+1 (PITCH AND YAW COPYCYCLES)
042318,000086:                                                                                                  #       *ENABLE1,2, CMDSOUT (RE-ESTABLISH ACTUATOR TRIMS)
042319,000087:                                                                                                  #       *MRCLEAN OR TVCINIT4 (TVCDAP INITIALIZATIONS)
042320,000088:                                                                                                  #       *SWICHOVR +5  (CSM/LM V46 SWITCH-OVER)
042321,000089:                                                                                                  #       *EXRSTRT AND TVCEXECUTIVE PHASE POINTS 1 THRU 6
042322,000090:                                                                                                  #       *WAITLIST, IBNKCALL, POSTJUMP, ISWCALL
042323,000091: 
042324,000092:                                                                                                  #  OTHER INTERFACES....DOTVCON AND RCSDAPON (T5 BITS), ELRSKIP (CALLS IT)
042325,000093:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED....
042326,000094: 
042327,000095:                                                                                                  #       *T5 BITS (1,0), TVCPHASE (-2,-1,0,1,2,3), TVCEXPHS (1 THRU 6)
042328,000096:                                                                                                  #       *TVC DAP VARIABLES
042329,000097:                                                                                                  #       *OPERATIONS PERFORMED BY REDOTVC ARE BASED ON THE ASSUMPTION THAT
042330,000098:                                                                                                  #        THE TVC DAPS ARE RUNNING NORMALLY
042331,000099: 
042332,000100:                                                                                                  #  OUTPUT....
042333,000101: 
042334,000102:                                                                                                  #       *PITCH AND YAW TVC DAP COPYCYCLES COMPLETED IF INTERUPTED
042335,000103:                                                                                                  #       *TVCEXECUTIVE COMPLETED IF INTERUPTED
042336,000104:                                                                                                  #       *CSM/LM V46 SWITCH-OVER REPEATED IF INTERRUPTED
042337,000105:                                                                                                  #       *ACTUATOR TRIMS RE-ESTABLISHED (ACTUATORS BACK ON THE AIR)
042338,000106:                                                                                                  #       *TVC DAP INITIALIZATION AS REQUIRED
042339,000107:                                                                                                  #       *ALL TVC DAP OPERATIONS ON THE AIR
042340,000108: 
042341,000109:                                                                                                  #  DEBRIS....TVC TEMPORARIES IN EBANK6
042342,000110: 

Page 961

042344,000112: 16,2000                                           SETLOC   DAPROLL                               
042345,000113: 16,2000                                           BANK                                           
042346,000114: 16,3222  E6,1635                                  EBANK=   TVCPHASE                              
042347,000115: 16,3222                                           COUNT*   $$/RSRT                               
042348,000116: 
042349,000117: 16,3222           22016        REDOTVC            LXCH     BANKRUPT                              #  TVC RESTART PACKAGE
042350,000118: 16,3223           00006                           EXTEND                                         
042351,000119: 16,3224           22012                           QXCH     QRUPT                                 #  (  ..TCR..  IN  ..FINCOPY..  )
042352,000120: 
042353,000121: 16,3225           11644        EXECPHS            CCS      TVCEXPHS                              #  CHECK TVCEXECUTIVE PHASE
042354,000122: 16,3226           13230                           TCF      +2                                    #        MUST RESTART TVCEXECUTIVE
042355,000123: 16,3227           13233                           TCF      TVCDAPHS                              #        NO NEED TO RESTART TVCEXECUTIVE
042356,000124: 
042357,000125: 16,3230           34322                           CAF      NINE                                  #  9CS DELAY TO FORCE EXRSTRT TO OCCUR
042358,000126: 16,3231           05223                           TC       TWIDDLE                               #        BEFORE PITCHDAP, AFTER CMDSOUT
042359,000127: 16,3232           03325                           ADRES    EXRSTRT                               
042360,000128: 16,3233           47663        TVCDAPHS           CS       OCT37776                              #  CHECK BITS 15 AND 1 OF TVCPHASE TO SEE
042361,000129: 16,3234           71635                           MASK     TVCPHASE                              #        DAP RESTART LOCATION (-1,1,2,3)
042362,000130: 16,3235           10000                           CCS      A                                     
042363,000131: 16,3236           13315                           TCF      FINCOPY                               #        FINISH THE COPYCYCLE FIRST
042364,000132: 16,3237           13244                           TCF      ENABL1                                #        JUST PREPARE THE OUTCOUNTERS AND GO
042365,000133: 
042366,000134: 16,3240           41635                           CS       TVCPHASE                              #  TEST FOR TVCPHASE = -2
042367,000135: 16,3241           74767                           MASK     BIT2                                  #        (THIS INDICATES RESTART OCCURRED
042368,000136: 16,3242           00006                           EXTEND                                         #        DURING CSM/LM V46 SWITCH-OVER)
042369,000137: 16,3243           13321                           BZF      TRIM/CMD                              #  NO, TVCPHASE = -1, RSTRT WAS IN TVCINIT
042370,000138: 
042371,000139: 16,3244           34761        ENABL1             CAF      BIT8                                  #  TVC ENABLE, FOLLOWED BY 40 MS (MIN) WAIT
042372,000140: 16,3245           64756                           AD       BIT11                                 #  SET BIT FOR OPTICS-DAC-ENABLE ALSO
042373,000141: 16,3246           00006                           EXTEND                                         #  (ENABL1 ENTERED FROM TVCDAPHS / FINCOPY)
042374,000142: 16,3247           05012                           WOR      CHAN12                                
042375,000143: 16,3250           33331                           CAF      TVCADDR                               #  WAIT,  CALLING ENABL2  (BBCON THERE)
042376,000144: 16,3251           54112                           TS       T5LOC                                 
042377,000145: 16,3252           33335                           CAF      TVCADDR    +4                         #        60 MS  (TVCEXADR)
042378,000146: 16,3253           54030                           TS       TIME5                                 
042379,000147: 
042380,000148: 16,3254           15323                           TCF      RESUME                                
042381,000149: 
042382,000150: 16,3255           22016        ENABL2             LXCH     BANKRUPT                              #  CONTINUE PREPARATION OF OUTCOUNTERS
042383,000151: 
042384,000152: 16,3256           34767                           CAF      BIT2                                  #  OPTICS ERROR CNTR ENABLE, 4MS MIN WAIT
042385,000153: 16,3257           00006                           EXTEND                                         
042386,000154: 16,3260           05012                           WOR      CHAN12                                
042387,000155: 16,3261           33333                           CAF      TVCADDR    +2                         #  WAIT, CALLING CMDSOUT (BBCON THERE)
042388,000156: 16,3262           54112                           TS       T5LOC                                 
042389,000157: 16,3263           37663                           CAF      OCT37776                              #        20MS
042390,000158: 16,3264           54030                           TS       TIME5                                 

Page 962

042392,000160: 16,3265           15325                           TCF      NOQRSM                                
042393,000161: 
042394,000162: 16,3266           22016        CMDSOUT            LXCH     BANKRUPT                              #  CONTINUE PREPARATION OF OUTCOUNTERS
042395,000163: 16,3267           00006                           EXTEND                                         
042396,000164: 16,3270           22012                           QXCH     QRUPT                                 
042397,000165: 
042398,000166: 16,3271           44772                           CS       ZERO                                  #  MOST RECENT ACTUATOR COMMANDS
042399,000167: 16,3272           61623                           AD       PCMD                                  #        (AVOID +0)
042400,000168: 16,3273           54054                           TS       TVCPITCH                              
042401,000169: 16,3274           44772                           CS       ZERO                                  
042402,000170: 16,3275           61624                           AD       YCMD                                  
042403,000171: 16,3276           54053                           TS       TVCYAW                                
042404,000172: 
042405,000173: 16,3277           35050                           CAF      PRIO6                                 #  RELEASE THE COUNTERS (BITS 11,12)
042406,000174: 16,3300           00006                           EXTEND                                         
042407,000175: 16,3301           05014                           WOR      CHAN14                                
042408,000176: 
042409,000177: 16,3302           11635        PHSCHK2            CCS      TVCPHASE                              #  CHECK TVCPHASE AGAIN
042410,000178: 16,3303           13313                           TCF      JUMPTVC4                              
042411,000179: 16,3304           13313                           TCF      JUMPTVC4                              
042412,000180: 16,3305           10000                           CCS      A                                     #  A CONTAINS THE DIMINISHED ABSOLUTE OF
042413,000181: 16,3306           03311                           TC       +3                                    #  TVCPHASE (-2 BECOMES +1. -1 BECOMES +0)
042414,000182: 
042415,000183: 16,3307           04655                           TC       POSTJUMP                              #        REPEAT TVC INITIALIZATION
042416,000184: 16,3310           36166                           CADR     MRCLEAN                               #        (DO NOT RETURN)
042417,000185: 
042418,000186: 16,3311           04714                 +3        TC       IBNKCALL                              #        REPEAT CSM/LM V46 SWITCH-OVER
042419,000187: 16,3312           36351                           CADR     SWICHOVR   +5                         #        (RETURN TO CHECK FOR STROKE TEST)
042420,000188: 
042421,000189: 16,3313           04655        JUMPTVC4           TC       POSTJUMP                              #        IF POSITIVE OR ZERO, RESTART AT
042422,000190: 16,3314           36326                           CADR     TVCINIT4                              #                TVCINIT4 (ZEROS TVCPHASE, AND
042423,000191:                                                                                                  #                CALLS TVC DAPS VIA DAPINIT)
042424,000192: 16,3315           51635        FINCOPY            INDEX    TVCPHASE                              #  PICK UP THE APPROPRIATE COPYCYCLE
042425,000193: 16,3316           33331                           CAF      TVCCADR                               
042426,000194: 16,3317           04720                           TCR      ISWCALL                               #  RE-ENTER THE COPYCYCLE, RETURN AT END
042427,000195: 16,3320           13244                           TCF      ENABL1                                #  NOW PREPARE THE OUTCOUNTERS
042428,000196: 
042429,000197: 
042430,000198: 16,3321           00006        TRIM/CMD           EXTEND                                         #  TVCDAPON INITIALIZATION NOT COMPLETED,
042431,000199: 16,3322           31424                           DCA      PACTOFF                               #        EG.  P,YCMD MAY NOT BE SET.  SET...
042432,000200: 16,3323           53624                           DXCH     PCMD                                  
042433,000201: 16,3324           13244                           TCF      ENABL1                                #  NOW PREPARE THE OUTCOUNTERS
042434,000202: 
042435,000203: 
042436,000204: 16,3325           51644        EXRSTRT            INDEX    TVCEXPHS                              #  TVCEXECUTIVE RESTARTS....GO TO
042437,000205: 16,3326           33335                           CAF      TVCEXADR                              #        APPROPRIATE RESTART POINT
042438,000206: 16,3327           50000                           INDEX    A                                     
042439,000207: 16,3330           10000                           TCF      0                                     
042440,000208: 

Page 963

042442,000210: 
042443,000211:                                                                                                  #  TVC RESTART TABLES.... ORDER IS REQUIRED.   HI-ORDER WORDS ONLY, OF 2CADRS, SINCE BBCON IS ALREADY THERE.
042444,000212: 
042445,000213: 16,3331  16,3331               TVCADDR            =        TVCCADR                               #  TABLE OF CADRS, UNUSED LOCS FOR GENADRS
042446,000214: 16,3331           03255        TVCCADR            GENADR   ENABL2                                #  (FOR T5 CALL, UNUSED TABLE LOC)
042447,000215: 16,3332           41005                 +1        CADR     PCOPY      +1                         #  PITCH COPYCYCLE
042448,000216: 16,3333           03266                 +2        GENADR   CMDSOUT                               #  (FOR T5 CALL, UNUSED TABLE LOC)
042449,000217: 16,3334           41171                 +3        CADR     YCOPY      +1                         #  YAW COPYCYCLE
042450,000218: 16,3335           37772        TVCEXADR           OCT      37772                                 #  (UNUSED TABLE LOC, FILL WITH 60MS, T5)
042451,000219: 16,3336           03123                 +1        GENADR   TEMPSET                               #  TVCEXECUTIVE RESTART POINTS (ORDERED)
042452,000220: 16,3337           03126                 +2        GENADR   CORSETUP                              
042453,000221: 16,3340           03204                 +3        GENADR   CORCOPY    +1                         
042454,000222: 16,3341           03215                 +4        GENADR   CNTRCOPY                              

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