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.

041782,000002:                                                                                                  ## Copyright:   Public domain.
041783,000003:                                                                                                  ## Filename:    TVCEXECUTIVE.agc
041784,000004:                                                                                                  ## Purpose:     A section of Artemis revision 071.
041785,000005:                                                                                                  ##              It is part of the reconstructed source code for the first
041786,000006:                                                                                                  ##              release of the flight software for the Command Module's
041787,000007:                                                                                                  ##              (CM) Apollo Guidance Computer (AGC) for Apollo 15 through
041788,000008:                                                                                                  ##              17. The code has been recreated from a copy of Artemis 072.
041789,000009:                                                                                                  ##              It has been adapted such that the resulting bugger words
041790,000010:                                                                                                  ##              exactly match those specified for Artemis 071 in NASA
041791,000011:                                                                                                  ##              drawing 2021154-, which gives relatively high confidence
041792,000012:                                                                                                  ##              that the reconstruction is correct.
041793,000013:                                                                                                  ## Reference:   950
041794,000014:                                                                                                  ## Assembler:   yaYUL
041795,000015:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
041796,000016:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
041797,000017:                                                                                                  ## Mod history: 2019-08-14 MAS  Created from Artemis 072.
041798,000018: 

Page 950

041800,000020:                                                                                                  #  PROGRAM NAME.... TVCEXECUTIVE, CONSISTING OF TVCEXEC, NEEDLEUP, VARGAINS
041801,000021:                                                                                                  #                   1SHOTCHK, REPCHEK, CG.CORR, COPYCYCLES, ETC.
041802,000022:                                                                                                  #  LOG SECTION...TVCEXECUTIVE                    SUBROUTINE...DAPCSM
041803,000023:                                                                                                  #  MODIFIED BY SCHLUNDT                          21 OCTOBER 1968
041804,000024:                                                                                                  #  MODIFIED BY BEALS TO ELIMINATE CSMMASS UPDATE LOGIC (NOW DONE IN S40.8)
041805,000025:                                                                                                  #  FUNCTIONAL DESCRIPTION....
041806,000026: 
041807,000027:                                                                                                  #       *A SELF-PERPETUATING WAITLIST TASK AT 1/2 SECOND INTERVALS WHICH:
041808,000028:                                                                                                  #        PREPARES THE ROLL DAP WITH OGA (CDUX)
041809,000029:                                                                                                  #        PREPARES THE ROLL FDAI NEEDLE (FLY-TO  OGA ERROR)
041810,000030:                                                                                                  #        PREPARES THE ROLL PHASE PLANE  OGAERR  (FLY-FROM  OGA ERROR)
041811,000031:                                                                                                  #        PREPARES THE TVC ROLLDAP TASK WAITLIST CALL (3 CS DELAY)
041812,000032:                                                                                                  #        UPDATES THE NEEDLES DISPLAY
041813,000033:                                                                                                  #        CALLS MASSPROP TO UPDATE INERTIA DATA
041814,000034:                                                                                                  #        UPDATES PITCH, YAW, AND ROLL DAP GAINS FROM MASSPROP DATA
041815,000035:                                                                                                  #        PERFORMS ONE-SHOT CORRECTION FOR TMC LOOP 0-3 SEC AFTER IGNITION
041816,000036:                                                                                                  #        PERFORMS REPETITIVE UPDATES FOR TMC LOOP AFTER THE ONE-SHOT CORR.
041817,000037: 
041818,000038:                                                                                                  #  CALLING SEQUENCE....
041819,000039: 
041820,000040:                                                                                                  #       *TVCEXEC CALLED AS A WAITLIST TASK, IN PARTICULAR BY TVCINIT4 AND BY
041821,000041:                                                                                                  #        ITSELF, BOTH AT 1/2 SECOND INTERVALS
041822,000042: 
041823,000043:                                                                                                  #  NORMAL EXIT MODE.... TASKOVER
041824,000044: 
041825,000045:                                                                                                  #  ALARM OR ABORT EXIT MODES.... NONE
041826,000046: 
041827,000047:                                                                                                  #  SUBROUTINES CALLED....NEEDLER, S40.15, MASSPROP, TASKOVER, IBNKCALL
041828,000048: 
041829,000049:                                                                                                  #  OTHER INTERFACES....
041830,000050: 
041831,000051:                                                                                                  #       *TVCRESTART PACKAGE FOR RESTARTS
041832,000052:                                                                                                  #       *PITCHDAP, YAWDAP FOR VARIABLE GAINS AND ENGINE TRIM ANGLES
041833,000053:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED....
041834,000054: 
041835,000055:                                                                                                  #       *SEE TVCDAPON....TVCINIT4
041836,000056:                                                                                                  #       *VARK AND 1/CONACC (S40.15 OF TVCINITIALIZE)
041837,000057:                                                                                                  #       *PAD LOAD EREPFRAC
041838,000058:                                                                                                  #       *BITS 15,14 OF FLAGWRD6 (T5 BITS)
041839,000059:                                                                                                  #       *TVCEXPHS FOR RESTARTS
041840,000060:                                                                                                  #       *ENGINE-ON BIT (11.13) FOR RESTARTS
041841,000061:                                                                                                  #       *CDUX, OGAD
041842,000062: 
041843,000063:                                                                                                  #  OUTPUT....
041844,000064: 
041845,000065:                                                                                                  #       *ROLL DAP OGANOW, FDAI NEEDLE (AK). AND PHASE PLANE OGAERR
041846,000066:                                                                                                  #       *VARIABLE GAINS FOR PITCH/YAW AND ROLL TVC DAPS
041847,000067:                                                                                                  #       *SINGLE-SHOT AND REPETITIVE CORRECTIONS TO ENGINE TRIM ANGLES
041848,000068:                                                                                                  #        PACTOFF AND YACTOFF
041849,000069:                                                                                                  #  DEBRIS.... MUCH, BUT SHAREABLE WITH RCS/ENTRY, ALL IN EBANK6
041850,000070: 

