Source Code
These source-code files are part of a reconstructed copy of Comanche 45, the
second release, though not the final mission release, of the Apollo 10
Command Module (CM) Apollo Guidance Computer (AGC) software. Comanche 45 was
preceded by Comanche 44 and followed by Comanche 45/2 (the flown release). The reconstruction
is believed to be exactly accurate, but in the absence of an actual Apollo-era
listing of Comanche 45, some explanation of the reconstruction process is needed
to insure confidence in that accuracy.
The starting point was the source code of Comanche 44 (itself previously accurately reconstructed). Comanche 44 source code was then modified by incorporating changes known from contemporary documentation to have been made between revisions 44 and 45. The now-reconstructed Comanche 45 source code was verified by assembling it and checking that the assembled code had the expected known-correct memory-bank checksums. Note that page numbers in the reconstructed code tend to match those in the Comanche 55, the most-similar revision of Comanche for which we have access to an actual non-reconstructed hardcopy; the source code would likely have different page numbers in a contemporary Comanche 45 listing. Annotations that were not present in the contemporary source code have been added to the reconstructed code to justify each change relative to Comanche 44. Here's a guide to the Apollo documentation referenced in those annotations:
Comments expected to have been present in the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC Project's GitHub repository. |
036534,000002: ## Copyright: Public domain.
036535,000003: ## Filename: ENTRY_LEXICON.agc
036536,000004: ## Purpose: A section of Comanche revision 045.
036537,000005: ## It is part of the reconstructed source code for the
036538,000006: ## second release of the flight software for the Command
036539,000007: ## Module's (CM) Apollo Guidance Computer (AGC) for Apollo 10.
036540,000008: ## The code has been recreated from a copy of Comanche 055. It
036541,000009: ## has been adapted such that the resulting bugger words
036542,000010: ## exactly match those specified for Comanche 45 in NASA drawing
036543,000011: ## 2021153D, which gives relatively high confidence that the
036544,000012: ## reconstruction is correct.
036545,000013: ## Assembler: yaYUL
036546,000014: ## Contact: Ron Burkey <info@sandroid.org>.
036547,000015: ## Website: www.ibiblio.org/apollo/index.html
036548,000016: ## Mod history: 2020-12-06 MAS Created from Comanche 44.
036549,000017:
Page 837 |
036551,000019: # VARIABLE DESCRIPTION MAXIMUM VALUE * COMPUTER NAME
036552,000020: # -------- ----------- ------- ----- -------- ----
036553,000021: # -
036554,000022: # URT0 INITIAL TARGET VECTOR 2 (UNIT VECTOR) = RTINIT
036555,000023: # -
036556,000024: # UZ UNIT VECTOR NORTH 1 = UNITW
036557,000025: # -
036558,000026: # V VELOCITY VECTOR 2 VSAT = VEL
036559,000027: # -
036560,000028: # R POSITION VECTOR 2 EXP 29 METERS = RN
036561,000029: # -
036562,000030: # VI INERTIAL VELOCITY 128 M/CENTISEC = VN
036563,000031: # -
036564,000032: # RTE VECTOR EAST AT INITIAL TARGET 2 = RTEAST
036565,000033: # -
036566,000034: # UTR NORMAL TO RTE AND UZ 2 = RTNORM
036567,000035: # -
036568,000036: # URT TARGET VECTOR 2 = RT
036569,000037: # -
036570,000038: # UNI UNIT NORMAL TO TRAJECTORY PLANE 2
036571,000039: # -
036572,000040: # DELV INTEGRATED ACCEL. FROM PIPAS 5.85 16384 CM/S
036573,000041: # -
036574,000042: # G GRAVITY VECTOR 128 M/CENTISEC = GDT/2
036575,000043:
036576,000044: # A0 INITIAL DRAG FOR UPCONTRL 805 FPSS FPSS=FT/SEC/SEC
036577,000045:
036578,000046: # AHOOKDV TERM IN GAMMAL CALC. = AHOOK DVL 16
036579,000047:
036580,000048: # A1 DRAG VALUE IN FACTOR CALCULATION 805 FPSS
036581,000049:
036582,000050: # ALP CONST FOR UPCONTRL 1
036583,000051:
036584,000052: # ASKEP KEPLER RANGE 21600 NM NM = NAUTICAL MILE
036585,000053:
036586,000054: # ASP1 FINAL PHASE RANGE 21600 NM
036587,000055:
036588,000056: # ASPUP UP-RANGE 21600 NM
036589,000057:
036590,000058: # ASP3 GAMMA CORRECTION 21600 NM
036591,000059:
036592,000060: # ASPDWN RANGE DOWN TO PULL-UP 21600 NM
036593,000061:
036594,000062: # ASP PREDICTED RANGE 21600 NM NOT STORED
036595,000063:
036596,000064: # COSG COSINE(GAMMAL) 2 = COSG/2
036597,000065:
036598,000066: # C/D0 RECIPROCAL DRAG, -4/D0 B-8 64/FPSS
036599,000067:
036600,000068: # D TOTAL ACCELERATION 805 FPSS
036601,000069:
036602,000070: # D0 CONTROLLED CONSTANT D 805 FPSS
036603,000071:
036604,000072: # DHOOK TERM IN GAMMAL COMPUTATION 805 FPSS
036605,000073:
036606,000074: # DIFF THETNM-ASP (RANGE DIFFERENCE) 21600 NM
036607,000075:
036608,000076: # DIFFOLD PREVIOUS VALUE OF DIFF 21600 NM
036609,000077:
036610,000078: # DLEWD CHANGE IN LEWD 1
036611,000079:
036612,000080: # DR REFERENCE DRAG FOR DOWNCONTROL 805 FPSS NOT STORED
036613,000081:
036614,000082: # DREFR REFERENCE DRAG 805 FPSS NOT STORED
036615,000083:
036616,000084: # DVL VS1-VL 2 VSAT
036617,000085:
036618,000086: # E ECCENTRICITY 4 NOT STORED
036619,000087:
036620,000088: # F1 DRANGE/D DRAG (FINAL PHASE) 2700/805 = FX +5
036621,000089:
036622,000090: # F2 DRANGE/D RDOT (FINAL PHASE) 2700/2VS NM/FPS = FX +4
Page 838 |
036624,000092:
036625,000093: # F3 DRANGE/D (L/D) 2700 NM = FX
036626,000094:
036627,000095: # FACT1 CONST FOR UPCONTRL 805 FPSS
036628,000096:
036629,000097: # FACT2 CONST FOR UPCONTRL 1/805 FPSS
036630,000098:
036631,000099: # FACTOR USED IN UPCONTRL 1 * MAXIMUM VALUE DENOTES UNSCALED
036632,000100: #
036633,000101: # GAMMAL FLIGHT PATH ANGLE AT VL 1 RADIAN VARIABLE VALUE WHEN SCALED
036634,000102:
036635,000103: # GAMMAL1 SIMPLE FORM OF GAMMAL 1 RADIAN VARIABLE HAS MAXIMUM VALUE OF ONE.
036636,000104:
Page 839 |
036638,000106: # VARIABLE DESCRIPTION MAXIMUM VALUE COMPUTER NAME
036639,000107: # -------- ----------- ------- ----- -------- ----
036640,000108:
036641,000109: # HEADSUP INDICATOR FOR INITIAL ROLL 1
036642,000110:
036643,000111: # KA DRAG TO LIFT UP IF DOWN 805 FPSS = KAT
036644,000112:
036645,000113: # KLAT LATERAL SWITCH GAIN 1 (NOM = .0125)
036646,000114:
036647,000115: # K2ROLL INDICATOR FOR ROLL SWITCH
036648,000116:
036649,000117: # LAD MAX L/D (MIN ACTUAL VEHICLE L/D) 1
036650,000118:
036651,000119: # LADPAD NOMINAL VEHICLE L/D, SP PAD LOAD 1 (NOM = 0.3)
036652,000120:
036653,000121: # LATANG LATERAL RANGE 4 RADIANS
036654,000122:
036655,000123: # LEQ EXCESS C.F. OVER GRAV=(VSQ-1)GS 128.8 FPSS
036656,000124:
036657,000125: # LEWD UPCONTROL REFERENCE L/D 1
036658,000126:
036659,000127: # LOD FINAL PHASE L/D 1 (NOM = 0.18)
036660,000128:
036661,000129: # LODPAD FINAL PHASE L/D, SP PAD LOAD 1
036662,000130:
036663,000131: # L/D DESIRED LIFT TO DRAG RATIO 1
036664,000132: # (VERTICAL PLANE)
036665,000133: #
036666,000134: # L/D1 TEMP STORAGE FOR L/D IN LATERAL 1
036667,000135:
036668,000136: # L/DCMINR LAD COS(15DEG) 1 (NOM = 0.2895)
036669,000137:
036670,000138: # PREDANGL PREDICTED RANGE (FINAL PHASE) 2700 NM = PREDANG
036671,000139:
036672,000140: # Q2 FINAL PHASE RANGE -23500 Q3 21600 NM
036673,000141: # Q2 = FCN(LAD)
036674,000142:
036675,000143: # Q7 MINIMUM DRAG FOR UPCONTROL 805FPSS
036676,000144:
036677,000145: # RDOT ALTITUDE RATE 2 VSAT
036678,000146:
036679,000147: # RDOTREF REFERENCE RDOT FOR UPCONTROL 2 VSAT
036680,000148:
036681,000149: # RDTR REFERENCE RDOT FOR DOWNCONT 2 VSAT NOT SAVED
036682,000150:
036683,000151: # ROLLC ROLL COMMAND 1 REVOLUTION
036684,000152:
036685,000153: # RTOGO RANGE TO GO (FINAL PHASE) 2700 NM = FX +2
036686,000154:
036687,000155: # SL SINE OF LATITUDE 1 NOT SAVED
036688,000156:
036689,000157: # T TIME B 28 CENTISEC = TIME2,TIME1
036690,000158:
036691,000159: # THETA DESIRED RANGE (RADIANS) 2 PI RADIANS = THETAH
036692,000160:
036693,000161: # THETNM DESIRED RANGE (NM) 21600 NM NON EXISTENT
036694,000162:
036695,000163: # V VELOCITY MAGNITUDE 2 VSAT
036696,000164: #
036697,000165: # V1 INITIAL VELOCITY FOR UPCONTROL 2 VSAT
036698,000166:
036699,000167: # VL EXIT VELOCITY FOR UPCONTROL 2 VSAT
036700,000168:
036701,000169: # VREF REFERENCE VELOCITY FOR UPCONTROL 2 VSAT
036702,000170:
036703,000171: # VS1 VSAT OR V1, WHICHEVER IS SMALLER 2 VSAT
036704,000172: # 2 2
036705,000173: # VBARS VL /VSAT 4
036706,000174: # 2 2
036707,000175: # VSQ NORMALISED VEL. SQUARED = V /VSAT 4 = VSQUARE
036708,000176:
036709,000177: # WT EARTH RATE TIMES TIME 1 REVOLUTION NOT SAVED
036710,000178: # = WIE (DTEAROT)
036711,000179: # X INTERMEDIATE VARIABLE IN G-LIMITER 2 VSAT NOT SAVED
036712,000180:
036713,000181: # Y LATERAL MISS LIMIT 4 RADIANS NOT SAVED
036714,000182:
Page 840 |
036716,000184: # EXTRA COMPUTER ERASABLE LOCATIONS NOT SHOWN ON FLOW CHARTS
036717,000185: # -----------------------------------------------------------
036718,000186:
036719,000187: # VARIABLE DESCRIPTION MAXIMUM VALUE
036720,000188: # -------- ----------- ------- -----
036721,000189:
036722,000190: # GOTOADDR ADDRESS SELECTED BY SEQUENCER
036723,000191:
036724,000192: # XPIPBUF BUFFER TO STORE X PIPA COUNTS
036725,000193:
036726,000194: # YPIPBUF BUFFER TO STORE Y PIPA COUNTS
036727,000195:
036728,000196: # ZPIPBUF BUFFER TO STORE Z PIPA COUNTS
036729,000197:
036730,000198: # PIPCTR COUNTS PASSES THRU PIPA READ ROUTINE
036731,000199:
036732,000200: # JJ INDEX IN FINAL PHASE TABLE LOOK-UP
036733,000201:
036734,000202: # MM INDEX IN FINAL PHASE TABLE LOOK-UP
036735,000203:
036736,000204: # GRAD INTERPOLATION FACTOR IN FINAL PHASE
036737,000205:
036738,000206: # FX DRANGE/D L/D = F3 2700 NM
036739,000207:
036740,000208: # FX +1 AREF 805 FPSS
036741,000209:
036742,000210: # FX +2 RTOGO 2700 NM
036743,000211:
036744,000212: # FX +3 RDOTREF VSAT/4
036745,000213:
036746,000214: # FX +4 DRANGE/D RDOT = F2 21600/2VS NM/FPS
036747,000215:
036748,000216: # FX +5 DRANGE/D DRAG = F1 2700/805 NM/FPSS
036749,000217:
036750,000218: # TEM1B TEMPORARY LOCATION
036751,000219:
036752,000220: # TIME/RTO TIME OF INITIAL TARGET RTINIT B 28 CENTISEC
036753,000221:
036754,000222: # DTEAROT EST TIME BETWEEN RTINIT AND RT B 28 CENTISEC
036755,000223: # -
036756,000224: # UNITV UNIT V VECTOR 2
036757,000225: # -
036758,000226: # UNITR UNIT R VECTOR 2
036759,000227: # -
036760,000228: # -VREL NEGATIVE VELOCITY REL TO ATMOSP 2 VSAT
036761,000229:
036762,000230: # COMPUTER SWITCHES INITIAL STATE CM/FLAGS = STATE +6
036763,000231: # -------- -------- ------------- -------------------
036764,000232:
036765,000233: # ENTRYDSP DO ENTRY DISPLAY, IF SET NON-BRANCH (1) 92D, BIT 13
036766,000234: # GONEPAST INDICATES OVERSHOOT OF TARGET NON-BRANCH (0) 95D, BIT 10
036767,000235: # RELVELSW RELATIVE VELOCITY SWITCH NON-BRANCH (0) 96D, BIT 9
036768,000236: # EGSW FINAL PHASE SWITCH NON-BRANCH (0) 97D, BIT 8
036769,000237: # FIRSTPAS INITIAL PASS THRU HUNTEST NON-BRANCH (0) 98D, BIT 7
036770,000238: # HIND INDICATES ITERATION IN HUNTEST NON-BRANCH (0) 99D, BIT 6
036771,000239: # INRLSW INDICATES INIT ROLL ATTITUDE SET NON-BRANCH (0) 100D, BIT 5
036772,000240: # LATSW INHIBIT DOWNLIFT SWITCH IF NOT SET BRANCH (1) 101D, BIT 4
036773,000241: # .05GSW INDICATES DRAG EXCEEDS .05 GS BRANCH (0) 102D, BIT 3
036774,000242:
036775,000243: # GONEBY INDICATES GONE PAST TARGET (SET) SELF-INITIALZNG 112D, BIT 8
036776,000244:
Page 841 |
036778,000246: # CONSTANTS AND GAINS VALUE
036779,000247: # ------------------- -----
036780,000248:
036781,000249: # C1 FACTOR IN ALP COMPUTATION 1.25
036782,000250: # C16 CONSTD GAIN ON DRAG .01
036783,000251: # C17 CONSTD GAIN ON RDOT .001
036784,000252: # C18 BIAS VEL. FOR FINAL PHASE START 500 FPS
036785,000253: # C20 MAX DRAG FOR DOWN-LIFT 175 FPSS
036786,000254: # CHOOK FACTOR IN AHOOK COMPUTATION .25
036787,000255: # CH1 FACTOR IN GAMMAL COMPUTATION 1.0
036788,000256: # COS15 COS( 15 DEG ) .965
036789,000257: # DLEWD0 INITIAL VARIATION IN LEWD -.05
036790,000258: # D2 DRAG TO CHANGE LEWD 175 FPSS
036791,000259: # DT COMPUTATION CYCLE TIME INTERVAL 2 SEC.
036792,000260: # GMAX MAXIMUM ACCELERATION 257.6 FPSS (8 G-S)
036793,000261: # KA1 FACTOR IN KA CALC 1.3 GS
036794,000262: # KA2 FACTOR IN KA CALC .2 GS
036795,000263: # KA3 FACTOR IN D0 CALC 90 FPSS
036796,000264: # KA4 FACTOR IN D0 CALC 40 FPSS
036797,000265: # KB1 OPTIMIZED UPCONTROL GAIN 3.4
036798,000266: # KB2 OPTIMIZED UPCONTROL GAIN .0034
036799,000267: # KDMIN INCREMENT ON Q7 TO DETECT END OF KEPLER PHASE .5 FPSS
036800,000268: # KTETA TIME OF FLIGHT CONSTANT 1000
036801,000269: # KLAT1 FACTOR IN KLAT CALC 1/24
036802,000270: # K44 GAIN USED IN INITIAL ROLL SECTION 19749550 FPS
036803,000271: # LATBIAS LATERAL SWITCH BIAS TERM .41252961 NM
036804,000272: # LEWD1 NOMINAL UPCONTROL L/D .15
036805,000273: # POINT1 FACTOR TO REDUCE UPCONTROL GAIN .1
036806,000274: # Q2 FINAL PHASE RANGE - 23500 Q3 -1002 NM
036807,000275: # Q3 FINAL PHASE DRANGE/D V .07 NM/FPS
036808,000276: # Q5 FINAL PHASE DRANGE/D GAMMA 7050 NM/RAD
036809,000277: # Q6 FINAL PHASE INITIAL FLIGHT PATH ANGLE .0349 RAD
036810,000278: # Q7F MIN DRAG FOR UPCONTROL 6 FPSS
036811,000279: # Q7MIN MIN VALUE FOR Q7 IN FACTOR CALCULATION 40 FPSS
036812,000280: # Q19 FACTOR IN GAMMAL1 CALCULATION .5
036813,000281: # Q21 FACTOR IN Q2 CALCULATION. 1000 NM
036814,000282: # Q22 FACTOR IN Q2 CALCULATION. -1302 NM
036815,000283: # VFINAL1 VELOCITY TO START FINAL PHASE ON INITIAL ENTRY 27000 FPS
036816,000284: # VFINAL FACTOR IN INITIAL UP-DOWN CALC 26600 FPS
036817,000285: # VLMIN MINIMUM VL 18000 FPS
036818,000286: # VMIN VELOCITY TO SWITCH TO RELATIVE VEL VSAT/2
036819,000287: # VRCONTRL RDOT TO START INTO HUNTEST 700 FPS
036820,000288: # VRCONT=COMPUTER NAME
036821,000289: # 25NM TOLERANCE TO STOP RANGE ITERATION 25 NM
036822,000290: # VQUIT VELOCITY TO STOP STEERING 1000 FPS
036823,000291:
Page 842 |
036825,000293: # CONVERSION FACTORS AND SCALING CONSTANTS
036826,000294: # ---------- ------- --- ------- ---------
036827,000295:
036828,000296: # ATK ANGLE IN RAD TO NM 3437.7468 NM/RAD
036829,000297: # GS NOMINAL G VALUE FOR SCALING 32.2 FPSS
036830,000298: # HS ATMOSPHERE SCALE HEIGHT 28500 FT
036831,000299: # J GRAVITY HARMONIC COEFFICIENT .00162346
036832,000300: # KWE EQUATORIAL EARTH RATE 1546.70168 FPS
036833,000301: # MUE EARTH GRAVITATIONAL CONSTANT 3.986032233 E14 CUBIC M/ SEC SEC
036834,000302: # RE EARTH RADIUS 21202900 FT
036835,000303: # REQ EARTH EQUATORIAL RADIUS 20925738.2 FT
036836,000304: # VSAT SATELLITE VELOCITY AT RE 25766.1973 FPS
036837,000305: # WIE EARTH RATE .0000729211505 RAD/SEC
036838,000306:
036839,000307: # (END GSOP AS-278, VOL 1, FIG. 5.6-3 CONSTANTS, GAINS, ETC.)
036840,000308:
036841,000309: # DISPLAY QUANTITIES
036842,000310: # ------------------
036843,000311:
036844,000312: # (SEE SECTION 4 OF THE GSOP FOR SIGN CONVENTIONS.)
036845,000313:
036846,000314: # VARIABLE DESCRIPTION MAXIMUM VALUE
036847,000315: # -------- ----------- ------- -----
036848,000316:
036849,000317: # QMAX PREDICTED MAXIMUM ENTRY ACCEL 163.84 GS N 60
036850,000318: # VPRED PREDICTED VELOCITY AT ALTITUDE 128 M/CENTISEC N 60
036851,000319: # 400K FT ABOVE FISCHER RADIUS.
036852,000320: # GAMMAEI PREDICTED GAMMA AT ALTITUDE 1 REVOLUTION N 60
036853,000321: # 400K FT ABOVE FISCHER RADIUS.
036854,000322: # D DRAG ACCELERATION 805 FPSS N 64
036855,000323: # VMAGI INERTIAL VELOCITY MAGNITUDE 128 M/CENTISEC N 64, N 68
036856,000324: # THETAH DESIRED RANGE ANGLE NM 1 REVOLUTION N 64, N 67
036857,000325: # LAT PRESENT LATITUDE 1 REVOLUTION N 67
036858,000326: # LONG PRESENT LONGITUDE 1 REVOLUTION N 67
036859,000327: # RTOGO RANGE ANGLE TO SPLASH FROM 1 REVOLUTION N 63
036860,000328: # EMSALT FT ABOVE FISCHER RADIUS. (IN NM)
036861,000329: # VIO PREDICTED VELOCITY AT ALTITUDE 128 M/CENTISEC N 63
036862,000330: # EMSALT FT ABOVE FISCHER RADIUS.
036863,000331: # TTE TIME OF FREE FALL TO ALT B 28 CENTISEC N 63
036864,000332: # EMSALT FT ABOVE FISCHER RADIUS.
036865,000333: # ROLLC ROLL COMMAND 1 REVOLUTION N 66, N 68, N 69
036866,000334: # LATANG CROSS-RANGE ERROR (XRNGERR) 4 RADIANS N 66
036867,000335: # DNRNGERR DOWN RANGE ERROR 1 REVOLUTION N 66
036868,000336: # (PREDANG - THETAH IN NM)
036869,000337: # HDOT ALTITUDE RATE 128 M/CENTISEC N 68
036870,000338: # Q7 MINIMUM DRAG FOR UPCONTROL 805 FPSS N 69
036871,000339: # VL EXIT VELOCITY FOR UP-CONTROL 2 VSAT N 69
036872,000340:
Page 843 |
036874,000342: # BODY ATTITUDE QUANTITIES (CM/POSE)
036875,000343: # -----------------------------------
036876,000344:
036877,000345: # VARIABLE DESCRIPTION MAXIMUM VALUE
036878,000346: # -------- ----------- ------- -----
036879,000347: # -
036880,000348: # -VREL NEGATIVE VELOCITY REL TO ATMOS. 2 VSAT
036881,000349: # -
036882,000350: # OLDUYA USED FOR UYA BELOW 1000 FPS 2
036883,000351: # -
036884,000352: # UXA/2 UNIT VECTOR TRIAD 2
036885,000353: # -
036886,000354: # UYA/2 BASED ON 2
036887,000355: # -
036888,000356: # UZA/2 THE TRAJECTORY. 2
036889,000357: # -
036890,000358: # UBX/2 UNIT VECTOR 2
036891,000359: # -
036892,000360: # UBY/2 BODY TRIAD 2
036893,000361: # -
036894,000362: # UBZ/2 FOR CM. 2
036895,000363:
End of include-file ENTRY_LEXICON.agc. Parent file is MAIN.agc