Source Code

These source-code files are part of a reconstructed copy of Comanche 67, the Apollo Guidance Computer (AGC) Command Module (CM) software for Apollo 12.

They have been adapted from sources files for Comanche 55, and updated via disassembly of binary dumps of original core rope memory modules, part numbers 2003972-1081, 2003972-1091, 2003972-1111, 2003972-1121, 2003972-1131, and 2003972-1141.

Since only binary dumps (rather than listings) of Comanche 67 are available as source material, all comments and labels are approximate. They have been taken from other AGC programs where possible, or, in some places, written from scratch to match what we believe would have been in the original listing.

040303,000002:                                                                                                  ## Copyright:   Public domain.
040304,000003:                                                                                                  ## Filename:    TVCEXECUTIVE.agc
040305,000004:                                                                                                  ## Purpose:     A section of Comanche revision 067.
040306,000005:                                                                                                  ##              It is part of the reconstructed source code for the flight
040307,000006:                                                                                                  ##              software for the Command Module's (CM) Apollo Guidance Computer
040308,000007:                                                                                                  ##              (AGC) for Apollo 12. No original listings of this program are
040309,000008:                                                                                                  ##              available; instead, this file was created via dissassembly of
040310,000009:                                                                                                  ##              dumps of Comanche 067 core rope modules and comparison with
040311,000010:                                                                                                  ##              other AGC programs.
040312,000011:                                                                                                  ## Assembler:   yaYUL
040313,000012:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
040314,000013:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
040315,000014:                                                                                                  ## Mod history: 2023-08-16 MAS  Created from Comanche 055.
040316,000015: 
040317,000016:                                                                                                  #  PROGRAM NAME....      TVCEXECUTIVE, CONSISTING OF TVCEXEC, NEEDLEUP, VARGAINS
040318,000017:                                                                                                  #                        1SHOTCHK, REPCHEK, CG.CORR, COPYCYCLES, ETC.
040319,000018:                                                                                                  #  LOG SECTION...        TVCEXECUTIVE            SUBROUTINE...DAPCSM
040320,000019:                                                                                                  #  MODIFIED BY SCHLUNDT                          21 OCTOBER 1968
040321,000020: 
040322,000021:                                                                                                  #  FUNCTIONAL DESCRIPTION....
040323,000022:                                                                                                  #       *A SELF-PERPETUATING WAITLIST TASK AT 1/2 SECOND INTERVALS WHICH:
040324,000023:                                                                                                  #        PREPARES THE ROLL DAP WITH OGA (CDUX)
040325,000024:                                                                                                  #        PREPARES THE ROLL FDAI NEEDLE (FLY-TO  OGA ERROR)
040326,000025:                                                                                                  #        PREPARES THE ROLL PHASE PLANE  OGAERR  (FLY-FROM  OGA ERROR)
040327,000026:                                                                                                  #        PREPARES THE TVC ROLLDAP TASK WAITLIST CALL (3 CS DELAY)
040328,000027:                                                                                                  #        UPDATES THE NEEDLES DISPLAY
040329,000028:                                                                                                  #        UPDATES VEHICLE MASS AND CALLS MASSPROP TO UPDATE INERTIA DATA
040330,000029:                                                                                                  #        UPDATES PITCH, YAW, AND ROLL DAP GAINS FROM MASSPROP DATA
040331,000030:                                                                                                  #        PERFORMS ONE-SHOT CORRECTION FOR TMC LOOP 0-3 SEC AFTER IGNITION
040332,000031:                                                                                                  #        PERFORMS REPETITIVE UPDATES FOR TMC LOOP AFTER THE ONE-SHOT CORR.
040333,000032: 
040334,000033:                                                                                                  #  CALLING SEQUENCE....
040335,000034:                                                                                                  #       *TVCEXEC CALLED AS A WAITLIST TASK, IN PARTICULAR BY TVCINIT4 AND BY
040336,000035:                                                                                                  #        ITSELF, BOTH AT 1/2 SECOND INTERVALS
040337,000036: 
040338,000037:                                                                                                  #  NORMAL EXIT MODE.... TASKOVER
040339,000038: 
040340,000039:                                                                                                  #  ALARM OR ABORT EXIT MODES.... NONE
040341,000040: 
040342,000041:                                                                                                  #  SUBROUTINES CALLED....NEEDLER, S40.15, MASSPROP, TASKOVER, IBNKCALL
040343,000042: 
040344,000043:                                                                                                  #  OTHER INTERFACES....
040345,000044:                                                                                                  #       *TVCRESTART PACKAGE FOR RESTARTS
040346,000045:                                                                                                  #       *PITCHDAP, YAWDAP FOR VARIABLE GAINS AND ENGINE TRIM ANGLES
040347,000046: 
040348,000047:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED....
040349,000048:                                                                                                  #       *SEE TVCDAPON....TVCINIT4
040350,000049:                                                                                                  #       *VARK AND 1/CONACC (S40.15 OF TVCINITIALIZE)
040351,000050:                                                                                                  #       *PAD LOAD EREPFRAC
040352,000051:                                                                                                  #       *BITS 15,14 OF FLAGWRD6 (T5 BITS)
040353,000052:                                                                                                  #       *TVCEXPHS FOR RESTARTS
040354,000053:                                                                                                  #       *ENGINE-ON BIT (11.13) FOR RESTARTS
040355,000054:                                                                                                  #       *CDUX, OGAD
040356,000055: 
040357,000056:                                                                                                  #  OUTPUT....
040358,000057:                                                                                                  #       *ROLL DAP OGANOW, FDAI NEEDLE (AK). AND PHASE PLANE OGAERR
040359,000058:                                                                                                  #       *VARIABLE GAINS FOR PITCH/YAW AND ROLL TVC DAPS
040360,000059:                                                                                                  #       *SINGLE-SHOT AND REPETITIVE CORRECTIONS TO ENGINE TRIM ANGLES
040361,000060:                                                                                                  #        PACTOFF AND YACTOFF
040362,000061: 
040363,000062:                                                                                                  #  DEBRIS....    MUCH, BUT SHAREABLE WITH RCS/ENTRY, ALL IN EBANK6
040364,000063: 
040365,000064: 16,2772                                           BANK     16                                    
040366,000065: 16,2000                                           SETLOC   DAPROLL                               
040367,000066: 16,2000                                           BANK                                           
040368,000067: 16,2772  E6,1704                                  EBANK=   BZERO                                 
040369,000068: 16,2772                                           COUNT*   $$/TVCX                               
040370,000069: 
040371,000070: 16,2772           40102        TVCEXEC            CS       FLAGWRD6                              #  CHECK FOR TERMINATION (BITS 15,14 READ
040372,000071: 16,2773           74105                           MASK     OCT60000                              #        10 FROM TVCDAPON TO RCSDAPON)
040373,000072: 16,2774           00006                           EXTEND                                         
040374,000073: 16,2775           63206                           BZMF     TVCEXFIN                              #  TERMINATE
040375,000074: 
040376,000075: 16,2776           35052                           CAF      .5SEC                                 #  W.L. CALL TO PERPETUATE TVCEXEC
040377,000076: 16,2777           05261                           TC       WAITLIST                              
040378,000077: 16,3000  E6,1704                                  EBANK=   BZERO                                 
040379,000078: 16,3000           02772 34066                     2CADR    TVCEXEC                               
040380,000079: 
040381,000080: 16,3002           30032        ROLLPREP           CAE      CDUX                                  #  UPDATE ROLL LADDERS (NO NEED TO RESTART-
040382,000081: 16,3003           57664                           XCH      OGANOW                                #        PROTECT, SINCE ROLL DAPS RE-START)
040383,000082: 16,3004           57665                           XCH      OGAPAST                               
040384,000083: 
040385,000084: 16,3005           31450                           CAE      OGAD                                  #  PREPARE ROLL FDAI NEEDLE WITH FLY-TO
040386,000085: 16,3006           00006                           EXTEND                                         #        ERROR (COMMAND - MEASURED)
040387,000086: 16,3007           21664                           MSU      OGANOW                                
040388,000087: 16,3010           55476                           TS       AK                                    #  FLY-TO OGA ERROR, SC.AT B-1 REVS
040389,000088: 
040390,000089: 16,3011           00006                           EXTEND                                         #  PREPARE ROLL DAP PHASE PLANE OGAERR
040391,000090: 16,3012           77705                           MP       -BIT14                                
040392,000091: 16,3013           55666                           TS       OGAERR                                #  PHASE-PLANE (FLY-FROM) OGAERROR,
040393,000092:                                                                                                  #        SC.AT B+0 REVS
040394,000093: 
040395,000094: 16,3014           36214                           CAF      THREE                                 #  SET UP ROLL DAP TASK (ALLOW SOME TIME)
040396,000095: 16,3015           05261                           TC       WAITLIST                              
040397,000096: 16,3016  E6,1704                                  EBANK=   BZERO                                 
040398,000097: 16,3016           03344 34066                     2CADR    ROLLDAP                               
040399,000098: 
040400,000099: 16,3020           04754        NEEDLEUP           TC       IBNKCALL                              #  DO A NEEDLES UPDATE (RETURNS AFTER CADR)
040401,000100: 16,3021           42432                           CADR     NEEDLER                               #        (NEEDLES RESTARTS ITSELF)
040402,000101: 
040403,000102: 16,3022           35017        VARGAINS           CAF      BIT13                                 #  CHECK ENGINE-ON BIT TO INHIBIT VARIABLE
040404,000103: 16,3023           00006                           EXTEND                                         #        GAINS AND MASS IF ENGINE OFF
040405,000104: 16,3024           02011                           RAND     DSALMOUT                              #  CHANNEL 11
040406,000105: 16,3025           10000                           CCS      A                                     
040407,000106: 16,3026           13032                           TCF      +4                                    #        ON, SO OK TO UPDATE GAINS AND MASS
040408,000107: 16,3027           35032                 +5        CAF      TWO                                   #        OFF, SO BYPASS MASS/GAIN UPDATES,
040409,000108: 16,3030           55653                           TS       TVCEXPHS                              #                ALSO ENTRY FROM CCS BELOW WITH
040410,000109: 16,3031           13063                           TCF      1SHOTCHK                              #                VCNTR = -0 (V97 R40 ENGFAIL)
040411,000110: 16,3032           11643                           CCS      VCNTR                                 #        TEST FOR GAIN UPDATE TIME
040412,000111: 16,3033           13037                           TCF      +4                                    #                NOT YET
040413,000112: 16,3034           13043                           TCF      GAINCHNG                              #                NOW
040414,000113: 16,3035           13035                           TCF      +0                                    #                NOT USED
040415,000114: 16,3036           13027                           TCF      VARGAINS   +5                         #                NO, LOTHRUST (S40.8 R40)
040416,000115: 
040417,000116: 16,3037           55655                 +4        TS       VCNTRTMP                              #        PROTECT VCNTR AND
040418,000117: 16,3040           31474                           CAE      CSMMASS                               #        CSMMASS DURING AN IMPULSIVE BURN
040419,000118: 16,3041           55654                           TS       MASSTMP                               
040420,000119: 16,3042           13054                           TCF      EXECCOPY                              
040421,000120: 
040422,000121: 16,3043           04754        GAINCHNG           TC       IBNKCALL                              #  UPDATE IXX, IAVG, IAVG/TLX
040423,000122: 16,3044           13424                           CADR     FIXCW                                 #  MASSPROP ENTRY (ALREADY INITIALIZED)
040424,000123: 16,3045           04754                           TC       IBNKCALL                              #  UPDATE 1/CONACC, VARK
040425,000124: 16,3046           36520                           CADR     S40.15                                #        (S40.15 IS IN TVCINITIALIZE)
040426,000125: 16,3047           41637                           CS       TENMDOT                               #  UPDATE MASS FOR NEXT 10 SEC. OF BURN
040427,000126: 16,3050           61474                           AD       CSMMASS                               
040428,000127: 16,3051           55654                           TS       MASSTMP                               #  KG B+16
040429,000128: 
040430,000129: 16,3052           34374                           CAF      NINETEEN                              #  RESET THE VARIABLE-GAIN UPDATE COUNTER
040431,000130: 16,3053           55655                           TS       VCNTRTMP                              
040432,000131: 
040433,000132: 16,3054           25653        EXECCOPY           INCR     TVCEXPHS                              #  RESTART-PROTECT THE COPYCYCLE         (1)
040434,000133: 
040435,000134: 16,3055           31654                           CAE      MASSTMP                               #  CSMMASS KG B+16
040436,000135: 16,3056           55474                           TS       CSMMASS                               
040437,000136: 
040438,000137: 16,3057           31655                           CAE      VCNTRTMP                              #  VCNTR
040439,000138: 16,3060           55643                           TS       VCNTR                                 
040440,000139: 16,3061           55444                           TS       V97VCNTR                              #  FOR ENGFAIL (R41) MASS UPDATES AT SPSOFF
040441,000140: 
040442,000141: 16,3062           25653                           INCR     TVCEXPHS                              #  COPYCYCLE OVER                        (2)
040443,000142: 
040444,000143: 16,3063           11447        1SHOTCHK           CCS      CNTR                                  #  CHECK TIME FOR ONE-SHOT OR REPCORR
040445,000144: 16,3064           13070                           TCF      +4                                    #        NOT YET
040446,000145: 16,3065           13103                           TCF      1SHOTOK                               #        NOW
040447,000146: 16,3066           13074                           TCF      REPCHEK                               #        ONE-SHOT OVER, ON TO REPCORR
040448,000147: 16,3067           13103                           TCF      1SHOTOK                               #        NOW (ONE-SHOT ONLY, NO REPCORR)
040449,000148: 
040450,000149: 16,3070           55700                 +4        TS       CNTRTMP                               #  COUNT DOWN
040451,000150: 16,3071           36211                           CAF      SIX                                   #  SETUP TVCEXPHS FOR ENTRY AT CNTRCOPY
040452,000151: 16,3072           55653                           TS       TVCEXPHS                              
040453,000152: 16,3073           13204                           TCF      CNTRCOPY                              
040454,000153: 
040455,000154: 16,3074           31642        REPCHEK            CAE      REPFRAC                               #  CHECK FOR REPETITIVE UPDATES
040456,000155: 16,3075           00006                           EXTEND                                         
040457,000156: 16,3076           63206                           BZMF     TVCEXFIN                              #        NO,  OVER-AND-OUT
040458,000157: 16,3077           55446                           TS       TEMPDAP    +1                         #        YES, SET UP CORRECTION FRACTION
040459,000158: 16,3100           35031                           CAF      FOUR                                  #  SET UP TVCEXPHS FOR ENTRY AT CORSETUP
040460,000159: 16,3101           55653                           TS       TVCEXPHS                              
040461,000160: 16,3102           13115                           TCF      CORSETUP                              
040462,000161: 16,3103           35017        1SHOTOK            CAF      BIT13                                 #  CHECK ENGINE-ON BIT, NOT PERMITTING
040463,000162: 16,3104           00006                           EXTEND                                         #        ONE-SHOT DURING ENGINE-SHUTDOWN
040464,000163: 16,3105           02011                           RAND     DSALMOUT                              
040465,000164: 16,3106           10000                           CCS      A                                     
040466,000165: 16,3107           13111                           TCF      +2                                    #        ONE-SHOT OK
040467,000166: 16,3110           13206                           TCF      TVCEXFIN                              #        NO, TERMINATE
040468,000167: 
040469,000168: 16,3111           25653                           INCR     TVCEXPHS                              #                                        (3)
040470,000169: 
040471,000170: 16,3112           33211        TEMPSET            CAF      FCORFRAC                              #        SET UP CORRECTION FRACTION
040472,000171: 16,3113           55446                           TS       TEMPDAP    +1                         
040473,000172: 
040474,000173: 16,3114           25653                           INCR     TVCEXPHS                              #  ENTRY FROM REPCHEK AT NEXT LOCATION   (4)
040475,000174: 
040476,000175: 16,3115           31466        CORSETUP           CAE      DAPDATR1                              #  CHECK FOR LEM-OFF/ON
040477,000176: 16,3116           75017                           MASK     BIT13                                 #  (NOTE, SHOWS LEM-OFF)
040478,000177: 16,3117           00006                           EXTEND                                         
040479,000178: 16,3120           13122                           BZF      +2                                    #  LEM IS ON,  PICK UP   TEMPDAP+1
040480,000179: 16,3121           31446                           CAE      TEMPDAP    +1                         #  LEM IS OFF, PICK UP 2(TEMPDAP+1)
040481,000180: 16,3122           61446                           AD       TEMPDAP    +1                         
040482,000181: 16,3123           55445                           TS       TEMPDAP                               #  CG.CORR USES TEMPDAP
040483,000182: 
040484,000183: 16,3124           37716                           CAF      NEGONE                                #  SET UP FOR CNTR = -1 (ONE-SHOT DONE)
040485,000184: 16,3125           55700                           TS       CNTRTMP                               #        (COPYCYCLE AT .CNTRCOPY.)
040486,000185: 
040487,000186: 16,3126           00006        CG.CORR            EXTEND                                         #  PITCH TMC LOOP
040488,000187: 16,3127           31606                           DCA      PDELOFF                               
040489,000188: 16,3130           53675                           DXCH     PACTTMP                               
040490,000189: 16,3131           00006                           EXTEND                                         
040491,000190: 16,3132           41606                           DCS      PDELOFF                               
040492,000191: 16,3133           20001                           DDOUBL                                         
040493,000192: 16,3134           20001                           DDOUBL                                         
040494,000193: 16,3135           53612                           DXCH     TTMP1                                 
040495,000194: 16,3136           00006                           EXTEND                                         
040496,000195: 16,3137           31602                           DCA      DELPBAR                               
040497,000196: 16,3140           20001                           DDOUBL                                         
040498,000197: 16,3141           20001                           DDOUBL                                         
040499,000198: 16,3142           21612                           DAS      TTMP1                                 
040500,000199: 16,3143           00006                           EXTEND                                         
040501,000200: 16,3144           31612                           DCA      TTMP1                                 
040502,000201: 16,3145           00006                           EXTEND                                         
040503,000202: 16,3146           71445                           MP       TEMPDAP                               
040504,000203: 16,3147           21675                           DAS      PACTTMP                               
040505,000204: 
040506,000205: 16,3150           00006                           EXTEND                                         #  YAW TMC LOOP
040507,000206: 16,3151           31610                           DCA      YDELOFF                               
040508,000207: 16,3152           53677                           DXCH     YACTTMP                               
040509,000208: 16,3153           00006                           EXTEND                                         
040510,000209: 16,3154           41610                           DCS      YDELOFF                               
040511,000210: 16,3155           20001                           DDOUBL                                         
040512,000211: 16,3156           20001                           DDOUBL                                         
040513,000212: 16,3157           53612                           DXCH     TTMP1                                 
040514,000213: 16,3160           00006                           EXTEND                                         
040515,000214: 16,3161           31604                           DCA      DELYBAR                               
040516,000215: 16,3162           20001                           DDOUBL                                         
040517,000216: 16,3163           20001                           DDOUBL                                         
040518,000217: 16,3164           21612                           DAS      TTMP1                                 
040519,000218: 16,3165           00006                           EXTEND                                         
040520,000219: 16,3166           31612                           DCA      TTMP1                                 
040521,000220: 16,3167           00006                           EXTEND                                         
040522,000221: 16,3170           71445                           MP       TEMPDAP                               
040523,000222: 16,3171           21677                           DAS      YACTTMP                               
040524,000223: 
040525,000224: 16,3172           25653        CORCOPY            INCR     TVCEXPHS                              #  RESTART PROTECT THE COPYCYCLE         (5)
040526,000225: 
040527,000226: 16,3173           00006                           EXTEND                                         #  TRIM-ESTIMATES, AND
040528,000227: 16,3174           31675                           DCA      PACTTMP                               
040529,000228: 16,3175           55423                           TS       PACTOFF                               #        TRIMS
040530,000229: 16,3176           53606                           DXCH     PDELOFF                               
040531,000230: 
040532,000231: 16,3177           00006                           EXTEND                                         
040533,000232: 16,3200           31677                           DCA      YACTTMP                               
040534,000233: 16,3201           55424                           TS       YACTOFF                               
040535,000234: 16,3202           53610                           DXCH     YDELOFF                               
040536,000235: 
040537,000236: 16,3203           25653                           INCR     TVCEXPHS                              #  ENTRY FROM 1SHOTCHK AT NEXT LOCATION  (6)
040538,000237: 
040539,000238: 16,3204           31700        CNTRCOPY           CAE      CNTRTMP                               #  UPDATE CNTR (RESTARTS OK, FOLLOWS CPYCY)
040540,000239: 16,3205           55447                           TS       CNTR                                  
040541,000240: 
040542,000241: 16,3206           35035        TVCEXFIN           CAF      ZERO                                  #  RESET TVCEXPHS
040543,000242: 16,3207           55653                           TS       TVCEXPHS                              
040544,000243: 16,3210           15340                           TCF      TASKOVER                              #  TVCEXECUTIVE FINISHED
040545,000244: 
040546,000245: 16,3211           10000        FCORFRAC           OCT      10000                                 #  ONE-SHOT CORRECTION FRACTION  

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