Source Code

These source-code files are part of a reconstructed copy of Comanche 45, the second release, though not the final mission release, of the Apollo 10 Command Module (CM) Apollo Guidance Computer (AGC) software. Comanche 45 was preceded by Comanche 44 and followed by Comanche 45/2 (the flown release). The reconstruction is believed to be exactly accurate, but in the absence of an actual Apollo-era listing of Comanche 45, some explanation of the reconstruction process is needed to insure confidence in that accuracy.

The starting point was the source code of Comanche 44 (itself previously accurately reconstructed). Comanche 44 source code was then modified by incorporating changes known from contemporary documentation to have been made between revisions 44 and 45. The now-reconstructed Comanche 45 source code was verified by assembling it and checking that the assembled code had the expected known-correct memory-bank checksums. Note that page numbers in the reconstructed code tend to match those in the Comanche 55, the most-similar revision of Comanche for which we have access to an actual non-reconstructed hardcopy; the source code would likely have different page numbers in a contemporary Comanche 45 listing.

Annotations that were not present in the contemporary source code have been added to the reconstructed code to justify each change relative to Comanche 44. Here's a guide to the Apollo documentation referenced in those annotations:
There is also a detailed commentary about the reconstruction process.

Comments expected to have been present in 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.

041297,000002:                                                                                                  ## Copyright:   Public domain.
041298,000003:                                                                                                  ## Filename:    TVCEXECUTIVE.agc
041299,000004:                                                                                                  ## Purpose:     A section of Comanche revision 045.
041300,000005:                                                                                                  ##              It is part of the reconstructed source code for the
041301,000006:                                                                                                  ##              second release of the flight software for the Command
041302,000007:                                                                                                  ##              Module's (CM) Apollo Guidance Computer (AGC) for Apollo 10.
041303,000008:                                                                                                  ##              The code has been recreated from a copy of Comanche 055. It
041304,000009:                                                                                                  ##              has been adapted such that the resulting bugger words
041305,000010:                                                                                                  ##              exactly match those specified for Comanche 45 in NASA drawing
041306,000011:                                                                                                  ##              2021153D, which gives relatively high confidence that the
041307,000012:                                                                                                  ##              reconstruction is correct.
041308,000013:                                                                                                  ## Assembler:   yaYUL
041309,000014:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
041310,000015:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
041311,000016:                                                                                                  ## Mod history: 2020-12-06 MAS  Created from Comanche 44.
041312,000017: 

Page 945

