Source Code

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

The starting point was the source code of Comanche 45 (itself previously accurately reconstructed). Comanche 45 source code was then modified by incorporating changes known from contemporary documentation to have been made between revisions 45 and 45/2. The now-reconstructed Comanche 45/2 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:
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.

041197,000002:                                                                                                  ## Copyright:   Public domain.
041198,000003:                                                                                                  ## Filename:    TVCEXECUTIVE.agc
041199,000004:                                                                                                  ## Purpose:     A section of Manche45 revision 2.
041200,000005:                                                                                                  ##              It is part of the reconstructed source code for the
041201,000006:                                                                                                  ##              final, flown release of the flight software for the Command
041202,000007:                                                                                                  ##              Module's (CM) Apollo Guidance Computer (AGC) for Apollo 10.
041203,000008:                                                                                                  ##              The code has been recreated from a copy of Comanche 055. It
041204,000009:                                                                                                  ##              has been adapted such that the resulting bugger words
041205,000010:                                                                                                  ##              exactly match those specified for Manche 45/2 in NASA drawing
041206,000011:                                                                                                  ##              2021153D, which gives relatively high confidence that the
041207,000012:                                                                                                  ##              reconstruction is correct.
041208,000013:                                                                                                  ## Assembler:   yaYUL
041209,000014:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
041210,000015:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
041211,000016:                                                                                                  ## Mod history: 2020-12-24 MAS  Created from Comanche 45.
041212,000017: 

Page 945

041214,000019:                                                                                                  #  PROGRAM NAME....      TVCEXECUTIVE, CONSISTING OF TVCEXEC, NEEDLEUP, VARGAINS
041215,000020:                                                                                                  #                        1SHOTCHK, REPCHEK, CG.CORR, COPYCYCLES, ETC.
041216,000021:                                                                                                  #  LOG SECTION...        TVCEXECUTIVE            SUBROUTINE...DAPCSM
041217,000022:                                                                                                  #  MODIFIED BY SCHLUNDT                          21 OCTOBER 1968
041218,000023: 
041219,000024:                                                                                                  #  FUNCTIONAL DESCRIPTION....
041220,000025:                                                                                                  #       *A SELF-PERPETUATING WAITLIST TASK AT 1/2 SECOND INTERVALS WHICH:
041221,000026:                                                                                                  #        PREPARES THE ROLL DAP WITH OGA (CDUX)
041222,000027:                                                                                                  #        PREPARES THE ROLL FDAI NEEDLE (FLY-TO  OGA ERROR)
041223,000028:                                                                                                  #        PREPARES THE ROLL PHASE PLANE  OGAERR  (FLY-FROM  OGA ERROR)
041224,000029:                                                                                                  #        PREPARES THE TVC ROLLDAP TASK WAITLIST CALL (3 CS DELAY)
041225,000030:                                                                                                  #        UPDATES THE NEEDLES DISPLAY
041226,000031:                                                                                                  #        UPDATES VEHICLE MASS AND CALLS MASSPROP TO UPDATE INERTIA DATA
041227,000032:                                                                                                  #        UPDATES PITCH, YAW, AND ROLL DAP GAINS FROM MASSPROP DATA
041228,000033:                                                                                                  #        PERFORMS ONE-SHOT CORRECTION FOR TMC LOOP 0-3 SEC AFTER IGNITION
041229,000034:                                                                                                  #        PERFORMS REPETITIVE UPDATES FOR TMC LOOP AFTER THE ONE-SHOT CORR.
041230,000035: 
041231,000036:                                                                                                  #  CALLING SEQUENCE....
041232,000037:                                                                                                  #       *TVCEXEC CALLED AS A WAITLIST TASK, IN PARTICULAR BY TVCINIT4 AND BY
041233,000038:                                                                                                  #        ITSELF, BOTH AT 1/2 SECOND INTERVALS
041234,000039: 
041235,000040:                                                                                                  #  NORMAL EXIT MODE.... TASKOVER
041236,000041: 
041237,000042:                                                                                                  #  ALARM OR ABORT EXIT MODES.... NONE
041238,000043: 
041239,000044:                                                                                                  #  SUBROUTINES CALLED....NEEDLER, S40.15, MASSPROP, TASKOVER, IBNKCALL
041240,000045: 
041241,000046:                                                                                                  #  OTHER INTERFACES....
041242,000047:                                                                                                  #       *TVCRESTART PACKAGE FOR RESTARTS
041243,000048:                                                                                                  #       *PITCHDAP, YAWDAP FOR VARIABLE GAINS AND ENGINE TRIM ANGLES
041244,000049: 
041245,000050:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED....
041246,000051:                                                                                                  #       *SEE TVCDAPON....TVCINIT4
041247,000052:                                                                                                  #       *VARK AND 1/CONACC (S40.15 OF TVCINITIALIZE)
041248,000053:                                                                                                  #       *PAD LOAD EREPFRAC
041249,000054:                                                                                                  #       *BITS 15,14 OF FLAGWRD6 (T5 BITS)
041250,000055:                                                                                                  #       *TVCEXPHS FOR RESTARTS
041251,000056:                                                                                                  #       *ENGINE-ON BIT (11.13) FOR RESTARTS
041252,000057:                                                                                                  #       *CDUX, OGAD
041253,000058: 
041254,000059:                                                                                                  #  OUTPUT....
041255,000060:                                                                                                  #       *ROLL DAP OGANOW, FDAI NEEDLE (AK). AND PHASE PLANE OGAERR
041256,000061:                                                                                                  #       *VARIABLE GAINS FOR PITCH/YAW AND ROLL TVC DAPS
041257,000062:                                                                                                  #       *SINGLE-SHOT AND REPETITIVE CORRECTIONS TO ENGINE TRIM ANGLES
041258,000063:                                                                                                  #        PACTOFF AND YACTOFF
041259,000064: 
041260,000065:                                                                                                  #  DEBRIS....    MUCH, BUT SHAREABLE WITH RCS/ENTRY, ALL IN EBANK6
041261,000066: 

