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. |
036999,000002: ## Copyright: Public domain. 037000,000003: ## Filename: ENTRY_LEXICON.agc 037001,000004: ## Purpose: A section of Comanche revision 044. 037002,000005: ## It is part of the reconstructed source code for the 037003,000006: ## original release of the flight software for the Command 037004,000007: ## Module's (CM) Apollo Guidance Computer (AGC) for Apollo 10. 037005,000008: ## The code has been recreated from a copy of Comanche 055. It 037006,000009: ## has been adapted such that the resulting bugger words 037007,000010: ## exactly match those specified for Comanche 44 in NASA drawing 037008,000011: ## 2021153D, which gives relatively high confidence that the 037009,000012: ## reconstruction is correct. 037010,000013: ## Assembler: yaYUL 037011,000014: ## Contact: Ron Burkey <info@sandroid.org>. 037012,000015: ## Website: www.ibiblio.org/apollo/index.html 037013,000016: ## Mod history: 2020-12-03 MAS Created from Comanche 51. 037014,000017:
Page 837 |
037016,000019: # VARIABLE DESCRIPTION MAXIMUM VALUE * COMPUTER NAME 037017,000020: # -------- ----------- ------- ----- -------- ---- 037018,000021: # - 037019,000022: # URT0 INITIAL TARGET VECTOR 2 (UNIT VECTOR) = RTINIT 037020,000023: # - 037021,000024: # UZ UNIT VECTOR NORTH 1 = UNITW 037022,000025: # - 037023,000026: # V VELOCITY VECTOR 2 VSAT = VEL 037024,000027: # - 037025,000028: # R POSITION VECTOR 2 EXP 29 METERS = RN 037026,000029: # - 037027,000030: # VI INERTIAL VELOCITY 128 M/CENTISEC = VN 037028,000031: # - 037029,000032: # RTE VECTOR EAST AT INITIAL TARGET 2 = RTEAST 037030,000033: # - 037031,000034: # UTR NORMAL TO RTE AND UZ 2 = RTNORM 037032,000035: # - 037033,000036: # URT TARGET VECTOR 2 = RT 037034,000037: # - 037035,000038: # UNI UNIT NORMAL TO TRAJECTORY PLANE 2 037036,000039: # - 037037,000040: # DELV INTEGRATED ACCEL. FROM PIPAS 5.85 16384 CM/S 037038,000041: # - 037039,000042: # G GRAVITY VECTOR 128 M/CENTISEC = GDT/2 037040,000043: 037041,000044: # A0 INITIAL DRAG FOR UPCONTRL 805 FPSS FPSS=FT/SEC/SEC 037042,000045: 037043,000046: # AHOOKDV TERM IN GAMMAL CALC. = AHOOK DVL 16 037044,000047: 037045,000048: # A1 DRAG VALUE IN FACTOR CALCULATION 805 FPSS 037046,000049: 037047,000050: # ALP CONST FOR UPCONTRL 1 037048,000051: 037049,000052: # ASKEP KEPLER RANGE 21600 NM NM = NAUTICAL MILE 037050,000053: 037051,000054: # ASP1 FINAL PHASE RANGE 21600 NM 037052,000055: 037053,000056: # ASPUP UP-RANGE 21600 NM 037054,000057: 037055,000058: # ASP3 GAMMA CORRECTION 21600 NM 037056,000059: 037057,000060: # ASPDWN RANGE DOWN TO PULL-UP 21600 NM 037058,000061: 037059,000062: # ASP PREDICTED RANGE 21600 NM NOT STORED 037060,000063: 037061,000064: # COSG COSINE(GAMMAL) 2 = COSG/2 037062,000065: 037063,000066: # C/D0 RECIPROCAL DRAG, -4/D0 B-8 64/FPSS 037064,000067: 037065,000068: # D TOTAL ACCELERATION 805 FPSS 037066,000069: 037067,000070: # D0 CONTROLLED CONSTANT D 805 FPSS 037068,000071: 037069,000072: # DHOOK TERM IN GAMMAL COMPUTATION 805 FPSS 037070,000073: 037071,000074: # DIFF THETNM-ASP (RANGE DIFFERENCE) 21600 NM 037072,000075: 037073,000076: # DIFFOLD PREVIOUS VALUE OF DIFF 21600 NM 037074,000077: 037075,000078: # DLEWD CHANGE IN LEWD 1 037076,000079: 037077,000080: # DR REFERENCE DRAG FOR DOWNCONTROL 805 FPSS NOT STORED 037078,000081: 037079,000082: # DREFR REFERENCE DRAG 805 FPSS NOT STORED 037080,000083: 037081,000084: # DVL VS1-VL 2 VSAT 037082,000085: 037083,000086: # E ECCENTRICITY 4 NOT STORED 037084,000087: 037085,000088: # F1 DRANGE/D DRAG (FINAL PHASE) 2700/805 = FX +5 037086,000089: 037087,000090: # F2 DRANGE/D RDOT (FINAL PHASE) 2700/2VS NM/FPS = FX +4
Page 838 |
037089,000092: 037090,000093: # F3 DRANGE/D (L/D) 2700 NM = FX 037091,000094: 037092,000095: # FACT1 CONST FOR UPCONTRL 805 FPSS 037093,000096: 037094,000097: # FACT2 CONST FOR UPCONTRL 1/805 FPSS 037095,000098: 037096,000099: # FACTOR USED IN UPCONTRL 1 * MAXIMUM VALUE DENOTES UNSCALED 037097,000100: # 037098,000101: # GAMMAL FLIGHT PATH ANGLE AT VL 1 RADIAN VARIABLE VALUE WHEN SCALED 037099,000102: 037100,000103: # GAMMAL1 SIMPLE FORM OF GAMMAL 1 RADIAN VARIABLE HAS MAXIMUM VALUE OF ONE. 037101,000104:
Page 839 |
037103,000106: # VARIABLE DESCRIPTION MAXIMUM VALUE COMPUTER NAME 037104,000107: # -------- ----------- ------- ----- -------- ---- 037105,000108: 037106,000109: # HEADSUP INDICATOR FOR INITIAL ROLL 1 037107,000110: 037108,000111: # KA DRAG TO LIFT UP IF DOWN 805 FPSS = KAT 037109,000112: 037110,000113: # KLAT LATERAL SWITCH GAIN 1 (NOM = .0125) 037111,000114: 037112,000115: # K2ROLL INDICATOR FOR ROLL SWITCH 037113,000116: 037114,000117: # LAD MAX L/D (MIN ACTUAL VEHICLE L/D) 1 037115,000118: 037116,000119: # LADPAD NOMINAL VEHICLE L/D, SP PAD LOAD 1 (NOM = 0.3) 037117,000120: 037118,000121: # LATANG LATERAL RANGE 4 RADIANS 037119,000122: 037120,000123: # LEQ EXCESS C.F. OVER GRAV=(VSQ-1)GS 128.8 FPSS 037121,000124: 037122,000125: # LEWD UPCONTROL REFERENCE L/D 1 037123,000126: 037124,000127: # LOD FINAL PHASE L/D 1 (NOM = 0.18) 037125,000128: 037126,000129: # LODPAD FINAL PHASE L/D, SP PAD LOAD 1 037127,000130: 037128,000131: # L/D DESIRED LIFT TO DRAG RATIO 1 037129,000132: # (VERTICAL PLANE) 037130,000133: # 037131,000134: # L/D1 TEMP STORAGE FOR L/D IN LATERAL 1 037132,000135: 037133,000136: # L/DCMINR LAD COS(15DEG) 1 (NOM = 0.2895) 037134,000137: 037135,000138: # PREDANGL PREDICTED RANGE (FINAL PHASE) 2700 NM = PREDANG 037136,000139: 037137,000140: # Q2 FINAL PHASE RANGE -23500 Q3 21600 NM 037138,000141: # Q2 = FCN(LAD) 037139,000142: 037140,000143: # Q7 MINIMUM DRAG FOR UPCONTROL 805FPSS 037141,000144: 037142,000145: # RDOT ALTITUDE RATE 2 VSAT 037143,000146: 037144,000147: # RDOTREF REFERENCE RDOT FOR UPCONTROL 2 VSAT 037145,000148: 037146,000149: # RDTR REFERENCE RDOT FOR DOWNCONT 2 VSAT NOT SAVED 037147,000150: 037148,000151: # ROLLC ROLL COMMAND 1 REVOLUTION 037149,000152: 037150,000153: # RTOGO RANGE TO GO (FINAL PHASE) 2700 NM = FX +2 037151,000154: 037152,000155: # SL SINE OF LATITUDE 1 NOT SAVED 037153,000156: 037154,000157: # T TIME B 28 CENTISEC = TIME2,TIME1 037155,000158: 037156,000159: # THETA DESIRED RANGE (RADIANS) 2 PI RADIANS = THETAH 037157,000160: 037158,000161: # THETNM DESIRED RANGE (NM) 21600 NM NON EXISTENT 037159,000162: 037160,000163: # V VELOCITY MAGNITUDE 2 VSAT 037161,000164: # 037162,000165: # V1 INITIAL VELOCITY FOR UPCONTROL 2 VSAT 037163,000166: 037164,000167: # VL EXIT VELOCITY FOR UPCONTROL 2 VSAT 037165,000168: 037166,000169: # VREF REFERENCE VELOCITY FOR UPCONTROL 2 VSAT 037167,000170: 037168,000171: # VS1 VSAT OR V1, WHICHEVER IS SMALLER 2 VSAT 037169,000172: # 2 2 037170,000173: # VBARS VL /VSAT 4 037171,000174: # 2 2 037172,000175: # VSQ NORMALISED VEL. SQUARED = V /VSAT 4 = VSQUARE 037173,000176: 037174,000177: # WT EARTH RATE TIMES TIME 1 REVOLUTION NOT SAVED 037175,000178: # = WIE (DTEAROT) 037176,000179: # X INTERMEDIATE VARIABLE IN G-LIMITER 2 VSAT NOT SAVED 037177,000180: 037178,000181: # Y LATERAL MISS LIMIT 4 RADIANS NOT SAVED 037179,000182:
Page 840 |
037181,000184: # EXTRA COMPUTER ERASABLE LOCATIONS NOT SHOWN ON FLOW CHARTS 037182,000185: # ----------------------------------------------------------- 037183,000186: 037184,000187: # VARIABLE DESCRIPTION MAXIMUM VALUE 037185,000188: # -------- ----------- ------- ----- 037186,000189: 037187,000190: # GOTOADDR ADDRESS SELECTED BY SEQUENCER 037188,000191: 037189,000192: # XPIPBUF BUFFER TO STORE X PIPA COUNTS 037190,000193: 037191,000194: # YPIPBUF BUFFER TO STORE Y PIPA COUNTS 037192,000195: 037193,000196: # ZPIPBUF BUFFER TO STORE Z PIPA COUNTS 037194,000197: 037195,000198: # PIPCTR COUNTS PASSES THRU PIPA READ ROUTINE 037196,000199: 037197,000200: # JJ INDEX IN FINAL PHASE TABLE LOOK-UP 037198,000201: 037199,000202: # MM INDEX IN FINAL PHASE TABLE LOOK-UP 037200,000203: 037201,000204: # GRAD INTERPOLATION FACTOR IN FINAL PHASE 037202,000205: 037203,000206: # FX DRANGE/D L/D = F3 2700 NM 037204,000207: 037205,000208: # FX +1 AREF 805 FPSS 037206,000209: 037207,000210: # FX +2 RTOGO 2700 NM 037208,000211: 037209,000212: # FX +3 RDOTREF VSAT/4 037210,000213: 037211,000214: # FX +4 DRANGE/D RDOT = F2 21600/2VS NM/FPS 037212,000215: 037213,000216: # FX +5 DRANGE/D DRAG = F1 2700/805 NM/FPSS 037214,000217: 037215,000218: # TEM1B TEMPORARY LOCATION 037216,000219: 037217,000220: # TIME/RTO TIME OF INITIAL TARGET RTINIT B 28 CENTISEC 037218,000221: 037219,000222: # DTEAROT EST TIME BETWEEN RTINIT AND RT B 28 CENTISEC 037220,000223: # - 037221,000224: # UNITV UNIT V VECTOR 2 037222,000225: # - 037223,000226: # UNITR UNIT R VECTOR 2 037224,000227: # - 037225,000228: # -VREL NEGATIVE VELOCITY REL TO ATMOSP 2 VSAT 037226,000229: 037227,000230: # COMPUTER SWITCHES INITIAL STATE CM/FLAGS = STATE +6 037228,000231: # -------- -------- ------------- ------------------- 037229,000232: 037230,000233: # ENTRYDSP DO ENTRY DISPLAY, IF SET NON-BRANCH (1) 92D, BIT 13 037231,000234: # GONEPAST INDICATES OVERSHOOT OF TARGET NON-BRANCH (0) 95D, BIT 10 037232,000235: # RELVELSW RELATIVE VELOCITY SWITCH NON-BRANCH (0) 96D, BIT 9 037233,000236: # EGSW FINAL PHASE SWITCH NON-BRANCH (0) 97D, BIT 8 037234,000237: # FIRSTPAS INITIAL PASS THRU HUNTEST NON-BRANCH (0) 98D, BIT 7 037235,000238: # HIND INDICATES ITERATION IN HUNTEST NON-BRANCH (0) 99D, BIT 6 037236,000239: # INRLSW INDICATES INIT ROLL ATTITUDE SET NON-BRANCH (0) 100D, BIT 5 037237,000240: # LATSW INHIBIT DOWNLIFT SWITCH IF NOT SET BRANCH (1) 101D, BIT 4 037238,000241: # .05GSW INDICATES DRAG EXCEEDS .05 GS BRANCH (0) 102D, BIT 3 037239,000242: 037240,000243: # GONEBY INDICATES GONE PAST TARGET (SET) SELF-INITIALZNG 112D, BIT 8 037241,000244:
Page 841 |
037243,000246: # CONSTANTS AND GAINS VALUE 037244,000247: # ------------------- ----- 037245,000248: 037246,000249: # C1 FACTOR IN ALP COMPUTATION 1.25 037247,000250: # C16 CONSTD GAIN ON DRAG .01 037248,000251: # C17 CONSTD GAIN ON RDOT .001 037249,000252: # C18 BIAS VEL. FOR FINAL PHASE START 500 FPS 037250,000253: # C20 MAX DRAG FOR DOWN-LIFT 175 FPSS 037251,000254: # CHOOK FACTOR IN AHOOK COMPUTATION .25 037252,000255: # CH1 FACTOR IN GAMMAL COMPUTATION 1.0 037253,000256: # COS15 COS( 15 DEG ) .965 037254,000257: # DLEWD0 INITIAL VARIATION IN LEWD -.05 037255,000258: # D2 DRAG TO CHANGE LEWD 175 FPSS 037256,000259: # DT COMPUTATION CYCLE TIME INTERVAL 2 SEC. 037257,000260: # GMAX MAXIMUM ACCELERATION 257.6 FPSS (8 G-S) 037258,000261: # KA1 FACTOR IN KA CALC 1.3 GS 037259,000262: # KA2 FACTOR IN KA CALC .2 GS 037260,000263: # KA3 FACTOR IN D0 CALC 90 FPSS 037261,000264: # KA4 FACTOR IN D0 CALC 40 FPSS 037262,000265: # KB1 OPTIMIZED UPCONTROL GAIN 3.4 037263,000266: # KB2 OPTIMIZED UPCONTROL GAIN .0034 037264,000267: # KDMIN INCREMENT ON Q7 TO DETECT END OF KEPLER PHASE .5 FPSS 037265,000268: # KTETA TIME OF FLIGHT CONSTANT 1000 037266,000269: # KLAT1 FACTOR IN KLAT CALC 1/24 037267,000270: # K44 GAIN USED IN INITIAL ROLL SECTION 19749550 FPS 037268,000271: # LATBIAS LATERAL SWITCH BIAS TERM .41252961 NM 037269,000272: # LEWD1 NOMINAL UPCONTROL L/D .15 037270,000273: # POINT1 FACTOR TO REDUCE UPCONTROL GAIN .1 037271,000274: # Q2 FINAL PHASE RANGE - 23500 Q3 -1002 NM 037272,000275: # Q3 FINAL PHASE DRANGE/D V .07 NM/FPS 037273,000276: # Q5 FINAL PHASE DRANGE/D GAMMA 7050 NM/RAD 037274,000277: # Q6 FINAL PHASE INITIAL FLIGHT PATH ANGLE .0349 RAD 037275,000278: # Q7F MIN DRAG FOR UPCONTROL 6 FPSS 037276,000279: # Q7MIN MIN VALUE FOR Q7 IN FACTOR CALCULATION 40 FPSS 037277,000280: # Q19 FACTOR IN GAMMAL1 CALCULATION .5 037278,000281: # Q21 FACTOR IN Q2 CALCULATION. 1000 NM 037279,000282: # Q22 FACTOR IN Q2 CALCULATION. -1302 NM 037280,000283: # VFINAL1 VELOCITY TO START FINAL PHASE ON INITIAL ENTRY 27000 FPS 037281,000284: # VFINAL FACTOR IN INITIAL UP-DOWN CALC 26600 FPS 037282,000285: # VLMIN MINIMUM VL 18000 FPS 037283,000286: # VMIN VELOCITY TO SWITCH TO RELATIVE VEL VSAT/2 037284,000287: # VRCONTRL RDOT TO START INTO HUNTEST 700 FPS 037285,000288: # VRCONT=COMPUTER NAME 037286,000289: # 25NM TOLERANCE TO STOP RANGE ITERATION 25 NM 037287,000290: # VQUIT VELOCITY TO STOP STEERING 1000 FPS 037288,000291:
Page 842 |
037290,000293: # CONVERSION FACTORS AND SCALING CONSTANTS 037291,000294: # ---------- ------- --- ------- --------- 037292,000295: 037293,000296: # ATK ANGLE IN RAD TO NM 3437.7468 NM/RAD 037294,000297: # GS NOMINAL G VALUE FOR SCALING 32.2 FPSS 037295,000298: # HS ATMOSPHERE SCALE HEIGHT 28500 FT 037296,000299: # J GRAVITY HARMONIC COEFFICIENT .00162346 037297,000300: # KWE EQUATORIAL EARTH RATE 1546.70168 FPS 037298,000301: # MUE EARTH GRAVITATIONAL CONSTANT 3.986032233 E14 CUBIC M/ SEC SEC 037299,000302: # RE EARTH RADIUS 21202900 FT 037300,000303: # REQ EARTH EQUATORIAL RADIUS 20925738.2 FT 037301,000304: # VSAT SATELLITE VELOCITY AT RE 25766.1973 FPS 037302,000305: # WIE EARTH RATE .0000729211505 RAD/SEC 037303,000306: 037304,000307: # (END GSOP AS-278, VOL 1, FIG. 5.6-3 CONSTANTS, GAINS, ETC.) 037305,000308: 037306,000309: # DISPLAY QUANTITIES 037307,000310: # ------------------ 037308,000311: 037309,000312: # (SEE SECTION 4 OF THE GSOP FOR SIGN CONVENTIONS.) 037310,000313: 037311,000314: # VARIABLE DESCRIPTION MAXIMUM VALUE 037312,000315: # -------- ----------- ------- ----- 037313,000316: 037314,000317: # QMAX PREDICTED MAXIMUM ENTRY ACCEL 163.84 GS N 60 037315,000318: # VPRED PREDICTED VELOCITY AT ALTITUDE 128 M/CENTISEC N 60 037316,000319: # 400K FT ABOVE FISCHER RADIUS. 037317,000320: # GAMMAEI PREDICTED GAMMA AT ALTITUDE 1 REVOLUTION N 60 037318,000321: # 400K FT ABOVE FISCHER RADIUS. 037319,000322: # D DRAG ACCELERATION 805 FPSS N 64 037320,000323: # VMAGI INERTIAL VELOCITY MAGNITUDE 128 M/CENTISEC N 64, N 68 037321,000324: # THETAH DESIRED RANGE ANGLE NM 1 REVOLUTION N 64, N 67 037322,000325: # LAT PRESENT LATITUDE 1 REVOLUTION N 67 037323,000326: # LONG PRESENT LONGITUDE 1 REVOLUTION N 67 037324,000327: # RTOGO RANGE ANGLE TO SPLASH FROM 1 REVOLUTION N 63 037325,000328: # EMSALT FT ABOVE FISCHER RADIUS. (IN NM) 037326,000329: # VIO PREDICTED VELOCITY AT ALTITUDE 128 M/CENTISEC N 63 037327,000330: # EMSALT FT ABOVE FISCHER RADIUS. 037328,000331: # TTE TIME OF FREE FALL TO ALT B 28 CENTISEC N 63 037329,000332: # EMSALT FT ABOVE FISCHER RADIUS. 037330,000333: # ROLLC ROLL COMMAND 1 REVOLUTION N 66, N 68, N 69 037331,000334: # LATANG CROSS-RANGE ERROR (XRNGERR) 4 RADIANS N 66 037332,000335: # DNRNGERR DOWN RANGE ERROR 1 REVOLUTION N 66 037333,000336: # (PREDANG - THETAH IN NM) 037334,000337: # HDOT ALTITUDE RATE 128 M/CENTISEC N 68 037335,000338: # Q7 MINIMUM DRAG FOR UPCONTROL 805 FPSS N 69 037336,000339: # VL EXIT VELOCITY FOR UP-CONTROL 2 VSAT N 69 037337,000340:
Page 843 |
037339,000342: # BODY ATTITUDE QUANTITIES (CM/POSE) 037340,000343: # ----------------------------------- 037341,000344: 037342,000345: # VARIABLE DESCRIPTION MAXIMUM VALUE 037343,000346: # -------- ----------- ------- ----- 037344,000347: # - 037345,000348: # -VREL NEGATIVE VELOCITY REL TO ATMOS. 2 VSAT 037346,000349: # - 037347,000350: # OLDUYA USED FOR UYA BELOW 1000 FPS 2 037348,000351: # - 037349,000352: # UXA/2 UNIT VECTOR TRIAD 2 037350,000353: # - 037351,000354: # UYA/2 BASED ON 2 037352,000355: # - 037353,000356: # UZA/2 THE TRAJECTORY. 2 037354,000357: # - 037355,000358: # UBX/2 UNIT VECTOR 2 037356,000359: # - 037357,000360: # UBY/2 BODY TRIAD 2 037358,000361: # - 037359,000362: # UBZ/2 FOR CM. 2 037360,000363: End of include-file ENTRY_LEXICON.agc. Parent file is MAIN.agc