Source Code

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

They have been adapted from sources files created from a listing of Comanche 55. These source files were updated to match binary dumps of a set of Comanche 67 rope modules. They were then further modified by applying known changes between Comanche 67 and Comanche 72. A binary dump of module B2 of Comanche 72, part number 2010802-021, was also used to validate changes made to banks 05-13. 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 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.

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

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