Page 946

041263,000068: 16,2715                                           BANK     16                                    
041264,000069: 16,2000                                           SETLOC   DAPROLL                               
041265,000070: 16,2000                                           BANK                                           
041266,000071: 16,2715  E6,1702                                  EBANK=   BZERO                                 
041267,000072: 16,2715                                           COUNT*   $$/TVCX                               
041268,000073: 
041269,000074: 16,2715           40102        TVCEXEC            CS       FLAGWRD6                              #  CHECK FOR TERMINATION (BITS 15,14 READ
041270,000075: 16,2716           74105                           MASK     OCT60000                              #        10 FROM TVCDAPON TO RCSDAPON)
041271,000076: 16,2717           00006                           EXTEND                                         
041272,000077: 16,2720           63131                           BZMF     TVCEXFIN                              #  TERMINATE
041273,000078: 
041274,000079: 16,2721           35036                           CAF      .5SEC                                 #  W.L. CALL TO PERPETUATE TVCEXEC
041275,000080: 16,2722           05245                           TC       WAITLIST                              
041276,000081: 16,2723  E6,1702                                  EBANK=   BZERO                                 
041277,000082: 16,2723           02715 34066                     2CADR    TVCEXEC                               
041278,000083: 
041279,000084: 16,2725           30032        ROLLPREP           CAE      CDUX                                  #  UPDATE ROLL LADDERS (NO NEED TO RESTART-
041280,000085: 16,2726           57662                           XCH      OGANOW                                #        PROTECT, SINCE ROLL DAPS RE-START)
041281,000086: 16,2727           57663                           XCH      OGAPAST                               
041282,000087: 
041283,000088: 16,2730           31450                           CAE      OGAD                                  #  PREPARE ROLL FDAI NEEDLE WITH FLY-TO
041284,000089: 16,2731           00006                           EXTEND                                         #        ERROR (COMMAND - MEASURED)
041285,000090: 16,2732           21662                           MSU      OGANOW                                
041286,000091: 16,2733           55476                           TS       AK                                    #  FLY-TO OGA ERROR, SC.AT B-1 REVS
041287,000092: 
041288,000093: 16,2734           00006                           EXTEND                                         #  PREPARE ROLL DAP PHASE PLANE OGAERR
041289,000094: 16,2735           77705                           MP       -BIT14                                
041290,000095: 16,2736           55664                           TS       OGAERR                                #  PHASE-PLANE (FLY-FROM) OGAERROR,
041291,000096:                                                                                                  #        SC.AT B+0 REVS
041292,000097: 
041293,000098: 16,2737           36214                           CAF      THREE                                 #  SET UP ROLL DAP TASK (ALLOW SOME TIME)
041294,000099: 16,2740           05245                           TC       WAITLIST                              
041295,000100: 16,2741  E6,1702                                  EBANK=   BZERO                                 
041296,000101: 16,2741           03267 34066                     2CADR    ROLLDAP                               
041297,000102: 
041298,000103: 16,2743           04740        NEEDLEUP           TC       IBNKCALL                              #  DO A NEEDLES UPDATE (RETURNS AFTER CADR)
041299,000104: 16,2744           42420                           CADR     NEEDLER                               #        (NEEDLES RESTARTS ITSELF)
041300,000105: 
041301,000106: 16,2745           35003        VARGAINS           CAF      BIT13                                 #  CHECK ENGINE-ON BIT TO INHIBIT VARIABLE
041302,000107: 16,2746           00006                           EXTEND                                         #        GAINS AND MASS IF ENGINE OFF
041303,000108: 16,2747           02011                           RAND     DSALMOUT                              #  CHANNEL 11
041304,000109: 16,2750           10000                           CCS      A                                     
041305,000110: 16,2751           12755                           TCF      +4                                    #        ON, SO OK TO UPDATE GAINS AND MASS
041306,000111: 16,2752           35016                 +5        CAF      TWO                                   #        OFF, SO BYPASS MASS/GAIN UPDATES,
041307,000112: 16,2753           55651                           TS       TVCEXPHS                              #                ALSO ENTRY FROM CCS BELOW WITH
041308,000113: 16,2754           13006                           TCF      1SHOTCHK                              #                VCNTR = -0 (V97 R40 ENGFAIL)
041309,000114: 16,2755           11643                           CCS      VCNTR                                 #        TEST FOR GAIN UPDATE TIME
041310,000115: 16,2756           12762                           TCF      +4                                    #                NOT YET

