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.

041926,000002:                                                                                                  ## Copyright:   Public domain.
041927,000003:                                                                                                  ## Filename:    TVCEXECUTIVE.agc
041928,000004:                                                                                                  ## Purpose:     Part of the source code for Artemis (i.e., Colossus 3),
041929,000005:                                                                                                  ##              build 072.  This is for the Command Module's (CM)
041930,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for
041931,000007:                                                                                                  ##              Apollo 15-17.
041932,000008:                                                                                                  ## Assembler:   yaYUL
041933,000009:                                                                                                  ## Contact:     Steve Case <case1780@adelphia.net>
041934,000010:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
041935,000011:                                                                                                  ## Page Scans:  www.ibiblio.org/apollo/ScansForConversion/Artemis072/
041936,000012:                                                                                                  ## Mod history: 2009-09-13 SMC  Adapted from Comanche055 files.
041937,000013:                                                                                                  ##              2009-09-14 JL   Fix typos. Fix page numbers. Remove change comments. Restore hard tabs.
041938,000014:                                                                                                  ##              2010-02-20 RSB  Un-##'d this header.
041939,000015:                                                                                                  ##              2017-01-28 RSB  WTIH -> WITH.
041940,000016:                                                                                                  ##              2017-02-09 RSB  Proofed comment text by diff'ing vs Comanche 55
041941,000017:                                                                                                  ##                              and/or octopus/ProoferComments as most-appropriate.
041942,000018: 

Page 950

041944,000020:                                                                                                  #  PROGRAM NAME.... TVCEXECUTIVE, CONSISTING OF TVCEXEC, NEEDLEUP, VARGAINS
041945,000021:                                                                                                  #                   1SHOTCHK, REPCHEK, CG.CORR, COPYCYCLES, ETC.
041946,000022:                                                                                                  #  LOG SECTION...TVCEXECUTIVE                    SUBROUTINE...DAPCSM
041947,000023:                                                                                                  #  MODIFIED BY SCHLUNDT                          21 OCTOBER 1968
041948,000024:                                                                                                  #  MODIFIED BY BEALS TO ELIMINATE CSMMASS UPDATE LOGIC (NOW DONE IN S40.8)
041949,000025:                                                                                                  #  FUNCTIONAL DESCRIPTION....
041950,000026: 
041951,000027:                                                                                                  #       *A SELF-PERPETUATING WAITLIST TASK AT 1/2 SECOND INTERVALS WHICH:
041952,000028:                                                                                                  #        PREPARES THE ROLL DAP WITH OGA (CDUX)
041953,000029:                                                                                                  #        PREPARES THE ROLL FDAI NEEDLE (FLY-TO  OGA ERROR)
041954,000030:                                                                                                  #        PREPARES THE ROLL PHASE PLANE  OGAERR  (FLY-FROM  OGA ERROR)
041955,000031:                                                                                                  #        PREPARES THE TVC ROLLDAP TASK WAITLIST CALL (3 CS DELAY)
041956,000032:                                                                                                  #        UPDATES THE NEEDLES DISPLAY
041957,000033:                                                                                                  #        CALLS MASSPROP TO UPDATE INERTIA DATA
041958,000034:                                                                                                  #        UPDATES PITCH, YAW, AND ROLL DAP GAINS FROM MASSPROP DATA
041959,000035:                                                                                                  #        PERFORMS ONE-SHOT CORRECTION FOR TMC LOOP 0-3 SEC AFTER IGNITION
041960,000036:                                                                                                  #        PERFORMS REPETITIVE UPDATES FOR TMC LOOP AFTER THE ONE-SHOT CORR.
041961,000037: 
041962,000038:                                                                                                  #  CALLING SEQUENCE....
041963,000039: 
041964,000040:                                                                                                  #       *TVCEXEC CALLED AS A WAITLIST TASK, IN PARTICULAR BY TVCINIT4 AND BY
041965,000041:                                                                                                  #        ITSELF, BOTH AT 1/2 SECOND INTERVALS
041966,000042: 
041967,000043:                                                                                                  #  NORMAL EXIT MODE.... TASKOVER
041968,000044: 
041969,000045:                                                                                                  #  ALARM OR ABORT EXIT MODES.... NONE
041970,000046: 
041971,000047:                                                                                                  #  SUBROUTINES CALLED....NEEDLER, S40.15, MASSPROP, TASKOVER, IBNKCALL
041972,000048: 
041973,000049:                                                                                                  #  OTHER INTERFACES....
041974,000050: 
041975,000051:                                                                                                  #       *TVCRESTART PACKAGE FOR RESTARTS
041976,000052:                                                                                                  #       *PITCHDAP, YAWDAP FOR VARIABLE GAINS AND ENGINE TRIM ANGLES
041977,000053:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED....
041978,000054: 
041979,000055:                                                                                                  #       *SEE TVCDAPON....TVCINIT4
041980,000056:                                                                                                  #       *VARK AND 1/CONACC (S40.15 OF TVCINITIALIZE)
041981,000057:                                                                                                  #       *PAD LOAD EREPFRAC
041982,000058:                                                                                                  #       *BITS 15,14 OF FLAGWRD6 (T5 BITS)
041983,000059:                                                                                                  #       *TVCEXPHS FOR RESTARTS
041984,000060:                                                                                                  #       *ENGINE-ON BIT (11.13) FOR RESTARTS
041985,000061:                                                                                                  #       *CDUX, OGAD
041986,000062: 
041987,000063:                                                                                                  #  OUTPUT....
041988,000064: 
041989,000065:                                                                                                  #       *ROLL DAP OGANOW, FDAI NEEDLE (AK). AND PHASE PLANE OGAERR
041990,000066:                                                                                                  #       *VARIABLE GAINS FOR PITCH/YAW AND ROLL TVC DAPS
041991,000067:                                                                                                  #       *SINGLE-SHOT AND REPETITIVE CORRECTIONS TO ENGINE TRIM ANGLES
041992,000068:                                                                                                  #        PACTOFF AND YACTOFF
041993,000069:                                                                                                  #  DEBRIS.... MUCH, BUT SHAREABLE WITH RCS/ENTRY, ALL IN EBANK6
041994,000070: 