041314,000019:                                                                                                  #  PROGRAM NAME....      TVCEXECUTIVE, CONSISTING OF TVCEXEC, NEEDLEUP, VARGAINS
041315,000020:                                                                                                  #                        1SHOTCHK, REPCHEK, CG.CORR, COPYCYCLES, ETC.
041316,000021:                                                                                                  #  LOG SECTION...        TVCEXECUTIVE            SUBROUTINE...DAPCSM
041317,000022:                                                                                                  #  MODIFIED BY SCHLUNDT                          21 OCTOBER 1968
041318,000023: 
041319,000024:                                                                                                  #  FUNCTIONAL DESCRIPTION....
041320,000025:                                                                                                  #       *A SELF-PERPETUATING WAITLIST TASK AT 1/2 SECOND INTERVALS WHICH:
041321,000026:                                                                                                  #        PREPARES THE ROLL DAP WITH OGA (CDUX)
041322,000027:                                                                                                  #        PREPARES THE ROLL FDAI NEEDLE (FLY-TO  OGA ERROR)
041323,000028:                                                                                                  #        PREPARES THE ROLL PHASE PLANE  OGAERR  (FLY-FROM  OGA ERROR)
041324,000029:                                                                                                  #        PREPARES THE TVC ROLLDAP TASK WAITLIST CALL (3 CS DELAY)
041325,000030:                                                                                                  #        UPDATES THE NEEDLES DISPLAY
041326,000031:                                                                                                  #        UPDATES VEHICLE MASS AND CALLS MASSPROP TO UPDATE INERTIA DATA
041327,000032:                                                                                                  #        UPDATES PITCH, YAW, AND ROLL DAP GAINS FROM MASSPROP DATA
041328,000033:                                                                                                  #        PERFORMS ONE-SHOT CORRECTION FOR TMC LOOP 0-3 SEC AFTER IGNITION
041329,000034:                                                                                                  #        PERFORMS REPETITIVE UPDATES FOR TMC LOOP AFTER THE ONE-SHOT CORR.
041330,000035: 
041331,000036:                                                                                                  #  CALLING SEQUENCE....
041332,000037:                                                                                                  #       *TVCEXEC CALLED AS A WAITLIST TASK, IN PARTICULAR BY TVCINIT4 AND BY
041333,000038:                                                                                                  #        ITSELF, BOTH AT 1/2 SECOND INTERVALS
041334,000039: 
041335,000040:                                                                                                  #  NORMAL EXIT MODE.... TASKOVER
041336,000041: 
041337,000042:                                                                                                  #  ALARM OR ABORT EXIT MODES.... NONE
041338,000043: 
041339,000044:                                                                                                  #  SUBROUTINES CALLED....NEEDLER, S40.15, MASSPROP, TASKOVER, IBNKCALL
041340,000045: 
041341,000046:                                                                                                  #  OTHER INTERFACES....
041342,000047:                                                                                                  #       *TVCRESTART PACKAGE FOR RESTARTS
041343,000048:                                                                                                  #       *PITCHDAP, YAWDAP FOR VARIABLE GAINS AND ENGINE TRIM ANGLES
041344,000049: 
041345,000050:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED....
041346,000051:                                                                                                  #       *SEE TVCDAPON....TVCINIT4
041347,000052:                                                                                                  #       *VARK AND 1/CONACC (S40.15 OF TVCINITIALIZE)
041348,000053:                                                                                                  #       *PAD LOAD EREPFRAC
041349,000054:                                                                                                  #       *BITS 15,14 OF FLAGWRD6 (T5 BITS)
041350,000055:                                                                                                  #       *TVCEXPHS FOR RESTARTS
041351,000056:                                                                                                  #       *ENGINE-ON BIT (11.13) FOR RESTARTS
041352,000057:                                                                                                  #       *CDUX, OGAD
041353,000058: 
041354,000059:                                                                                                  #  OUTPUT....
041355,000060:                                                                                                  #       *ROLL DAP OGANOW, FDAI NEEDLE (AK). AND PHASE PLANE OGAERR
041356,000061:                                                                                                  #       *VARIABLE GAINS FOR PITCH/YAW AND ROLL TVC DAPS
041357,000062:                                                                                                  #       *SINGLE-SHOT AND REPETITIVE CORRECTIONS TO ENGINE TRIM ANGLES
041358,000063:                                                                                                  #        PACTOFF AND YACTOFF
041359,000064: 
041360,000065:                                                                                                  #  DEBRIS....    MUCH, BUT SHAREABLE WITH RCS/ENTRY, ALL IN EBANK6
041361,000066: 

Page 946