Page 951

041852,000072: 16,2000                                           SETLOC   DAPROLL                               
041853,000073: 16,2000                                           BANK                                           
041854,000074: 16,3037  E6,1446                                  EBANK=   CNTR                                  
041855,000075: 16,3037                                           COUNT*   $$/TVCX                               
041856,000076: 
041857,000077: 
041858,000078: 16,3037           40102        TVCEXEC            CS       FLAGWRD6                              #  CHECK FOR TERMINATION (BITS 15,14 READ
041859,000079: 16,3040           74076                           MASK     DPCONFIG                              #  10 FROM TVCDAPON TO RCSDAPON
041860,000080: 16,3041           00006                           EXTEND                                         
041861,000081: 16,3042           63217                           BZMF     TVCEXFIN                              #  TERMINATE
041862,000082: 
041863,000083: 16,3043           35011                           CAF      .5SEC                                 #  W.L. CALL TO PERPETUATE TVCEXEC
041864,000084: 16,3044           05223                           TC       TWIDDLE                               
041865,000085: 16,3045           03037                           ADRES    TVCEXEC                               
041866,000086: 16,3046           30032        ROLLPREP           CAE      CDUX                                  #  UPDATE ROLL LADDERS (NO NEED TO RESTART-
041867,000087: 16,3047           57645                           XCH      OGANOW                                #        PROTECT, SINCE ROLL DAPS RE-START)
041868,000088: 16,3050           57646                           XCH      OGAPAST                               
041869,000089: 
041870,000090: 16,3051           31447                           CAE      OGAD                                  #  PREPARE ROLL FDAI NEEDLE  WITH FLY-TO
041871,000091: 16,3052           00006                           EXTEND                                         #        ERROR (COMMAND - MEASURED)
041872,000092: 16,3053           21645                           MSU      OGANOW                                
041873,000093: 16,3054           55476                           TS       AK                                    #  FLY-TO OGA ERROR, SC.AT B-1 REVS
041874,000094: 
041875,000095: 16,3055           00006                           EXTEND                                         #  PREPARE ROLL DAP PHASE PLANE  OGAERR
041876,000096: 16,3056           74751                           MP       -BIT14                                
041877,000097: 16,3057           55647                           TS       OGAERR                                #  PHASE-PLANE (FLY-FROM) OGAERROR,
041878,000098:                                                                                                  #        SC.AT B+0 REVS
041879,000099: 
041880,000100: 16,3060           36214                           CAF      THREE                                 #  SET UP ROLL DAP TASK (ALLOW SOME TIME)
041881,000101: 16,3061           05223                           TC       TWIDDLE                               
041882,000102: 16,3062           03342                           ADRES    ROLLDAP                               
041883,000103: 16,3063           04714        NEEDLEUP           TC       IBNKCALL                              #  DO A NEEDLES UPDATE (RETURNS AFTER CADR)
041884,000104: 16,3064           42425                           CADR     NEEDLER                               #        (NEEDLES RESTARTS ITSELF)
041885,000105: 
041886,000106: 16,3065           11634        VARGAINS           CCS      VCNTR                                 #  TEST FOR GAIN UPDATE TIME
041887,000107: 16,3066           13074                           TCF      EXECCOPY                              #  NOT YET                       
041888,000108: 16,3067           04714        GAINCHNG           TC       IBNKCALL                              #  UPDATE IXX, IAVG, IAVG/TLX
041889,000109: 16,3070           13347                           CADR     FIXCW                                 #  MASSPROP ENTRY  (ALREADY INITIALIZED)
041890,000110: 16,3071           04714                           TC       IBNKCALL                              #  UPDATE 1/CONACC, VARK
041891,000111: 16,3072           36452                           CADR     S40.15                                #        (S40.15 IS IN TVCINITIALIZE)
041892,000112: 16,3073           34351                           CAF      NINETEEN                              #  RESET THE VARIABLE-GAIN UPDATE COUNTER
041893,000113: 16,3074           55634        EXECCOPY           TS       VCNTR                                 
041894,000114: 16,3075           11446        1SHOTCHK           CCS      CNTR                                  #  CHECK TIME FOR ONE-SHOT OR REPCORR
041895,000115: 16,3076           13102                           TCF      +4                                    #        NOT YET
041896,000116: 16,3077           13115                           TCF      1SHOTOK                               #        NOW
041897,000117: 16,3100           13106                           TCF      REPCHEK                               #        ONE-SHOT OVER, ON TO REPCORR
041898,000118: 16,3101           13115                           TCF      1SHOTOK                               #        NOW  (ONE-SHOT ONLY, NO REPCORR)
041899,000119: 
041900,000120: 16,3102           55661                 +4        TS       CNTRTMP                               #  COUNT DOWN
041901,000121: 16,3103           34766                           CAF      FOUR                                  #  SET UP TVCEXPHS FOR ENTRY AT CNTRCOPY