Page 951

041996,000072: 16,2000                                           SETLOC   DAPROLL                               
041997,000073: 16,2000                                           BANK                                           
041998,000074: 16,3037  E6,1446                                  EBANK=   CNTR                                  
041999,000075: 16,3037                                           COUNT*   $$/TVCX                               
042000,000076: 
042001,000077: 
042002,000078: 16,3037           40102        TVCEXEC            CS       FLAGWRD6                              #  CHECK FOR TERMINATION (BITS 15,14 READ
042003,000079: 16,3040           74076                           MASK     DPCONFIG                              #  10 FROM TVCDAPON TO RCSDAPON
042004,000080: 16,3041           00006                           EXTEND                                         
042005,000081: 16,3042           63217                           BZMF     TVCEXFIN                              #  TERMINATE
042006,000082: 
042007,000083: 16,3043           35011                           CAF      .5SEC                                 #  W.L. CALL TO PERPETUATE TVCEXEC
042008,000084: 16,3044           05223                           TC       TWIDDLE                               
042009,000085: 16,3045           03037                           ADRES    TVCEXEC                               
042010,000086: 16,3046           30032        ROLLPREP           CAE      CDUX                                  #  UPDATE ROLL LADDERS (NO NEED TO RESTART-
042011,000087: 16,3047           57645                           XCH      OGANOW                                #        PROTECT, SINCE ROLL DAPS RE-START)
042012,000088: 16,3050           57646                           XCH      OGAPAST                               
042013,000089: 
042014,000090: 16,3051           31447                           CAE      OGAD                                  #  PREPARE ROLL FDAI NEEDLE  WITH FLY-TO
042015,000091: 16,3052           00006                           EXTEND                                         #        ERROR (COMMAND - MEASURED)
042016,000092: 16,3053           21645                           MSU      OGANOW                                
042017,000093: 16,3054           55476                           TS       AK                                    #  FLY-TO OGA ERROR, SC.AT B-1 REVS
042018,000094: 
042019,000095: 16,3055           00006                           EXTEND                                         #  PREPARE ROLL DAP PHASE PLANE  OGAERR
042020,000096: 16,3056           74751                           MP       -BIT14                                
042021,000097: 16,3057           55647                           TS       OGAERR                                #  PHASE-PLANE (FLY-FROM) OGAERROR,
042022,000098:                                                                                                  #        SC.AT B+0 REVS
042023,000099: 
042024,000100: 16,3060           36214                           CAF      THREE                                 #  SET UP ROLL DAP TASK (ALLOW SOME TIME)
042025,000101: 16,3061           05223                           TC       TWIDDLE                               
042026,000102: 16,3062           03342                           ADRES    ROLLDAP                               
042027,000103: 16,3063           04714        NEEDLEUP           TC       IBNKCALL                              #  DO A NEEDLES UPDATE (RETURNS AFTER CADR)
042028,000104: 16,3064           42425                           CADR     NEEDLER                               #        (NEEDLES RESTARTS ITSELF)
042029,000105: 
042030,000106: 16,3065           11634        VARGAINS           CCS      VCNTR                                 #  TEST FOR GAIN UPDATE TIME
042031,000107: 16,3066           13074                           TCF      EXECCOPY                              #  NOT YET                       
042032,000108: 16,3067           04714        GAINCHNG           TC       IBNKCALL                              #  UPDATE IXX, IAVG, IAVG/TLX
042033,000109: 16,3070           13347                           CADR     FIXCW                                 #  MASSPROP ENTRY  (ALREADY INITIALIZED)
042034,000110: 16,3071           04714                           TC       IBNKCALL                              #  UPDATE 1/CONACC, VARK
042035,000111: 16,3072           36452                           CADR     S40.15                                #        (S40.15 IS IN TVCINITIALIZE)
042036,000112: 16,3073           34351                           CAF      NINETEEN                              #  RESET THE VARIABLE-GAIN UPDATE COUNTER
042037,000113: 16,3074           55634        EXECCOPY           TS       VCNTR                                 
042038,000114: 16,3075           11446        1SHOTCHK           CCS      CNTR                                  #  CHECK TIME FOR ONE-SHOT OR REPCORR
042039,000115: 16,3076           13102                           TCF      +4                                    #        NOT YET
042040,000116: 16,3077           13115                           TCF      1SHOTOK                               #        NOW
042041,000117: 16,3100           13106                           TCF      REPCHEK                               #        ONE-SHOT OVER, ON TO REPCORR
042042,000118: 16,3101           13115                           TCF      1SHOTOK                               #        NOW  (ONE-SHOT ONLY, NO REPCORR)
042043,000119: 
042044,000120: 16,3102           55661                 +4        TS       CNTRTMP                               #  COUNT DOWN
042045,000121: 16,3103           34766                           CAF      FOUR                                  #  SET UP TVCEXPHS FOR ENTRY AT CNTRCOPY