Page 947

041312,000117: 16,2757           12766                           TCF      GAINCHNG                              #                NOW
041313,000118: 16,2760           12760                           TCF      +0                                    #                NOT USED
041314,000119: 16,2761           12752                           TCF      VARGAINS   +5                         #                NO, LOTHRUST (S40.8 R40)
041315,000120: 
041316,000121: 16,2762           55653                 +4        TS       VCNTRTMP                              #        PROTECT VCNTR AND
041317,000122: 16,2763           31474                           CAE      CSMMASS                               #        CSMMASS DURING AN IMPULSIVE BURN
041318,000123: 16,2764           55652                           TS       MASSTMP                               
041319,000124: 16,2765           12777                           TCF      EXECCOPY                              
041320,000125: 
041321,000126: 16,2766           04740        GAINCHNG           TC       IBNKCALL                              #  UPDATE IXX, IAVG, IAVG/TLX
041322,000127: 16,2767           13422                           CADR     FIXCW                                 #  MASSPROP ENTRY (ALREADY INITIALIZED)
041323,000128: 16,2770           04740                           TC       IBNKCALL                              #  UPDATE 1/CONACC, VARK
041324,000129: 16,2771           36462                           CADR     S40.15                                #        (S40.15 IS IN TVCINITIALIZE)
041325,000130: 16,2772           41637                           CS       TENMDOT                               #  UPDATE MASS FOR NEXT 10 SEC. OF BURN
041326,000131: 16,2773           61474                           AD       CSMMASS                               
041327,000132: 16,2774           55652                           TS       MASSTMP                               #  KG B+16
041328,000133: 
041329,000134: 16,2775           34374                           CAF      NINETEEN                              #  RESET THE VARIABLE-GAIN UPDATE COUNTER
041330,000135: 16,2776           55653                           TS       VCNTRTMP                              
041331,000136: 
041332,000137: 16,2777           25651        EXECCOPY           INCR     TVCEXPHS                              #  RESTART-PROTECT THE COPYCYCLE         (1)
041333,000138: 
041334,000139: 16,3000           31652                           CAE      MASSTMP                               #  CSMMASS KG B+16
041335,000140: 16,3001           55474                           TS       CSMMASS                               
041336,000141: 
041337,000142: 16,3002           31653                           CAE      VCNTRTMP                              #  VCNTR
041338,000143: 16,3003           55643                           TS       VCNTR                                 
041339,000144: 16,3004           55444                           TS       V97VCNTR                              #  FOR ENGFAIL (R41) MASS UPDATES AT SPSOFF
041340,000145: 
041341,000146: 16,3005           25651                           INCR     TVCEXPHS                              #  COPYCYCLE OVER                        (2)
041342,000147: 
041343,000148: 16,3006           11447        1SHOTCHK           CCS      CNTR                                  #  CHECK TIME FOR ONE-SHOT OR REPCORR
041344,000149: 16,3007           13013                           TCF      +4                                    #        NOT YET
041345,000150: 16,3010           13026                           TCF      1SHOTOK                               #        NOW
041346,000151: 16,3011           13017                           TCF      REPCHEK                               #        ONE-SHOT OVER, ON TO REPCORR
041347,000152: 16,3012           13026                           TCF      1SHOTOK                               #        NOW (ONE-SHOT ONLY, NO REPCORR)
041348,000153: 
041349,000154: 16,3013           55676                 +4        TS       CNTRTMP                               #  COUNT DOWN
041350,000155: 16,3014           36211                           CAF      SIX                                   #  SETUP TVCEXPHS FOR ENTRY AT CNTRCOPY
041351,000156: 16,3015           55651                           TS       TVCEXPHS                              
041352,000157: 16,3016           13127                           TCF      CNTRCOPY                              
041353,000158: 
041354,000159: 16,3017           31642        REPCHEK            CAE      REPFRAC                               #  CHECK FOR REPETITIVE UPDATES
041355,000160: 16,3020           00006                           EXTEND                                         
041356,000161: 16,3021           63131                           BZMF     TVCEXFIN                              #        NO,  OVER-AND-OUT
041357,000162: 16,3022           55446                           TS       TEMPDAP    +1                         #        YES, SET UP CORRECTION FRACTION
041358,000163: 16,3023           35015                           CAF      FOUR                                  #  SET UP TVCEXPHS FOR ENTRY AT CORSETUP
041359,000164: 16,3024           55651                           TS       TVCEXPHS                              
041360,000165: 16,3025           13040                           TCF      CORSETUP                              