041363,000068: 16,2715                                           BANK     16                                    
041364,000069: 16,2000                                           SETLOC   DAPROLL                               
041365,000070: 16,2000                                           BANK                                           
041366,000071: 16,2715  E6,1702                                  EBANK=   BZERO                                 
041367,000072: 16,2715                                           COUNT*   $$/TVCX                               
041368,000073: 
041369,000074: 16,2715           40102        TVCEXEC            CS       FLAGWRD6                              #  CHECK FOR TERMINATION (BITS 15,14 READ
041370,000075: 16,2716           74105                           MASK     OCT60000                              #        10 FROM TVCDAPON TO RCSDAPON)
041371,000076: 16,2717           00006                           EXTEND                                         
041372,000077: 16,2720           63131                           BZMF     TVCEXFIN                              #  TERMINATE
041373,000078: 
041374,000079: 16,2721           35036                           CAF      .5SEC                                 #  W.L. CALL TO PERPETUATE TVCEXEC
041375,000080: 16,2722           05245                           TC       WAITLIST                              
041376,000081: 16,2723  E6,1702                                  EBANK=   BZERO                                 
041377,000082: 16,2723           02715 34066                     2CADR    TVCEXEC                               
041378,000083: 
041379,000084: 16,2725           30032        ROLLPREP           CAE      CDUX                                  #  UPDATE ROLL LADDERS (NO NEED TO RESTART-
041380,000085: 16,2726           57662                           XCH      OGANOW                                #        PROTECT, SINCE ROLL DAPS RE-START)
041381,000086: 16,2727           57663                           XCH      OGAPAST                               
041382,000087: 
041383,000088: 16,2730           31450                           CAE      OGAD                                  #  PREPARE ROLL FDAI NEEDLE WITH FLY-TO
041384,000089: 16,2731           00006                           EXTEND                                         #        ERROR (COMMAND - MEASURED)
041385,000090: 16,2732           21662                           MSU      OGANOW                                
041386,000091: 16,2733           55476                           TS       AK                                    #  FLY-TO OGA ERROR, SC.AT B-1 REVS
041387,000092: 
041388,000093: 16,2734           00006                           EXTEND                                         #  PREPARE ROLL DAP PHASE PLANE OGAERR
041389,000094: 16,2735           77705                           MP       -BIT14                                
041390,000095: 16,2736           55664                           TS       OGAERR                                #  PHASE-PLANE (FLY-FROM) OGAERROR,
041391,000096:                                                                                                  #        SC.AT B+0 REVS
041392,000097: 
041393,000098: 16,2737           36214                           CAF      THREE                                 #  SET UP ROLL DAP TASK (ALLOW SOME TIME)
041394,000099: 16,2740           05245                           TC       WAITLIST                              
041395,000100: 16,2741  E6,1702                                  EBANK=   BZERO                                 
041396,000101: 16,2741           03267 34066                     2CADR    ROLLDAP                               
041397,000102: 
041398,000103: 16,2743           04740        NEEDLEUP           TC       IBNKCALL                              #  DO A NEEDLES UPDATE (RETURNS AFTER CADR)
041399,000104: 16,2744           42420                           CADR     NEEDLER                               #        (NEEDLES RESTARTS ITSELF)
041400,000105: 
041401,000106: 16,2745           35003        VARGAINS           CAF      BIT13                                 #  CHECK ENGINE-ON BIT TO INHIBIT VARIABLE
041402,000107: 16,2746           00006                           EXTEND                                         #        GAINS AND MASS IF ENGINE OFF
041403,000108: 16,2747           02011                           RAND     DSALMOUT                              #  CHANNEL 11
041404,000109: 16,2750           10000                           CCS      A                                     
041405,000110: 16,2751           12755                           TCF      +4                                    #        ON, SO OK TO UPDATE GAINS AND MASS
041406,000111: 16,2752           35016                 +5        CAF      TWO                                   #        OFF, SO BYPASS MASS/GAIN UPDATES,
041407,000112: 16,2753           55651                           TS       TVCEXPHS                              #                ALSO ENTRY FROM CCS BELOW WITH
041408,000113: 16,2754           13006                           TCF      1SHOTCHK                              #                VCNTR = -0 (V97 R40 ENGFAIL)
041409,000114: 16,2755           11643                           CCS      VCNTR                                 #        TEST FOR GAIN UPDATE TIME
041410,000115: 16,2756           12762                           TCF      +4                                    #                NOT YET

Page 947