Page 952

042047,000123: 16,3104           55644                           TS       TVCEXPHS                              
042048,000124: 16,3105           13215                           TCF      CNTRCOPY                              
042049,000125: 
042050,000126: 16,3106           31633        REPCHEK            CAE      REPFRAC                               #  CHECK FOR REPETITIVE UPDATES
042051,000127: 16,3107           00006                           EXTEND                                         
042052,000128: 16,3110           63217                           BZMF     TVCEXFIN                              #        NO, OVER-AND-OUT
042053,000129: 16,3111           55445                           TS       TEMPDAP    +1                         #        YES, SET UP CORRECTION FRACTION
042054,000130: 16,3112           34767                           CAF      TWO                                   #  SET UP TVCEXPHS FOR ENTRY AT CORSETUP
042055,000131: 16,3113           55644                           TS       TVCEXPHS                              
042056,000132: 16,3114           13126                           TCF      CORSETUP                              
042057,000133: 
042058,000134: 16,3115           34762        1SHOTOK            CAF      ENGONBIT                              
042059,000135: 16,3116           70101                           MASK     FLAGWRD5                              
042060,000136: 16,3117           10000                           CCS      A                                     
042061,000137: 16,3120           13122                           TCF      +2                                    #        ONE-SHOT OK
042062,000138: 16,3121           13217                           TCF      TVCEXFIN                              #        NO, TERMINATE
042063,000139: 
042064,000140: 16,3122           25644                           INCR     TVCEXPHS                              #                                        (1)
042065,000141: 16,3123           34754        TEMPSET            CAF      FCORFRAC                              #        SET UP CORRECTION FRACTION
042066,000142: 16,3124           55445                           TS       TEMPDAP    +1                         
042067,000143: 
042068,000144: 16,3125           25644                           INCR     TVCEXPHS                              #  ENTRY FROM REPCHECK AT NEXT LOCATION  (2)
042069,000145: 16,3126           31465        CORSETUP           CAE      DAPDATR1                              #  CHECK FOR LEM-OFF/ON
042070,000146: 16,3127           74754                           MASK     BIT13                                 #  (NOTE, SHOWS LEM-OFF)
042071,000147: 16,3130           00006                           EXTEND                                         
042072,000148: 16,3131           13133                           BZF      +2                                    #  LEM IS ON,  PICK UP   TEMPDAP+1
042073,000149: 16,3132           31445                           CAE      TEMPDAP    +1                         #  LEM IS OFF, PICK UP 2(TEMPDAP+1)
042074,000150: 16,3133           61445                           AD       TEMPDAP    +1                         
042075,000151: 16,3134           55444                           TS       TEMPDAP                               #  CG.CORR USES TEMPDAP
042076,000152: 
042077,000153: 16,3135           37702                           CAF      NEGONE                                #  SET UP FOR CNTR = -1 (ONE-SHOT DONE)
042078,000154: 16,3136           55661                           TS       CNTRTMP                               #        (COPYCYCLE AT .CNTRCOPY.)
042079,000155: 
042080,000156: 16,3137           00006        CG.CORR            EXTEND                                         #  PITCH TMC LOOP
042081,000157: 16,3140           31606                           DCA      PDELOFF                               
042082,000158: 16,3141           53656                           DXCH     PACTTMP                               
042083,000159: 16,3142           00006                           EXTEND                                         
042084,000160: 16,3143           41606                           DCS      PDELOFF                               
042085,000161: 16,3144           20001                           DDOUBL                                         
042086,000162: 16,3145           20001                           DDOUBL                                         
042087,000163: 16,3146           53612                           DXCH     TTMP1                                 
042088,000164: 16,3147           00006                           EXTEND                                         
042089,000165: 16,3150           31602                           DCA      DELPBAR                               
042090,000166: 16,3151           20001                           DDOUBL                                         
042091,000167: 16,3152           20001                           DDOUBL                                         
042092,000168: 16,3153           21612                           DAS      TTMP1                                 
042093,000169: 16,3154           00006                           EXTEND                                         
042094,000170: 16,3155           31612                           DCA      TTMP1                                 
042095,000171: 16,3156           00006                           EXTEND                                         
042096,000172: 16,3157           71444                           MP       TEMPDAP                               

