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