041412,000117: 16,2757           12766                           TCF      GAINCHNG                              #                NOW
041413,000118: 16,2760           12760                           TCF      +0                                    #                NOT USED
041414,000119: 16,2761           12752                           TCF      VARGAINS   +5                         #                NO, LOTHRUST (S40.8 R40)
041415,000120: 
041416,000121: 16,2762           55653                 +4        TS       VCNTRTMP                              #        PROTECT VCNTR AND
041417,000122: 16,2763           31474                           CAE      CSMMASS                               #        CSMMASS DURING AN IMPULSIVE BURN
041418,000123: 16,2764           55652                           TS       MASSTMP                               
041419,000124: 16,2765           12777                           TCF      EXECCOPY                              
041420,000125: 
041421,000126: 16,2766           04740        GAINCHNG           TC       IBNKCALL                              #  UPDATE IXX, IAVG, IAVG/TLX
041422,000127: 16,2767           13422                           CADR     FIXCW                                 #  MASSPROP ENTRY (ALREADY INITIALIZED)
041423,000128: 16,2770           04740                           TC       IBNKCALL                              #  UPDATE 1/CONACC, VARK
041424,000129: 16,2771           36462                           CADR     S40.15                                #        (S40.15 IS IN TVCINITIALIZE)
041425,000130: 16,2772           41637                           CS       TENMDOT                               #  UPDATE MASS FOR NEXT 10 SEC. OF BURN
041426,000131: 16,2773           61474                           AD       CSMMASS                               
041427,000132: 16,2774           55652                           TS       MASSTMP                               #  KG B+16
041428,000133: 
041429,000134: 16,2775           34374                           CAF      NINETEEN                              #  RESET THE VARIABLE-GAIN UPDATE COUNTER
041430,000135: 16,2776           55653                           TS       VCNTRTMP                              
041431,000136: 
041432,000137: 16,2777           25651        EXECCOPY           INCR     TVCEXPHS                              #  RESTART-PROTECT THE COPYCYCLE         (1)
041433,000138: 
041434,000139: 16,3000           31652                           CAE      MASSTMP                               #  CSMMASS KG B+16
041435,000140: 16,3001           55474                           TS       CSMMASS                               
041436,000141: 
041437,000142: 16,3002           31653                           CAE      VCNTRTMP                              #  VCNTR
041438,000143: 16,3003           55643                           TS       VCNTR                                 
041439,000144: 16,3004           55444                           TS       V97VCNTR                              #  FOR ENGFAIL (R41) MASS UPDATES AT SPSOFF
041440,000145: 
041441,000146: 16,3005           25651                           INCR     TVCEXPHS                              #  COPYCYCLE OVER                        (2)
041442,000147: 
041443,000148: 16,3006           11447        1SHOTCHK           CCS      CNTR                                  #  CHECK TIME FOR ONE-SHOT OR REPCORR
041444,000149: 16,3007           13013                           TCF      +4                                    #        NOT YET
041445,000150: 16,3010           13026                           TCF      1SHOTOK                               #        NOW
041446,000151: 16,3011           13017                           TCF      REPCHEK                               #        ONE-SHOT OVER, ON TO REPCORR
041447,000152: 16,3012           13026                           TCF      1SHOTOK                               #        NOW (ONE-SHOT ONLY, NO REPCORR)
041448,000153: 
041449,000154: 16,3013           55676                 +4        TS       CNTRTMP                               #  COUNT DOWN
041450,000155: 16,3014           36211                           CAF      SIX                                   #  SETUP TVCEXPHS FOR ENTRY AT CNTRCOPY
041451,000156: 16,3015           55651                           TS       TVCEXPHS                              
041452,000157: 16,3016           13127                           TCF      CNTRCOPY                              
041453,000158: 
041454,000159: 16,3017           31642        REPCHEK            CAE      REPFRAC                               #  CHECK FOR REPETITIVE UPDATES
041455,000160: 16,3020           00006                           EXTEND                                         
041456,000161: 16,3021           63131                           BZMF     TVCEXFIN                              #        NO,  OVER-AND-OUT
041457,000162: 16,3022           55446                           TS       TEMPDAP    +1                         #        YES, SET UP CORRECTION FRACTION
041458,000163: 16,3023           35015                           CAF      FOUR                                  #  SET UP TVCEXPHS FOR ENTRY AT CORSETUP
041459,000164: 16,3024           55651                           TS       TVCEXPHS                              
041460,000165: 16,3025           13040                           TCF      CORSETUP                              

Page 948

041462,000167: 16,3026           35003        1SHOTOK            CAF      BIT13                                 #  CHECK ENGINE-ON BIT, NOT PERMITTING
041463,000168: 16,3027           00006                           EXTEND                                         #        ONE-SHOT DURING ENGINE-SHUTDOWN
041464,000169: 16,3030           02011                           RAND     DSALMOUT                              
041465,000170: 16,3031           10000                           CCS      A                                     
041466,000171: 16,3032           13034                           TCF      +2                                    #        ONE-SHOT OK
041467,000172: 16,3033           13131                           TCF      TVCEXFIN                              #        NO, TERMINATE
041468,000173: 
041469,000174: 16,3034           25651                           INCR     TVCEXPHS                              #                                        (3)
041470,000175: 
041471,000176: 16,3035           33134        TEMPSET            CAF      FCORFRAC                              #        SET UP CORRECTION FRACTION
041472,000177: 16,3036           55446                           TS       TEMPDAP    +1                         
041473,000178: 
041474,000179: 16,3037           25651                           INCR     TVCEXPHS                              #  ENTRY FROM REPCHEK AT NEXT LOCATION   (4)
041475,000180: 
041476,000181: 16,3040           31466        CORSETUP           CAE      DAPDATR1                              #  CHECK FOR LEM-OFF/ON
041477,000182: 16,3041           75003                           MASK     BIT13                                 #  (NOTE, SHOWS LEM-OFF)
041478,000183: 16,3042           00006                           EXTEND                                         
041479,000184: 16,3043           13045                           BZF      +2                                    #  LEM IS ON,  PICK UP   TEMPDAP+1
041480,000185: 16,3044           31446                           CAE      TEMPDAP    +1                         #  LEM IS OFF, PICK UP 2(TEMPDAP+1)
041481,000186: 16,3045           61446                           AD       TEMPDAP    +1                         
041482,000187: 16,3046           55445                           TS       TEMPDAP                               #  CG.CORR USES TEMPDAP
041483,000188: 
041484,000189: 16,3047           37716                           CAF      NEGONE                                #  SET UP FOR CNTR = -1 (ONE-SHOT DONE)
041485,000190: 16,3050           55676                           TS       CNTRTMP                               #        (COPYCYCLE AT .CNTRCOPY.)
041486,000191: 
041487,000192: 16,3051           00006        CG.CORR            EXTEND                                         #  PITCH TMC LOOP
041488,000193: 16,3052           31606                           DCA      PDELOFF                               
041489,000194: 16,3053           53673                           DXCH     PACTTMP                               
041490,000195: 16,3054           00006                           EXTEND                                         
041491,000196: 16,3055           41606                           DCS      PDELOFF                               
041492,000197: 16,3056           20001                           DDOUBL                                         
041493,000198: 16,3057           20001                           DDOUBL                                         
041494,000199: 16,3060           53612                           DXCH     TTMP1                                 
041495,000200: 16,3061           00006                           EXTEND                                         
041496,000201: 16,3062           31602                           DCA      DELPBAR                               
041497,000202: 16,3063           20001                           DDOUBL                                         
041498,000203: 16,3064           20001                           DDOUBL                                         
041499,000204: 16,3065           21612                           DAS      TTMP1                                 
041500,000205: 16,3066           00006                           EXTEND                                         
041501,000206: 16,3067           31612                           DCA      TTMP1                                 
041502,000207: 16,3070           00006                           EXTEND                                         
041503,000208: 16,3071           71445                           MP       TEMPDAP                               
041504,000209: 16,3072           21673                           DAS      PACTTMP                               
041505,000210: 
041506,000211: 16,3073           00006                           EXTEND                                         #  YAW TMC LOOP
041507,000212: 16,3074           31610                           DCA      YDELOFF                               
041508,000213: 16,3075           53675                           DXCH     YACTTMP                               
041509,000214: 16,3076           00006                           EXTEND                                         
041510,000215: 16,3077           41610                           DCS      YDELOFF                               
041511,000216: 16,3100           20001                           DDOUBL                                         

