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