Source Code
These source-code files are part of a reconstructed copy of Comanche 44, the
initial release (though not the final mission release) of the Apollo 10
Command Module (CM) Apollo Guidance Computer (AGC) software. Subsequent releases
were Comanche 45 and Comanche 45/2 (the flown release on Apollo 10). The reconstruction
is believed to be exactly accurate, but in the absence of an actual Apollo-era
listing of Comanche 44, some explanation of the reconstruction process is needed
to insure confidence in that accuracy.
The starting point was the source code of Comanche 51 (separately previously reconstructed from an Apollo-era listing of Comanche 55, flown on Apollo 11). Comanche 51 source code was then modified by undoing changes known to have been made between revisions 44 and 51. The now-reconstructed Comanche 44 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 match those on the Comanche 55 printout, although the source code would likely have different page numbers in a contemporary Comanche 44 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 51. 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. |
041773,000002: ## Copyright: Public domain.
041774,000003: ## Filename: TVCEXECUTIVE.agc
041775,000004: ## Purpose: A section of Comanche revision 044.
041776,000005: ## It is part of the reconstructed source code for the
041777,000006: ## original release of the flight software for the Command
041778,000007: ## Module's (CM) Apollo Guidance Computer (AGC) for Apollo 10.
041779,000008: ## The code has been recreated from a copy of Comanche 055. It
041780,000009: ## has been adapted such that the resulting bugger words
041781,000010: ## exactly match those specified for Comanche 44 in NASA drawing
041782,000011: ## 2021153D, which gives relatively high confidence that the
041783,000012: ## reconstruction is correct.
041784,000013: ## Assembler: yaYUL
041785,000014: ## Contact: Ron Burkey <info@sandroid.org>.
041786,000015: ## Website: www.ibiblio.org/apollo/index.html
041787,000016: ## Mod history: 2020-12-03 MAS Created from Comanche 51.
041788,000017:
Page 945 |
041790,000019: # PROGRAM NAME.... TVCEXECUTIVE, CONSISTING OF TVCEXEC, NEEDLEUP, VARGAINS
041791,000020: # 1SHOTCHK, REPCHEK, CG.CORR, COPYCYCLES, ETC.
041792,000021: # LOG SECTION... TVCEXECUTIVE SUBROUTINE...DAPCSM
041793,000022: # MODIFIED BY SCHLUNDT 21 OCTOBER 1968
041794,000023:
041795,000024: # FUNCTIONAL DESCRIPTION....
041796,000025: # *A SELF-PERPETUATING WAITLIST TASK AT 1/2 SECOND INTERVALS WHICH:
041797,000026: # PREPARES THE ROLL DAP WITH OGA (CDUX)
041798,000027: # PREPARES THE ROLL FDAI NEEDLE (FLY-TO OGA ERROR)
041799,000028: # PREPARES THE ROLL PHASE PLANE OGAERR (FLY-FROM OGA ERROR)
041800,000029: # PREPARES THE TVC ROLLDAP TASK WAITLIST CALL (3 CS DELAY)
041801,000030: # UPDATES THE NEEDLES DISPLAY
041802,000031: # UPDATES VEHICLE MASS AND CALLS MASSPROP TO UPDATE INERTIA DATA
041803,000032: # UPDATES PITCH, YAW, AND ROLL DAP GAINS FROM MASSPROP DATA
041804,000033: # PERFORMS ONE-SHOT CORRECTION FOR TMC LOOP 0-3 SEC AFTER IGNITION
041805,000034: # PERFORMS REPETITIVE UPDATES FOR TMC LOOP AFTER THE ONE-SHOT CORR.
041806,000035:
041807,000036: # CALLING SEQUENCE....
041808,000037: # *TVCEXEC CALLED AS A WAITLIST TASK, IN PARTICULAR BY TVCINIT4 AND BY
041809,000038: # ITSELF, BOTH AT 1/2 SECOND INTERVALS
041810,000039:
041811,000040: # NORMAL EXIT MODE.... TASKOVER
041812,000041:
041813,000042: # ALARM OR ABORT EXIT MODES.... NONE
041814,000043:
041815,000044: # SUBROUTINES CALLED....NEEDLER, S40.15, MASSPROP, TASKOVER, IBNKCALL
041816,000045:
041817,000046: # OTHER INTERFACES....
041818,000047: # *TVCRESTART PACKAGE FOR RESTARTS
041819,000048: # *PITCHDAP, YAWDAP FOR VARIABLE GAINS AND ENGINE TRIM ANGLES
041820,000049:
041821,000050: # ERASABLE INITIALIZATION REQUIRED....
041822,000051: # *SEE TVCDAPON....TVCINIT4
041823,000052: # *VARK AND 1/CONACC (S40.15 OF TVCINITIALIZE)
041824,000053: # *PAD LOAD EREPFRAC
041825,000054: # *BITS 15,14 OF FLAGWRD6 (T5 BITS)
041826,000055: # *TVCEXPHS FOR RESTARTS
041827,000056: # *ENGINE-ON BIT (11.13) FOR RESTARTS
041828,000057: # *CDUX, OGAD
041829,000058:
041830,000059: # OUTPUT....
041831,000060: # *ROLL DAP OGANOW, FDAI NEEDLE (AK). AND PHASE PLANE OGAERR
041832,000061: # *VARIABLE GAINS FOR PITCH/YAW AND ROLL TVC DAPS
041833,000062: # *SINGLE-SHOT AND REPETITIVE CORRECTIONS TO ENGINE TRIM ANGLES
041834,000063: # PACTOFF AND YACTOFF
041835,000064:
041836,000065: # DEBRIS.... MUCH, BUT SHAREABLE WITH RCS/ENTRY, ALL IN EBANK6
041837,000066:
Page 946 |
041839,000068: 16,2715 BANK 16
041840,000069: 16,2000 SETLOC DAPROLL
041841,000070: 16,2000 BANK
041842,000071: 16,2715 E6,1702 EBANK= BZERO
041843,000072: 16,2715 COUNT* $$/TVCX
041844,000073:
041845,000074: 16,2715 40102 TVCEXEC CS FLAGWRD6 # CHECK FOR TERMINATION (BITS 15,14 READ
041846,000075: 16,2716 74105 MASK OCT60000 # 10 FROM TVCDAPON TO RCSDAPON)
041847,000076: 16,2717 00006 EXTEND
041848,000077: 16,2720 63131 BZMF TVCEXFIN # TERMINATE
041849,000078:
041850,000079: 16,2721 35036 CAF .5SEC # W.L. CALL TO PERPETUATE TVCEXEC
041851,000080: 16,2722 05245 TC WAITLIST
041852,000081: 16,2723 E6,1702 EBANK= BZERO
041853,000082: 16,2723 02715 34066 2CADR TVCEXEC
041854,000083:
041855,000084: 16,2725 30032 ROLLPREP CAE CDUX # UPDATE ROLL LADDERS (NO NEED TO RESTART-
041856,000085: 16,2726 57662 XCH OGANOW # PROTECT, SINCE ROLL DAPS RE-START)
041857,000086: 16,2727 57663 XCH OGAPAST
041858,000087:
041859,000088: 16,2730 31450 CAE OGAD # PREPARE ROLL FDAI NEEDLE WITH FLY-TO
041860,000089: 16,2731 00006 EXTEND # ERROR (COMMAND - MEASURED)
041861,000090: 16,2732 21662 MSU OGANOW
041862,000091: 16,2733 55476 TS AK # FLY-TO OGA ERROR, SC.AT B-1 REVS
041863,000092:
041864,000093: 16,2734 00006 EXTEND # PREPARE ROLL DAP PHASE PLANE OGAERR
041865,000094: 16,2735 77705 MP -BIT14
041866,000095: 16,2736 55664 TS OGAERR # PHASE-PLANE (FLY-FROM) OGAERROR,
041867,000096: # SC.AT B+0 REVS
041868,000097:
041869,000098: 16,2737 36214 CAF THREE # SET UP ROLL DAP TASK (ALLOW SOME TIME)
041870,000099: 16,2740 05245 TC WAITLIST
041871,000100: 16,2741 E6,1702 EBANK= BZERO
041872,000101: 16,2741 03267 34066 2CADR ROLLDAP
041873,000102:
041874,000103: 16,2743 04740 NEEDLEUP TC IBNKCALL # DO A NEEDLES UPDATE (RETURNS AFTER CADR)
041875,000104: 16,2744 42420 CADR NEEDLER # (NEEDLES RESTARTS ITSELF)
041876,000105:
041877,000106: 16,2745 35003 VARGAINS CAF BIT13 # CHECK ENGINE-ON BIT TO INHIBIT VARIABLE
041878,000107: 16,2746 00006 EXTEND # GAINS AND MASS IF ENGINE OFF
041879,000108: 16,2747 02011 RAND DSALMOUT # CHANNEL 11
041880,000109: 16,2750 10000 CCS A
041881,000110: 16,2751 12755 TCF +4 # ON, SO OK TO UPDATE GAINS AND MASS
041882,000111: 16,2752 35016 +5 CAF TWO # OFF, SO BYPASS MASS/GAIN UPDATES,
041883,000112: 16,2753 55651 TS TVCEXPHS # ALSO ENTRY FROM CCS BELOW WITH
041884,000113: 16,2754 13006 TCF 1SHOTCHK # VCNTR = -0 (V97 R40 ENGFAIL)
041885,000114: 16,2755 11643 CCS VCNTR # TEST FOR GAIN UPDATE TIME
041886,000115: 16,2756 12762 TCF +4 # NOT YET
Page 947 |
041888,000117: 16,2757 12766 TCF GAINCHNG # NOW
041889,000118: 16,2760 12760 TCF +0 # NOT USED
041890,000119: 16,2761 12752 TCF VARGAINS +5 # NO, LOTHRUST (S40.8 R40)
041891,000120:
041892,000121: 16,2762 55653 +4 TS VCNTRTMP # PROTECT VCNTR AND
041893,000122: 16,2763 31474 CAE CSMMASS # CSMMASS DURING AN IMPULSIVE BURN
041894,000123: 16,2764 55652 TS MASSTMP
041895,000124: 16,2765 12777 TCF EXECCOPY
041896,000125:
041897,000126: 16,2766 04740 GAINCHNG TC IBNKCALL # UPDATE IXX, IAVG, IAVG/TLX
041898,000127: 16,2767 13422 CADR FIXCW # MASSPROP ENTRY (ALREADY INITIALIZED)
041899,000128: 16,2770 04740 TC IBNKCALL # UPDATE 1/CONACC, VARK
041900,000129: 16,2771 36462 CADR S40.15 # (S40.15 IS IN TVCINITIALIZE)
041901,000130: 16,2772 41637 CS TENMDOT # UPDATE MASS FOR NEXT 10 SEC. OF BURN
041902,000131: 16,2773 61474 AD CSMMASS
041903,000132: 16,2774 55652 TS MASSTMP # KG B+16
041904,000133:
041905,000134: 16,2775 34374 CAF NINETEEN # RESET THE VARIABLE-GAIN UPDATE COUNTER
041906,000135: 16,2776 55653 TS VCNTRTMP
041907,000136:
041908,000137: 16,2777 25651 EXECCOPY INCR TVCEXPHS # RESTART-PROTECT THE COPYCYCLE (1)
041909,000138:
041910,000139: 16,3000 31652 CAE MASSTMP # CSMMASS KG B+16
041911,000140: 16,3001 55474 TS CSMMASS
041912,000141:
041913,000142: 16,3002 31653 CAE VCNTRTMP # VCNTR
041914,000143: 16,3003 55643 TS VCNTR
041915,000144: 16,3004 55444 TS V97VCNTR # FOR ENGFAIL (R41) MASS UPDATES AT SPSOFF
041916,000145:
041917,000146: 16,3005 25651 INCR TVCEXPHS # COPYCYCLE OVER (2)
041918,000147:
041919,000148: 16,3006 11447 1SHOTCHK CCS CNTR # CHECK TIME FOR ONE-SHOT OR REPCORR
041920,000149: 16,3007 13013 TCF +4 # NOT YET
041921,000150: 16,3010 13026 TCF 1SHOTOK # NOW
041922,000151: 16,3011 13017 TCF REPCHEK # ONE-SHOT OVER, ON TO REPCORR
041923,000152: 16,3012 13026 TCF 1SHOTOK # NOW (ONE-SHOT ONLY, NO REPCORR)
041924,000153:
041925,000154: 16,3013 55676 +4 TS CNTRTMP # COUNT DOWN
041926,000155: 16,3014 36211 CAF SIX # SETUP TVCEXPHS FOR ENTRY AT CNTRCOPY
041927,000156: 16,3015 55651 TS TVCEXPHS
041928,000157: 16,3016 13127 TCF CNTRCOPY
041929,000158:
041930,000159: 16,3017 31642 REPCHEK CAE REPFRAC # CHECK FOR REPETITIVE UPDATES
041931,000160: 16,3020 00006 EXTEND
041932,000161: 16,3021 63131 BZMF TVCEXFIN # NO, OVER-AND-OUT
041933,000162: 16,3022 55446 TS TEMPDAP +1 # YES, SET UP CORRECTION FRACTION
041934,000163: 16,3023 35015 CAF FOUR # SET UP TVCEXPHS FOR ENTRY AT CORSETUP
041935,000164: 16,3024 55651 TS TVCEXPHS
041936,000165: 16,3025 13040 TCF CORSETUP
Page 948 |
041938,000167: 16,3026 35003 1SHOTOK CAF BIT13 # CHECK ENGINE-ON BIT, NOT PERMITTING
041939,000168: 16,3027 00006 EXTEND # ONE-SHOT DURING ENGINE-SHUTDOWN
041940,000169: 16,3030 02011 RAND DSALMOUT
041941,000170: 16,3031 10000 CCS A
041942,000171: 16,3032 13034 TCF +2 # ONE-SHOT OK
041943,000172: 16,3033 13131 TCF TVCEXFIN # NO, TERMINATE
041944,000173:
041945,000174: 16,3034 25651 INCR TVCEXPHS # (3)
041946,000175:
041947,000176: 16,3035 33134 TEMPSET CAF FCORFRAC # SET UP CORRECTION FRACTION
041948,000177: 16,3036 55446 TS TEMPDAP +1
041949,000178:
041950,000179: 16,3037 25651 INCR TVCEXPHS # ENTRY FROM REPCHEK AT NEXT LOCATION (4)
041951,000180:
041952,000181: 16,3040 31466 CORSETUP CAE DAPDATR1 # CHECK FOR LEM-OFF/ON
041953,000182: 16,3041 75003 MASK BIT13 # (NOTE, SHOWS LEM-OFF)
041954,000183: 16,3042 00006 EXTEND
041955,000184: 16,3043 13045 BZF +2 # LEM IS ON, PICK UP TEMPDAP+1
041956,000185: 16,3044 31446 CAE TEMPDAP +1 # LEM IS OFF, PICK UP 2(TEMPDAP+1)
041957,000186: 16,3045 61446 AD TEMPDAP +1
041958,000187: 16,3046 55445 TS TEMPDAP # CG.CORR USES TEMPDAP
041959,000188:
041960,000189: 16,3047 37716 CAF NEGONE # SET UP FOR CNTR = -1 (ONE-SHOT DONE)
041961,000190: 16,3050 55676 TS CNTRTMP # (COPYCYCLE AT .CNTRCOPY.)
041962,000191:
041963,000192: 16,3051 00006 CG.CORR EXTEND # PITCH TMC LOOP
041964,000193: 16,3052 31606 DCA PDELOFF
041965,000194: 16,3053 53673 DXCH PACTTMP
041966,000195: 16,3054 00006 EXTEND
041967,000196: 16,3055 41606 DCS PDELOFF
041968,000197: 16,3056 20001 DDOUBL
041969,000198: 16,3057 20001 DDOUBL
041970,000199: 16,3060 53612 DXCH TTMP1
041971,000200: 16,3061 00006 EXTEND
041972,000201: 16,3062 31602 DCA DELPBAR
041973,000202: 16,3063 20001 DDOUBL
041974,000203: 16,3064 20001 DDOUBL
041975,000204: 16,3065 21612 DAS TTMP1
041976,000205: 16,3066 00006 EXTEND
041977,000206: 16,3067 31612 DCA TTMP1
041978,000207: 16,3070 00006 EXTEND
041979,000208: 16,3071 71445 MP TEMPDAP
041980,000209: 16,3072 21673 DAS PACTTMP
041981,000210:
041982,000211: 16,3073 00006 EXTEND # YAW TMC LOOP
041983,000212: 16,3074 31610 DCA YDELOFF
041984,000213: 16,3075 53675 DXCH YACTTMP
041985,000214: 16,3076 00006 EXTEND
041986,000215: 16,3077 41610 DCS YDELOFF
041987,000216: 16,3100 20001 DDOUBL
Page 949 |
041989,000218: 16,3101 20001 DDOUBL
041990,000219: 16,3102 53612 DXCH TTMP1
041991,000220: 16,3103 00006 EXTEND
041992,000221: 16,3104 31604 DCA DELYBAR
041993,000222: 16,3105 20001 DDOUBL
041994,000223: 16,3106 20001 DDOUBL
041995,000224: 16,3107 21612 DAS TTMP1
041996,000225: 16,3110 00006 EXTEND
041997,000226: 16,3111 31612 DCA TTMP1
041998,000227: 16,3112 00006 EXTEND
041999,000228: 16,3113 71445 MP TEMPDAP
042000,000229: 16,3114 21675 DAS YACTTMP
042001,000230:
042002,000231: 16,3115 25651 CORCOPY INCR TVCEXPHS # RESTART PROTECT THE COPYCYCLE (5)
042003,000232:
042004,000233: 16,3116 00006 EXTEND # TRIM-ESTIMATES, AND
042005,000234: 16,3117 31673 DCA PACTTMP
042006,000235: 16,3120 55423 TS PACTOFF # TRIMS
042007,000236: 16,3121 53606 DXCH PDELOFF
042008,000237:
042009,000238: 16,3122 00006 EXTEND
042010,000239: 16,3123 31675 DCA YACTTMP
042011,000240: 16,3124 55424 TS YACTOFF
042012,000241: 16,3125 53610 DXCH YDELOFF
042013,000242:
042014,000243: 16,3126 25651 INCR TVCEXPHS # ENTRY FROM 1SHOTCHK AT NEXT LOCATION (6)
042015,000244:
042016,000245: 16,3127 31676 CNTRCOPY CAE CNTRTMP # UPDATE CNTR (RESTARTS OK, FOLLOWS CPYCY)
042017,000246: 16,3130 55447 TS CNTR
042018,000247:
042019,000248: 16,3131 35021 TVCEXFIN CAF ZERO # RESET TVCEXPHS
042020,000249: 16,3132 55651 TS TVCEXPHS
042021,000250: 16,3133 15324 TCF TASKOVER # TVCEXECUTIVE FINISHED
042022,000251:
042023,000252: 16,3134 10000 FCORFRAC OCT 10000 # ONE-SHOT CORRECTION FRACTION
042024,000253:
Page 950 This page is empty. |
042027,000256:
042028,000257:
End of include-file TVCEXECUTIVE.agc. Parent file is MAIN.agc