Page 949

041513,000218: 16,3101           20001                           DDOUBL                                         
041514,000219: 16,3102           53612                           DXCH     TTMP1                                 
041515,000220: 16,3103           00006                           EXTEND                                         
041516,000221: 16,3104           31604                           DCA      DELYBAR                               
041517,000222: 16,3105           20001                           DDOUBL                                         
041518,000223: 16,3106           20001                           DDOUBL                                         
041519,000224: 16,3107           21612                           DAS      TTMP1                                 
041520,000225: 16,3110           00006                           EXTEND                                         
041521,000226: 16,3111           31612                           DCA      TTMP1                                 
041522,000227: 16,3112           00006                           EXTEND                                         
041523,000228: 16,3113           71445                           MP       TEMPDAP                               
041524,000229: 16,3114           21675                           DAS      YACTTMP                               
041525,000230: 
041526,000231: 16,3115           25651        CORCOPY            INCR     TVCEXPHS                              #  RESTART PROTECT THE COPYCYCLE         (5)
041527,000232: 
041528,000233: 16,3116           00006                           EXTEND                                         #  TRIM-ESTIMATES, AND
041529,000234: 16,3117           31673                           DCA      PACTTMP                               
041530,000235: 16,3120           55423                           TS       PACTOFF                               #        TRIMS
041531,000236: 16,3121           53606                           DXCH     PDELOFF                               
041532,000237: 
041533,000238: 16,3122           00006                           EXTEND                                         
041534,000239: 16,3123           31675                           DCA      YACTTMP                               
041535,000240: 16,3124           55424                           TS       YACTOFF                               
041536,000241: 16,3125           53610                           DXCH     YDELOFF                               
041537,000242: 
041538,000243: 16,3126           25651                           INCR     TVCEXPHS                              #  ENTRY FROM 1SHOTCHK AT NEXT LOCATION  (6)
041539,000244: 
041540,000245: 16,3127           31676        CNTRCOPY           CAE      CNTRTMP                               #  UPDATE CNTR (RESTARTS OK, FOLLOWS CPYCY)
041541,000246: 16,3130           55447                           TS       CNTR                                  
041542,000247: 
041543,000248: 16,3131           35021        TVCEXFIN           CAF      ZERO                                  #  RESET TVCEXPHS
041544,000249: 16,3132           55651                           TS       TVCEXPHS                              
041545,000250: 16,3133           15324                           TCF      TASKOVER                              #  TVCEXECUTIVE FINISHED
041546,000251: 
041547,000252: 16,3134           10000        FCORFRAC           OCT      10000                                 #  ONE-SHOT CORRECTION FRACTION  
041548,000253: 

Page 950 This page is empty.

041551,000256: 
041552,000257: 

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