Page 948

041362,000167: 16,3026           35003        1SHOTOK            CAF      BIT13                                 #  CHECK ENGINE-ON BIT, NOT PERMITTING
041363,000168: 16,3027           00006                           EXTEND                                         #        ONE-SHOT DURING ENGINE-SHUTDOWN
041364,000169: 16,3030           02011                           RAND     DSALMOUT                              
041365,000170: 16,3031           10000                           CCS      A                                     
041366,000171: 16,3032           13034                           TCF      +2                                    #        ONE-SHOT OK
041367,000172: 16,3033           13131                           TCF      TVCEXFIN                              #        NO, TERMINATE
041368,000173: 
041369,000174: 16,3034           25651                           INCR     TVCEXPHS                              #                                        (3)
041370,000175: 
041371,000176: 16,3035           33134        TEMPSET            CAF      FCORFRAC                              #        SET UP CORRECTION FRACTION
041372,000177: 16,3036           55446                           TS       TEMPDAP    +1                         
041373,000178: 
041374,000179: 16,3037           25651                           INCR     TVCEXPHS                              #  ENTRY FROM REPCHEK AT NEXT LOCATION   (4)
041375,000180: 
041376,000181: 16,3040           31466        CORSETUP           CAE      DAPDATR1                              #  CHECK FOR LEM-OFF/ON
041377,000182: 16,3041           75003                           MASK     BIT13                                 #  (NOTE, SHOWS LEM-OFF)
041378,000183: 16,3042           00006                           EXTEND                                         
041379,000184: 16,3043           13045                           BZF      +2                                    #  LEM IS ON,  PICK UP   TEMPDAP+1
041380,000185: 16,3044           31446                           CAE      TEMPDAP    +1                         #  LEM IS OFF, PICK UP 2(TEMPDAP+1)
041381,000186: 16,3045           61446                           AD       TEMPDAP    +1                         
041382,000187: 16,3046           55445                           TS       TEMPDAP                               #  CG.CORR USES TEMPDAP
041383,000188: 
041384,000189: 16,3047           37716                           CAF      NEGONE                                #  SET UP FOR CNTR = -1 (ONE-SHOT DONE)
041385,000190: 16,3050           55676                           TS       CNTRTMP                               #        (COPYCYCLE AT .CNTRCOPY.)
041386,000191: 
041387,000192: 16,3051           00006        CG.CORR            EXTEND                                         #  PITCH TMC LOOP
041388,000193: 16,3052           31606                           DCA      PDELOFF                               
041389,000194: 16,3053           53673                           DXCH     PACTTMP                               
041390,000195: 16,3054           00006                           EXTEND                                         
041391,000196: 16,3055           41606                           DCS      PDELOFF                               
041392,000197: 16,3056           20001                           DDOUBL                                         
041393,000198: 16,3057           20001                           DDOUBL                                         
041394,000199: 16,3060           53612                           DXCH     TTMP1                                 
041395,000200: 16,3061           00006                           EXTEND                                         
041396,000201: 16,3062           31602                           DCA      DELPBAR                               
041397,000202: 16,3063           20001                           DDOUBL                                         
041398,000203: 16,3064           20001                           DDOUBL                                         
041399,000204: 16,3065           21612                           DAS      TTMP1                                 
041400,000205: 16,3066           00006                           EXTEND                                         
041401,000206: 16,3067           31612                           DCA      TTMP1                                 
041402,000207: 16,3070           00006                           EXTEND                                         
041403,000208: 16,3071           71445                           MP       TEMPDAP                               
041404,000209: 16,3072           21673                           DAS      PACTTMP                               
041405,000210: 
041406,000211: 16,3073           00006                           EXTEND                                         #  YAW TMC LOOP
041407,000212: 16,3074           31610                           DCA      YDELOFF                               
041408,000213: 16,3075           53675                           DXCH     YACTTMP                               
041409,000214: 16,3076           00006                           EXTEND                                         
041410,000215: 16,3077           41610                           DCS      YDELOFF                               
041411,000216: 16,3100           20001                           DDOUBL                                         