Page 952

041903,000123: 16,3104           55644                           TS       TVCEXPHS                              
041904,000124: 16,3105           13215                           TCF      CNTRCOPY                              
041905,000125: 
041906,000126: 16,3106           31633        REPCHEK            CAE      REPFRAC                               #  CHECK FOR REPETITIVE UPDATES
041907,000127: 16,3107           00006                           EXTEND                                         
041908,000128: 16,3110           63217                           BZMF     TVCEXFIN                              #        NO, OVER-AND-OUT
041909,000129: 16,3111           55445                           TS       TEMPDAP    +1                         #        YES, SET UP CORRECTION FRACTION
041910,000130: 16,3112           34767                           CAF      TWO                                   #  SET UP TVCEXPHS FOR ENTRY AT CORSETUP
041911,000131: 16,3113           55644                           TS       TVCEXPHS                              
041912,000132: 16,3114           13126                           TCF      CORSETUP                              
041913,000133: 
041914,000134: 16,3115           34762        1SHOTOK            CAF      ENGONBIT                              
041915,000135: 16,3116           70101                           MASK     FLAGWRD5                              
041916,000136: 16,3117           10000                           CCS      A                                     
041917,000137: 16,3120           13122                           TCF      +2                                    #        ONE-SHOT OK
041918,000138: 16,3121           13217                           TCF      TVCEXFIN                              #        NO, TERMINATE
041919,000139: 
041920,000140: 16,3122           25644                           INCR     TVCEXPHS                              #                                        (1)
041921,000141: 16,3123           34754        TEMPSET            CAF      FCORFRAC                              #        SET UP CORRECTION FRACTION
041922,000142: 16,3124           55445                           TS       TEMPDAP    +1                         
041923,000143: 
041924,000144: 16,3125           25644                           INCR     TVCEXPHS                              #  ENTRY FROM REPCHECK AT NEXT LOCATION  (2)
041925,000145: 16,3126           31465        CORSETUP           CAE      DAPDATR1                              #  CHECK FOR LEM-OFF/ON
041926,000146: 16,3127           74754                           MASK     BIT13                                 #  (NOTE, SHOWS LEM-OFF)
041927,000147: 16,3130           00006                           EXTEND                                         
041928,000148: 16,3131           13133                           BZF      +2                                    #  LEM IS ON,  PICK UP   TEMPDAP+1
041929,000149: 16,3132           31445                           CAE      TEMPDAP    +1                         #  LEM IS OFF, PICK UP 2(TEMPDAP+1)
041930,000150: 16,3133           61445                           AD       TEMPDAP    +1                         
041931,000151: 16,3134           55444                           TS       TEMPDAP                               #  CG.CORR USES TEMPDAP
041932,000152: 
041933,000153: 16,3135           37702                           CAF      NEGONE                                #  SET UP FOR CNTR = -1 (ONE-SHOT DONE)
041934,000154: 16,3136           55661                           TS       CNTRTMP                               #        (COPYCYCLE AT .CNTRCOPY.)
041935,000155: 
041936,000156: 16,3137           00006        CG.CORR            EXTEND                                         #  PITCH TMC LOOP
041937,000157: 16,3140           31606                           DCA      PDELOFF                               
041938,000158: 16,3141           53656                           DXCH     PACTTMP                               
041939,000159: 16,3142           00006                           EXTEND                                         
041940,000160: 16,3143           41606                           DCS      PDELOFF                               
041941,000161: 16,3144           20001                           DDOUBL                                         
041942,000162: 16,3145           20001                           DDOUBL                                         
041943,000163: 16,3146           53612                           DXCH     TTMP1                                 
041944,000164: 16,3147           00006                           EXTEND                                         
041945,000165: 16,3150           31602                           DCA      DELPBAR                               
041946,000166: 16,3151           20001                           DDOUBL                                         
041947,000167: 16,3152           20001                           DDOUBL                                         
041948,000168: 16,3153           21612                           DAS      TTMP1                                 
041949,000169: 16,3154           00006                           EXTEND                                         
041950,000170: 16,3155           31612                           DCA      TTMP1                                 
041951,000171: 16,3156           00006                           EXTEND                                         
041952,000172: 16,3157           71444                           MP       TEMPDAP                               