Page 953

042098,000174: 16,3160           21656                           DAS      PACTTMP                               
042099,000175: 
042100,000176: 16,3161           00006                           EXTEND                                         #  YAW TMC LOOP
042101,000177: 16,3162           31610                           DCA      YDELOFF                               
042102,000178: 16,3163           53660                           DXCH     YACTTMP                               
042103,000179: 16,3164           00006                           EXTEND                                         
042104,000180: 16,3165           41610                           DCS      YDELOFF                               
042105,000181: 16,3166           20001                           DDOUBL                                         
042106,000182: 16,3167           20001                           DDOUBL                                         
042107,000183: 16,3170           53612                           DXCH     TTMP1                                 
042108,000184: 16,3171           00006                           EXTEND                                         
042109,000185: 16,3172           31604                           DCA      DELYBAR                               
042110,000186: 16,3173           20001                           DDOUBL                                         
042111,000187: 16,3174           20001                           DDOUBL                                         
042112,000188: 16,3175           21612                           DAS      TTMP1                                 
042113,000189: 16,3176           00006                           EXTEND                                         
042114,000190: 16,3177           31612                           DCA      TTMP1                                 
042115,000191: 16,3200           00006                           EXTEND                                         
042116,000192: 16,3201           71444                           MP       TEMPDAP                               
042117,000193: 16,3202           21660                           DAS      YACTTMP                               
042118,000194: 
042119,000195: 16,3203           25644        CORCOPY            INCR     TVCEXPHS                              #  RESTART PROTECT THE COPYCYCLE         (3)
042120,000196: 16,3204           00006                           EXTEND                                         #  TRIM-ESTIMATES, AND
042121,000197: 16,3205           31656                           DCA      PACTTMP                               
042122,000198: 16,3206           55423                           TS       PACTOFF                               #        TRIMS
042123,000199: 16,3207           53606                           DXCH     PDELOFF                               
042124,000200: 
042125,000201: 16,3210           00006                           EXTEND                                         
042126,000202: 16,3211           31660                           DCA      YACTTMP                               
042127,000203: 16,3212           55424                           TS       YACTOFF                               
042128,000204: 16,3213           53610                           DXCH     YDELOFF                               
042129,000205: 
042130,000206: 16,3214           25644                           INCR     TVCEXPHS                              #  ENTRY FROM 1SHOTCHK AT NEXT LOCATION  (4)
042131,000207: 16,3215           31661        CNTRCOPY           CAE      CNTRTMP                               #  UPDATE CNTR (RESTARTS OK, FOLLOWS CPYCY)
042132,000208: 16,3216           55446                           TS       CNTR                                  
042133,000209: 
042134,000210: 16,3217           34772        TVCEXFIN           CAF      ZERO                                  #  RESET TVCEXPHS
042135,000211: 16,3220           55644                           TS       TVCEXPHS                              
042136,000212: 16,3221           15314                           TCF      TASKOVER                              #  TVCEXECUTIVE FINISHED
042137,000213: 
042138,000214: 
042139,000215: 16,3222     4754               FCORFRAC           =        BIT13                                 #  ONE-SHOT CORRECTION FRACTION  

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