Source Code

These source-code files are part of a reconstructed copy of Comanche 72/3 (AKA Manche72 revision 3), the final, flown mission release of the Apollo Guidance Computer (AGC) Command Module (CM) software for Apollo 13.

The starting point was the source code of Comanche 72 (itself previously reconstructed). Comanche 72 source code was then modified by incorporating changes known from contemporary documentation to have been made between revisions 72 and 72/3. The resulting code assembles to have identical memory-bank checksums as those specified in NASA drawing 2021153G; this gives reasonably high confidence that the changes that have been made are correct. In places where ambiguity exists, this ambiguity is discussed in "## Reconstruction:" comments.

Since no contemporary listings of Comanche 72/3 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.

040573,000002:                                                                                                  ## Copyright:   Public domain.
040574,000003:                                                                                                  ## Filename:    TVCEXECUTIVE.agc
040575,000004:                                                                                                  ## Purpose:     A section of Manche72 revision 3.
040576,000005:                                                                                                  ##              It is part of the reconstructed source code for the final, flown
040577,000006:                                                                                                  ##              release of the software for the Command Module's (CM) Apollo
040578,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 13. No original listings
040579,000008:                                                                                                  ##              of this program are available; instead, this file was recreated
040580,000009:                                                                                                  ##              from a reconstructed copy of Comanche 072. It has been adapted
040581,000010:                                                                                                  ##              such that the resulting bugger words exactly match those
040582,000011:                                                                                                  ##              specified for Manche72 revision 3 in NASA drawing 2021153G,
040583,000012:                                                                                                  ##              which gives relatively high confidence that the reconstruction
040584,000013:                                                                                                  ##              is correct.
040585,000014:                                                                                                  ## Assembler:   yaYUL
040586,000015:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
040587,000016:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
040588,000017:                                                                                                  ## Mod history: 2024-05-19 MAS  Created from Comanche 072.
040589,000018: 
040590,000019:                                                                                                  #  PROGRAM NAME....      TVCEXECUTIVE, CONSISTING OF TVCEXEC, NEEDLEUP, VARGAINS
040591,000020:                                                                                                  #                        1SHOTCHK, REPCHEK, CG.CORR, COPYCYCLES, ETC.
040592,000021:                                                                                                  #  LOG SECTION...        TVCEXECUTIVE            SUBROUTINE...DAPCSM
040593,000022:                                                                                                  #  MODIFIED BY SCHLUNDT                          21 OCTOBER 1968
040594,000023: 
040595,000024:                                                                                                  #  FUNCTIONAL DESCRIPTION....
040596,000025:                                                                                                  #       *A SELF-PERPETUATING WAITLIST TASK AT 1/2 SECOND INTERVALS WHICH:
040597,000026:                                                                                                  #        PREPARES THE ROLL DAP WITH OGA (CDUX)
040598,000027:                                                                                                  #        PREPARES THE ROLL FDAI NEEDLE (FLY-TO  OGA ERROR)
040599,000028:                                                                                                  #        PREPARES THE ROLL PHASE PLANE  OGAERR  (FLY-FROM  OGA ERROR)
040600,000029:                                                                                                  #        PREPARES THE TVC ROLLDAP TASK WAITLIST CALL (3 CS DELAY)
040601,000030:                                                                                                  #        UPDATES THE NEEDLES DISPLAY
040602,000031:                                                                                                  #        UPDATES VEHICLE MASS AND CALLS MASSPROP TO UPDATE INERTIA DATA
040603,000032:                                                                                                  #        UPDATES PITCH, YAW, AND ROLL DAP GAINS FROM MASSPROP DATA
040604,000033:                                                                                                  #        PERFORMS ONE-SHOT CORRECTION FOR TMC LOOP 0-3 SEC AFTER IGNITION
040605,000034:                                                                                                  #        PERFORMS REPETITIVE UPDATES FOR TMC LOOP AFTER THE ONE-SHOT CORR.
040606,000035: 
040607,000036:                                                                                                  #  CALLING SEQUENCE....
040608,000037:                                                                                                  #       *TVCEXEC CALLED AS A WAITLIST TASK, IN PARTICULAR BY TVCINIT4 AND BY
040609,000038:                                                                                                  #        ITSELF, BOTH AT 1/2 SECOND INTERVALS
040610,000039: 
040611,000040:                                                                                                  #  NORMAL EXIT MODE.... TASKOVER
040612,000041: 
040613,000042:                                                                                                  #  ALARM OR ABORT EXIT MODES.... NONE
040614,000043: 
040615,000044:                                                                                                  #  SUBROUTINES CALLED....NEEDLER, S40.15, MASSPROP, TASKOVER, IBNKCALL
040616,000045: 
040617,000046:                                                                                                  #  OTHER INTERFACES....
040618,000047:                                                                                                  #       *TVCRESTART PACKAGE FOR RESTARTS
040619,000048:                                                                                                  #       *PITCHDAP, YAWDAP FOR VARIABLE GAINS AND ENGINE TRIM ANGLES
040620,000049: 
040621,000050:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED....
040622,000051:                                                                                                  #       *SEE TVCDAPON....TVCINIT4
040623,000052:                                                                                                  #       *VARK AND 1/CONACC (S40.15 OF TVCINITIALIZE)
040624,000053:                                                                                                  #       *PAD LOAD EREPFRAC
040625,000054:                                                                                                  #       *BITS 15,14 OF FLAGWRD6 (T5 BITS)
040626,000055:                                                                                                  #       *TVCEXPHS FOR RESTARTS
040627,000056:                                                                                                  #       *ENGINE-ON BIT (11.13) FOR RESTARTS
040628,000057:                                                                                                  #       *CDUX, OGAD
040629,000058: 
040630,000059:                                                                                                  #  OUTPUT....
040631,000060:                                                                                                  #       *ROLL DAP OGANOW, FDAI NEEDLE (AK). AND PHASE PLANE OGAERR
040632,000061:                                                                                                  #       *VARIABLE GAINS FOR PITCH/YAW AND ROLL TVC DAPS
040633,000062:                                                                                                  #       *SINGLE-SHOT AND REPETITIVE CORRECTIONS TO ENGINE TRIM ANGLES
040634,000063:                                                                                                  #        PACTOFF AND YACTOFF
040635,000064: 
040636,000065:                                                                                                  #  DEBRIS....    MUCH, BUT SHAREABLE WITH RCS/ENTRY, ALL IN EBANK6
040637,000066: 
040638,000067: 16,2772                                           BANK     16                                    
040639,000068: 16,2000                                           SETLOC   DAPROLL                               
040640,000069: 16,2000                                           BANK                                           
040641,000070: 16,2772  E6,1704                                  EBANK=   BZERO                                 
040642,000071: 16,2772                                           COUNT*   $$/TVCX                               
040643,000072: 
040644,000073: 16,2772           40102        TVCEXEC            CS       FLAGWRD6                              #  CHECK FOR TERMINATION (BITS 15,14 READ
040645,000074: 16,2773           74105                           MASK     OCT60000                              #        10 FROM TVCDAPON TO RCSDAPON)
040646,000075: 16,2774           00006                           EXTEND                                         
040647,000076: 16,2775           63206                           BZMF     TVCEXFIN                              #  TERMINATE
040648,000077: 
040649,000078: 16,2776           35052                           CAF      .5SEC                                 #  W.L. CALL TO PERPETUATE TVCEXEC
040650,000079: 16,2777           05261                           TC       WAITLIST                              
040651,000080: 16,3000  E6,1704                                  EBANK=   BZERO                                 
040652,000081: 16,3000           02772 34066                     2CADR    TVCEXEC                               
040653,000082: 
040654,000083: 16,3002           30032        ROLLPREP           CAE      CDUX                                  #  UPDATE ROLL LADDERS (NO NEED TO RESTART-
040655,000084: 16,3003           57664                           XCH      OGANOW                                #        PROTECT, SINCE ROLL DAPS RE-START)
040656,000085: 16,3004           57665                           XCH      OGAPAST                               
040657,000086: 
040658,000087: 16,3005           31450                           CAE      OGAD                                  #  PREPARE ROLL FDAI NEEDLE WITH FLY-TO
040659,000088: 16,3006           00006                           EXTEND                                         #        ERROR (COMMAND - MEASURED)
040660,000089: 16,3007           21664                           MSU      OGANOW                                
040661,000090: 16,3010           55476                           TS       AK                                    #  FLY-TO OGA ERROR, SC.AT B-1 REVS
040662,000091: 
040663,000092: 16,3011           00006                           EXTEND                                         #  PREPARE ROLL DAP PHASE PLANE OGAERR
040664,000093: 16,3012           77705                           MP       -BIT14                                
040665,000094: 16,3013           55666                           TS       OGAERR                                #  PHASE-PLANE (FLY-FROM) OGAERROR,
040666,000095:                                                                                                  #        SC.AT B+0 REVS
040667,000096: 
040668,000097: 16,3014           36214                           CAF      THREE                                 #  SET UP ROLL DAP TASK (ALLOW SOME TIME)
040669,000098: 16,3015           05261                           TC       WAITLIST                              
040670,000099: 16,3016  E6,1704                                  EBANK=   BZERO                                 
040671,000100: 16,3016           03344 34066                     2CADR    ROLLDAP                               
040672,000101: 
040673,000102: 16,3020           04754        NEEDLEUP           TC       IBNKCALL                              #  DO A NEEDLES UPDATE (RETURNS AFTER CADR)
040674,000103: 16,3021           42432                           CADR     NEEDLER                               #        (NEEDLES RESTARTS ITSELF)
040675,000104: 
040676,000105: 16,3022           35017        VARGAINS           CAF      BIT13                                 #  CHECK ENGINE-ON BIT TO INHIBIT VARIABLE
040677,000106: 16,3023           00006                           EXTEND                                         #        GAINS AND MASS IF ENGINE OFF
040678,000107: 16,3024           02011                           RAND     DSALMOUT                              #  CHANNEL 11
040679,000108: 16,3025           10000                           CCS      A                                     
040680,000109: 16,3026           13032                           TCF      +4                                    #        ON, SO OK TO UPDATE GAINS AND MASS
040681,000110: 16,3027           35032                 +5        CAF      TWO                                   #        OFF, SO BYPASS MASS/GAIN UPDATES,
040682,000111: 16,3030           55653                           TS       TVCEXPHS                              #                ALSO ENTRY FROM CCS BELOW WITH
040683,000112: 16,3031           13063                           TCF      1SHOTCHK                              #                VCNTR = -0 (V97 R40 ENGFAIL)
040684,000113: 16,3032           11643                           CCS      VCNTR                                 #        TEST FOR GAIN UPDATE TIME
040685,000114: 16,3033           13037                           TCF      +4                                    #                NOT YET
040686,000115: 16,3034           13043                           TCF      GAINCHNG                              #                NOW
040687,000116: 16,3035           13035                           TCF      +0                                    #                NOT USED
040688,000117: 16,3036           13027                           TCF      VARGAINS   +5                         #                NO, LOTHRUST (S40.8 R40)
040689,000118: 
040690,000119: 16,3037           55655                 +4        TS       VCNTRTMP                              #        PROTECT VCNTR AND
040691,000120: 16,3040           31474                           CAE      CSMMASS                               #        CSMMASS DURING AN IMPULSIVE BURN
040692,000121: 16,3041           55654                           TS       MASSTMP                               
040693,000122: 16,3042           13054                           TCF      EXECCOPY                              
040694,000123: 
040695,000124: 16,3043           04754        GAINCHNG           TC       IBNKCALL                              #  UPDATE IXX, IAVG, IAVG/TLX
040696,000125: 16,3044           13424                           CADR     FIXCW                                 #  MASSPROP ENTRY (ALREADY INITIALIZED)
040697,000126: 16,3045           04754                           TC       IBNKCALL                              #  UPDATE 1/CONACC, VARK
040698,000127: 16,3046           36520                           CADR     S40.15                                #        (S40.15 IS IN TVCINITIALIZE)
040699,000128: 16,3047           41637                           CS       TENMDOT                               #  UPDATE MASS FOR NEXT 10 SEC. OF BURN
040700,000129: 16,3050           61474                           AD       CSMMASS                               
040701,000130: 16,3051           55654                           TS       MASSTMP                               #  KG B+16
040702,000131: 
040703,000132: 16,3052           34374                           CAF      NINETEEN                              #  RESET THE VARIABLE-GAIN UPDATE COUNTER
040704,000133: 16,3053           55655                           TS       VCNTRTMP                              
040705,000134: 
040706,000135: 16,3054           25653        EXECCOPY           INCR     TVCEXPHS                              #  RESTART-PROTECT THE COPYCYCLE         (1)
040707,000136: 
040708,000137: 16,3055           31654                           CAE      MASSTMP                               #  CSMMASS KG B+16
040709,000138: 16,3056           55474                           TS       CSMMASS                               
040710,000139: 
040711,000140: 16,3057           31655                           CAE      VCNTRTMP                              #  VCNTR
040712,000141: 16,3060           55643                           TS       VCNTR                                 
040713,000142: 16,3061           55444                           TS       V97VCNTR                              #  FOR ENGFAIL (R41) MASS UPDATES AT SPSOFF
040714,000143: 
040715,000144: 16,3062           25653                           INCR     TVCEXPHS                              #  COPYCYCLE OVER                        (2)
040716,000145: 
040717,000146: 16,3063           11447        1SHOTCHK           CCS      CNTR                                  #  CHECK TIME FOR ONE-SHOT OR REPCORR
040718,000147: 16,3064           13070                           TCF      +4                                    #        NOT YET
040719,000148: 16,3065           13103                           TCF      1SHOTOK                               #        NOW
040720,000149: 16,3066           13074                           TCF      REPCHEK                               #        ONE-SHOT OVER, ON TO REPCORR
040721,000150: 16,3067           13103                           TCF      1SHOTOK                               #        NOW (ONE-SHOT ONLY, NO REPCORR)
040722,000151: 
040723,000152: 16,3070           55700                 +4        TS       CNTRTMP                               #  COUNT DOWN
040724,000153: 16,3071           36211                           CAF      SIX                                   #  SETUP TVCEXPHS FOR ENTRY AT CNTRCOPY
040725,000154: 16,3072           55653                           TS       TVCEXPHS                              
040726,000155: 16,3073           13204                           TCF      CNTRCOPY                              
040727,000156: 
040728,000157: 16,3074           31642        REPCHEK            CAE      REPFRAC                               #  CHECK FOR REPETITIVE UPDATES
040729,000158: 16,3075           00006                           EXTEND                                         
040730,000159: 16,3076           63206                           BZMF     TVCEXFIN                              #        NO,  OVER-AND-OUT
040731,000160: 16,3077           55446                           TS       TEMPDAP    +1                         #        YES, SET UP CORRECTION FRACTION
040732,000161: 16,3100           35031                           CAF      FOUR                                  #  SET UP TVCEXPHS FOR ENTRY AT CORSETUP
040733,000162: 16,3101           55653                           TS       TVCEXPHS                              
040734,000163: 16,3102           13115                           TCF      CORSETUP                              
040735,000164: 16,3103           35017        1SHOTOK            CAF      BIT13                                 #  CHECK ENGINE-ON BIT, NOT PERMITTING
040736,000165: 16,3104           00006                           EXTEND                                         #        ONE-SHOT DURING ENGINE-SHUTDOWN
040737,000166: 16,3105           02011                           RAND     DSALMOUT                              
040738,000167: 16,3106           10000                           CCS      A                                     
040739,000168: 16,3107           13111                           TCF      +2                                    #        ONE-SHOT OK
040740,000169: 16,3110           13206                           TCF      TVCEXFIN                              #        NO, TERMINATE
040741,000170: 
040742,000171: 16,3111           25653                           INCR     TVCEXPHS                              #                                        (3)
040743,000172: 
040744,000173: 16,3112           33211        TEMPSET            CAF      FCORFRAC                              #        SET UP CORRECTION FRACTION
040745,000174: 16,3113           55446                           TS       TEMPDAP    +1                         
040746,000175: 
040747,000176: 16,3114           25653                           INCR     TVCEXPHS                              #  ENTRY FROM REPCHEK AT NEXT LOCATION   (4)
040748,000177: 
040749,000178: 16,3115           31466        CORSETUP           CAE      DAPDATR1                              #  CHECK FOR LEM-OFF/ON
040750,000179: 16,3116           75017                           MASK     BIT13                                 #  (NOTE, SHOWS LEM-OFF)
040751,000180: 16,3117           00006                           EXTEND                                         
040752,000181: 16,3120           13122                           BZF      +2                                    #  LEM IS ON,  PICK UP   TEMPDAP+1
040753,000182: 16,3121           31446                           CAE      TEMPDAP    +1                         #  LEM IS OFF, PICK UP 2(TEMPDAP+1)
040754,000183: 16,3122           61446                           AD       TEMPDAP    +1                         
040755,000184: 16,3123           55445                           TS       TEMPDAP                               #  CG.CORR USES TEMPDAP
040756,000185: 
040757,000186: 16,3124           37716                           CAF      NEGONE                                #  SET UP FOR CNTR = -1 (ONE-SHOT DONE)
040758,000187: 16,3125           55700                           TS       CNTRTMP                               #        (COPYCYCLE AT .CNTRCOPY.)
040759,000188: 
040760,000189: 16,3126           00006        CG.CORR            EXTEND                                         #  PITCH TMC LOOP
040761,000190: 16,3127           31606                           DCA      PDELOFF                               
040762,000191: 16,3130           53675                           DXCH     PACTTMP                               
040763,000192: 16,3131           00006                           EXTEND                                         
040764,000193: 16,3132           41606                           DCS      PDELOFF                               
040765,000194: 16,3133           20001                           DDOUBL                                         
040766,000195: 16,3134           20001                           DDOUBL                                         
040767,000196: 16,3135           53612                           DXCH     TTMP1                                 
040768,000197: 16,3136           00006                           EXTEND                                         
040769,000198: 16,3137           31602                           DCA      DELPBAR                               
040770,000199: 16,3140           20001                           DDOUBL                                         
040771,000200: 16,3141           20001                           DDOUBL                                         
040772,000201: 16,3142           21612                           DAS      TTMP1                                 
040773,000202: 16,3143           00006                           EXTEND                                         
040774,000203: 16,3144           31612                           DCA      TTMP1                                 
040775,000204: 16,3145           00006                           EXTEND                                         
040776,000205: 16,3146           71445                           MP       TEMPDAP                               
040777,000206: 16,3147           21675                           DAS      PACTTMP                               
040778,000207: 
040779,000208: 16,3150           00006                           EXTEND                                         #  YAW TMC LOOP
040780,000209: 16,3151           31610                           DCA      YDELOFF                               
040781,000210: 16,3152           53677                           DXCH     YACTTMP                               
040782,000211: 16,3153           00006                           EXTEND                                         
040783,000212: 16,3154           41610                           DCS      YDELOFF                               
040784,000213: 16,3155           20001                           DDOUBL                                         
040785,000214: 16,3156           20001                           DDOUBL                                         
040786,000215: 16,3157           53612                           DXCH     TTMP1                                 
040787,000216: 16,3160           00006                           EXTEND                                         
040788,000217: 16,3161           31604                           DCA      DELYBAR                               
040789,000218: 16,3162           20001                           DDOUBL                                         
040790,000219: 16,3163           20001                           DDOUBL                                         
040791,000220: 16,3164           21612                           DAS      TTMP1                                 
040792,000221: 16,3165           00006                           EXTEND                                         
040793,000222: 16,3166           31612                           DCA      TTMP1                                 
040794,000223: 16,3167           00006                           EXTEND                                         
040795,000224: 16,3170           71445                           MP       TEMPDAP                               
040796,000225: 16,3171           21677                           DAS      YACTTMP                               
040797,000226: 
040798,000227: 16,3172           25653        CORCOPY            INCR     TVCEXPHS                              #  RESTART PROTECT THE COPYCYCLE         (5)
040799,000228: 
040800,000229: 16,3173           00006                           EXTEND                                         #  TRIM-ESTIMATES, AND
040801,000230: 16,3174           31675                           DCA      PACTTMP                               
040802,000231: 16,3175           55423                           TS       PACTOFF                               #        TRIMS
040803,000232: 16,3176           53606                           DXCH     PDELOFF                               
040804,000233: 
040805,000234: 16,3177           00006                           EXTEND                                         
040806,000235: 16,3200           31677                           DCA      YACTTMP                               
040807,000236: 16,3201           55424                           TS       YACTOFF                               
040808,000237: 16,3202           53610                           DXCH     YDELOFF                               
040809,000238: 
040810,000239: 16,3203           25653                           INCR     TVCEXPHS                              #  ENTRY FROM 1SHOTCHK AT NEXT LOCATION  (6)
040811,000240: 
040812,000241: 16,3204           31700        CNTRCOPY           CAE      CNTRTMP                               #  UPDATE CNTR (RESTARTS OK, FOLLOWS CPYCY)
040813,000242: 16,3205           55447                           TS       CNTR                                  
040814,000243: 
040815,000244: 16,3206           35035        TVCEXFIN           CAF      ZERO                                  #  RESET TVCEXPHS
040816,000245: 16,3207           55653                           TS       TVCEXPHS                              
040817,000246: 16,3210           15340                           TCF      TASKOVER                              #  TVCEXECUTIVE FINISHED
040818,000247: 
040819,000248: 16,3211           10000        FCORFRAC           OCT      10000                                 #  ONE-SHOT CORRECTION FRACTION  

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