Page 953

041954,000174: 16,3160           21656                           DAS      PACTTMP                               
041955,000175: 
041956,000176: 16,3161           00006                           EXTEND                                         #  YAW TMC LOOP
041957,000177: 16,3162           31610                           DCA      YDELOFF                               
041958,000178: 16,3163           53660                           DXCH     YACTTMP                               
041959,000179: 16,3164           00006                           EXTEND                                         
041960,000180: 16,3165           41610                           DCS      YDELOFF                               
041961,000181: 16,3166           20001                           DDOUBL                                         
041962,000182: 16,3167           20001                           DDOUBL                                         
041963,000183: 16,3170           53612                           DXCH     TTMP1                                 
041964,000184: 16,3171           00006                           EXTEND                                         
041965,000185: 16,3172           31604                           DCA      DELYBAR                               
041966,000186: 16,3173           20001                           DDOUBL                                         
041967,000187: 16,3174           20001                           DDOUBL                                         
041968,000188: 16,3175           21612                           DAS      TTMP1                                 
041969,000189: 16,3176           00006                           EXTEND                                         
041970,000190: 16,3177           31612                           DCA      TTMP1                                 
041971,000191: 16,3200           00006                           EXTEND                                         
041972,000192: 16,3201           71444                           MP       TEMPDAP                               
041973,000193: 16,3202           21660                           DAS      YACTTMP                               
041974,000194: 
041975,000195: 16,3203           25644        CORCOPY            INCR     TVCEXPHS                              #  RESTART PROTECT THE COPYCYCLE         (3)
041976,000196: 16,3204           00006                           EXTEND                                         #  TRIM-ESTIMATES, AND
041977,000197: 16,3205           31656                           DCA      PACTTMP                               
041978,000198: 16,3206           55423                           TS       PACTOFF                               #        TRIMS
041979,000199: 16,3207           53606                           DXCH     PDELOFF                               
041980,000200: 
041981,000201: 16,3210           00006                           EXTEND                                         
041982,000202: 16,3211           31660                           DCA      YACTTMP                               
041983,000203: 16,3212           55424                           TS       YACTOFF                               
041984,000204: 16,3213           53610                           DXCH     YDELOFF                               
041985,000205: 
041986,000206: 16,3214           25644                           INCR     TVCEXPHS                              #  ENTRY FROM 1SHOTCHK AT NEXT LOCATION  (4)
041987,000207: 16,3215           31661        CNTRCOPY           CAE      CNTRTMP                               #  UPDATE CNTR (RESTARTS OK, FOLLOWS CPYCY)
041988,000208: 16,3216           55446                           TS       CNTR                                  
041989,000209: 
041990,000210: 16,3217           34772        TVCEXFIN           CAF      ZERO                                  #  RESET TVCEXPHS
041991,000211: 16,3220           55644                           TS       TVCEXPHS                              
041992,000212: 16,3221           15314                           TCF      TASKOVER                              #  TVCEXECUTIVE FINISHED
041993,000213: 
041994,000214: 
041995,000215: 16,3222     4754               FCORFRAC           =        BIT13                                 #  ONE-SHOT CORRECTION FRACTION  

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