Page 949

041413,000218: 16,3101           20001                           DDOUBL                                         
041414,000219: 16,3102           53612                           DXCH     TTMP1                                 
041415,000220: 16,3103           00006                           EXTEND                                         
041416,000221: 16,3104           31604                           DCA      DELYBAR                               
041417,000222: 16,3105           20001                           DDOUBL                                         
041418,000223: 16,3106           20001                           DDOUBL                                         
041419,000224: 16,3107           21612                           DAS      TTMP1                                 
041420,000225: 16,3110           00006                           EXTEND                                         
041421,000226: 16,3111           31612                           DCA      TTMP1                                 
041422,000227: 16,3112           00006                           EXTEND                                         
041423,000228: 16,3113           71445                           MP       TEMPDAP                               
041424,000229: 16,3114           21675                           DAS      YACTTMP                               
041425,000230: 
041426,000231: 16,3115           25651        CORCOPY            INCR     TVCEXPHS                              #  RESTART PROTECT THE COPYCYCLE         (5)
041427,000232: 
041428,000233: 16,3116           00006                           EXTEND                                         #  TRIM-ESTIMATES, AND
041429,000234: 16,3117           31673                           DCA      PACTTMP                               
041430,000235: 16,3120           55423                           TS       PACTOFF                               #        TRIMS
041431,000236: 16,3121           53606                           DXCH     PDELOFF                               
041432,000237: 
041433,000238: 16,3122           00006                           EXTEND                                         
041434,000239: 16,3123           31675                           DCA      YACTTMP                               
041435,000240: 16,3124           55424                           TS       YACTOFF                               
041436,000241: 16,3125           53610                           DXCH     YDELOFF                               
041437,000242: 
041438,000243: 16,3126           25651                           INCR     TVCEXPHS                              #  ENTRY FROM 1SHOTCHK AT NEXT LOCATION  (6)
041439,000244: 
041440,000245: 16,3127           31676        CNTRCOPY           CAE      CNTRTMP                               #  UPDATE CNTR (RESTARTS OK, FOLLOWS CPYCY)
041441,000246: 16,3130           55447                           TS       CNTR                                  
041442,000247: 
041443,000248: 16,3131           35021        TVCEXFIN           CAF      ZERO                                  #  RESET TVCEXPHS
041444,000249: 16,3132           55651                           TS       TVCEXPHS                              
041445,000250: 16,3133           15324                           TCF      TASKOVER                              #  TVCEXECUTIVE FINISHED
041446,000251: 
041447,000252: 16,3134           10000        FCORFRAC           OCT      10000                                 #  ONE-SHOT CORRECTION FRACTION  
041448,000253: 

Page 950 This page is empty.

041451,000256: 
041452,000257: 

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