Source Code
These source-code files are part of a reconstructed copy of Comanche 72/3 (AKA Manche72 revision 3),
the final, flown mission release of the Apollo Guidance Computer (AGC) Command Module (CM) software
for Apollo 13.
The starting point was the source code of Comanche 72 (itself previously reconstructed). Comanche 72 source code was then modified by incorporating changes known from contemporary documentation to have been made between revisions 72 and 72/3. The resulting code assembles to have identical memory-bank checksums as those specified in NASA drawing 2021153G; this gives reasonably high confidence that the changes that have been made are correct. In places where ambiguity exists, this ambiguity is discussed in "## Reconstruction:" comments. Since no contemporary listings of Comanche 72/3 are available as source material, all comments and labels are approximate. They have been taken from other AGC programs where possible, or, in some places, written from scratch to match what we believe would have been in the original listing. |
035946,000002: ## Copyright: Public domain.
035947,000003: ## Filename: ENTRY_LEXICON.agc
035948,000004: ## Purpose: A section of Manche72 revision 3.
035949,000005: ## It is part of the reconstructed source code for the final, flown
035950,000006: ## release of the software for the Command Module's (CM) Apollo
035951,000007: ## Guidance Computer (AGC) for Apollo 13. No original listings
035952,000008: ## of this program are available; instead, this file was recreated
035953,000009: ## from a reconstructed copy of Comanche 072. It has been adapted
035954,000010: ## such that the resulting bugger words exactly match those
035955,000011: ## specified for Manche72 revision 3 in NASA drawing 2021153G,
035956,000012: ## which gives relatively high confidence that the reconstruction
035957,000013: ## is correct.
035958,000014: ## Assembler: yaYUL
035959,000015: ## Contact: Ron Burkey <info@sandroid.org>.
035960,000016: ## Website: www.ibiblio.org/apollo/index.html
035961,000017: ## Mod history: 2024-05-19 MAS Created from Comanche 072.
035962,000018:
035963,000019: # VARIABLE DESCRIPTION MAXIMUM VALUE * COMPUTER NAME
035964,000020: # -------- ----------- ------- ----- -------- ----
035965,000021: # -
035966,000022: # URT0 INITIAL TARGET VECTOR 2 (UNIT VECTOR) = RTINIT
035967,000023: # -
035968,000024: # UZ UNIT VECTOR NORTH 1 = UNITW
035969,000025: # -
035970,000026: # V VELOCITY VECTOR 2 VSAT = VEL
035971,000027: # -
035972,000028: # R POSITION VECTOR 2 EXP 29 METERS = RN
035973,000029: # -
035974,000030: # VI INERTIAL VELOCITY 128 M/CENTISEC = VN
035975,000031: # -
035976,000032: # RTE VECTOR EAST AT INITIAL TARGET 2 = RTEAST
035977,000033: # -
035978,000034: # UTR NORMAL TO RTE AND UZ 2 = RTNORM
035979,000035: # -
035980,000036: # URT TARGET VECTOR 2 = RT
035981,000037: # -
035982,000038: # UNI UNIT NORMAL TO TRAJECTORY PLANE 2
035983,000039: # -
035984,000040: # DELV INTEGRATED ACCEL. FROM PIPAS 5.85 16384 CM/S
035985,000041: # -
035986,000042: # G GRAVITY VECTOR 128 M/CENTISEC = GDT/2
035987,000043:
035988,000044: # A0 INITIAL DRAG FOR UPCONTRL 805 FPSS FPSS=FT/SEC/SEC
035989,000045:
035990,000046: # AHOOKDV TERM IN GAMMAL CALC. = AHOOK DVL 16
035991,000047:
035992,000048: # A1 DRAG VALUE IN FACTOR CALCULATION 805 FPSS
035993,000049:
035994,000050: # ALP CONST FOR UPCONTRL 1
035995,000051:
035996,000052: # ASKEP KEPLER RANGE 21600 NM NM = NAUTICAL MILE
035997,000053:
035998,000054: # ASP1 FINAL PHASE RANGE 21600 NM
035999,000055:
036000,000056: # ASPUP UP-RANGE 21600 NM
036001,000057:
036002,000058: # ASP3 GAMMA CORRECTION 21600 NM
036003,000059:
036004,000060: # ASPDWN RANGE DOWN TO PULL-UP 21600 NM
036005,000061:
036006,000062: # ASP PREDICTED RANGE 21600 NM NOT STORED
036007,000063:
036008,000064: # COSG COSINE(GAMMAL) 2 = COSG/2
036009,000065:
036010,000066: # C/D0 RECIPROCAL DRAG, -4/D0 B-8 64/FPSS
036011,000067:
036012,000068: # D TOTAL ACCELERATION 805 FPSS
036013,000069:
036014,000070: # D0 CONTROLLED CONSTANT D 805 FPSS
036015,000071:
036016,000072: # DHOOK TERM IN GAMMAL COMPUTATION 805 FPSS
036017,000073:
036018,000074: # DIFF THETNM-ASP (RANGE DIFFERENCE) 21600 NM
036019,000075:
036020,000076: # DIFFOLD PREVIOUS VALUE OF DIFF 21600 NM
036021,000077:
036022,000078: # DLEWD CHANGE IN LEWD 1
036023,000079:
036024,000080: # DR REFERENCE DRAG FOR DOWNCONTROL 805 FPSS NOT STORED
036025,000081:
036026,000082: # DREFR REFERENCE DRAG 805 FPSS NOT STORED
036027,000083:
036028,000084: # DVL VS1-VL 2 VSAT
036029,000085:
036030,000086: # E ECCENTRICITY 4 NOT STORED
036031,000087:
036032,000088: # F1 DRANGE/D DRAG (FINAL PHASE) 2700/805 = FX +5
036033,000089:
036034,000090: # F2 DRANGE/D RDOT (FINAL PHASE) 2700/2VS NM/FPS = FX +4
036035,000091:
036036,000092: # F3 DRANGE/D (L/D) 2700 NM = FX
036037,000093:
036038,000094: # FACT1 CONST FOR UPCONTRL 805 FPSS
036039,000095:
036040,000096: # FACT2 CONST FOR UPCONTRL 1/805 FPSS
036041,000097:
036042,000098: # FACTOR USED IN UPCONTRL 1 * MAXIMUM VALUE DENOTES UNSCALED
036043,000099: #
036044,000100: # GAMMAL FLIGHT PATH ANGLE AT VL 1 RADIAN VARIABLE VALUE WHEN SCALED
036045,000101:
036046,000102: # GAMMAL1 SIMPLE FORM OF GAMMAL 1 RADIAN VARIABLE HAS MAXIMUM VALUE OF ONE.
036047,000103:
036048,000104: # VARIABLE DESCRIPTION MAXIMUM VALUE COMPUTER NAME
036049,000105: # -------- ----------- ------- ----- -------- ----
036050,000106:
036051,000107: # HEADSUP INDICATOR FOR INITIAL ROLL 1
036052,000108:
036053,000109: # KA DRAG TO LIFT UP IF DOWN 805 FPSS = KAT
036054,000110:
036055,000111: # KLAT LATERAL SWITCH GAIN 1 (NOM = .0125)
036056,000112:
036057,000113: # K2ROLL INDICATOR FOR ROLL SWITCH
036058,000114:
036059,000115: # LAD MAX L/D (MIN ACTUAL VEHICLE L/D) 1
036060,000116:
036061,000117: # LADPAD NOMINAL VEHICLE L/D, SP PAD LOAD 1 (NOM = 0.3)
036062,000118:
036063,000119: # LATANG LATERAL RANGE 4 RADIANS
036064,000120:
036065,000121: # LEQ EXCESS C.F. OVER GRAV=(VSQ-1)GS 128.8 FPSS
036066,000122:
036067,000123: # LEWD UPCONTROL REFERENCE L/D 1
036068,000124:
036069,000125: # LOD FINAL PHASE L/D 1 (NOM = 0.18)
036070,000126:
036071,000127: # LODPAD FINAL PHASE L/D, SP PAD LOAD 1
036072,000128:
036073,000129: # L/D DESIRED LIFT TO DRAG RATIO 1
036074,000130: # (VERTICAL PLANE)
036075,000131: #
036076,000132: # L/D1 TEMP STORAGE FOR L/D IN LATERAL 1
036077,000133:
036078,000134: # L/DCMINR LAD COS(15DEG) 1 (NOM = 0.2895)
036079,000135:
036080,000136: # PREDANGL PREDICTED RANGE (FINAL PHASE) 2700 NM = PREDANG
036081,000137:
036082,000138: # Q2 FINAL PHASE RANGE -23500 Q3 21600 NM
036083,000139: # Q2 = FCN(LAD)
036084,000140:
036085,000141: # Q7 MINIMUM DRAG FOR UPCONTROL 805FPSS
036086,000142:
036087,000143: # RDOT ALTITUDE RATE 2 VSAT
036088,000144:
036089,000145: # RDOTREF REFERENCE RDOT FOR UPCONTROL 2 VSAT
036090,000146:
036091,000147: # RDTR REFERENCE RDOT FOR DOWNCONT 2 VSAT NOT SAVED
036092,000148:
036093,000149: # ROLLC ROLL COMMAND 1 REVOLUTION
036094,000150:
036095,000151: # RTOGO RANGE TO GO (FINAL PHASE) 2700 NM = FX +2
036096,000152:
036097,000153: # SL SINE OF LATITUDE 1 NOT SAVED
036098,000154:
036099,000155: # T TIME B 28 CENTISEC = TIME2,TIME1
036100,000156:
036101,000157: # THETA DESIRED RANGE (RADIANS) 2 PI RADIANS = THETAH
036102,000158:
036103,000159: # THETNM DESIRED RANGE (NM) 21600 NM NON EXISTENT
036104,000160:
036105,000161: # V VELOCITY MAGNITUDE 2 VSAT
036106,000162: #
036107,000163: # V1 INITIAL VELOCITY FOR UPCONTROL 2 VSAT
036108,000164:
036109,000165: # VL EXIT VELOCITY FOR UPCONTROL 2 VSAT
036110,000166:
036111,000167: # VREF REFERENCE VELOCITY FOR UPCONTROL 2 VSAT
036112,000168:
036113,000169: # VS1 VSAT OR V1, WHICHEVER IS SMALLER 2 VSAT
036114,000170: # 2 2
036115,000171: # VBARS VL /VSAT 4
036116,000172: # 2 2
036117,000173: # VSQ NORMALISED VEL. SQUARED = V /VSAT 4 = VSQUARE
036118,000174:
036119,000175: # WT EARTH RATE TIMES TIME 1 REVOLUTION NOT SAVED
036120,000176: # = WIE (DTEAROT)
036121,000177: # X INTERMEDIATE VARIABLE IN G-LIMITER 2 VSAT NOT SAVED
036122,000178:
036123,000179: # Y LATERAL MISS LIMIT 4 RADIANS NOT SAVED
036124,000180:
036125,000181: # EXTRA COMPUTER ERASABLE LOCATIONS NOT SHOWN ON FLOW CHARTS
036126,000182: # -----------------------------------------------------------
036127,000183:
036128,000184: # VARIABLE DESCRIPTION MAXIMUM VALUE
036129,000185: # -------- ----------- ------- -----
036130,000186:
036131,000187: # GOTOADDR ADDRESS SELECTED BY SEQUENCER
036132,000188:
036133,000189: # XPIPBUF BUFFER TO STORE X PIPA COUNTS
036134,000190:
036135,000191: # YPIPBUF BUFFER TO STORE Y PIPA COUNTS
036136,000192:
036137,000193: # ZPIPBUF BUFFER TO STORE Z PIPA COUNTS
036138,000194:
036139,000195: # PIPCTR COUNTS PASSES THRU PIPA READ ROUTINE
036140,000196:
036141,000197: # JJ INDEX IN FINAL PHASE TABLE LOOK-UP
036142,000198:
036143,000199: # MM INDEX IN FINAL PHASE TABLE LOOK-UP
036144,000200:
036145,000201: # GRAD INTERPOLATION FACTOR IN FINAL PHASE
036146,000202:
036147,000203: # FX DRANGE/D L/D = F3 2700 NM
036148,000204:
036149,000205: # FX +1 AREF 805 FPSS
036150,000206:
036151,000207: # FX +2 RTOGO 2700 NM
036152,000208:
036153,000209: # FX +3 RDOTREF VSAT/4
036154,000210:
036155,000211: # FX +4 DRANGE/D RDOT = F2 21600/2VS NM/FPS
036156,000212:
036157,000213: # FX +5 DRANGE/D DRAG = F1 2700/805 NM/FPSS
036158,000214:
036159,000215: # TEM1B TEMPORARY LOCATION
036160,000216:
036161,000217: # TIME/RTO TIME OF INITIAL TARGET RTINIT B 28 CENTISEC
036162,000218:
036163,000219: # DTEAROT EST TIME BETWEEN RTINIT AND RT B 28 CENTISEC
036164,000220: # -
036165,000221: # UNITV UNIT V VECTOR 2
036166,000222: # -
036167,000223: # UNITR UNIT R VECTOR 2
036168,000224: # -
036169,000225: # -VREL NEGATIVE VELOCITY REL TO ATMOSP 2 VSAT
036170,000226:
036171,000227: # COMPUTER SWITCHES INITIAL STATE CM/FLAGS = STATE +6
036172,000228: # -------- -------- ------------- -------------------
036173,000229:
036174,000230: # ENTRYDSP DO ENTRY DISPLAY, IF SET NON-BRANCH (1) 92D, BIT 13
036175,000231: # GONEPAST INDICATES OVERSHOOT OF TARGET NON-BRANCH (0) 95D, BIT 10
036176,000232: # RELVELSW RELATIVE VELOCITY SWITCH NON-BRANCH (0) 96D, BIT 9
036177,000233: # EGSW FINAL PHASE SWITCH NON-BRANCH (0) 97D, BIT 8
036178,000234: # FIRSTPAS INITIAL PASS THRU HUNTEST NON-BRANCH (0) 98D, BIT 7
036179,000235: # HIND INDICATES ITERATION IN HUNTEST NON-BRANCH (0) 99D, BIT 6
036180,000236: # INRLSW INDICATES INIT ROLL ATTITUDE SET NON-BRANCH (0) 100D, BIT 5
036181,000237: # LATSW INHIBIT DOWNLIFT SWITCH IF NOT SET BRANCH (1) 101D, BIT 4
036182,000238: # .05GSW INDICATES DRAG EXCEEDS .05 GS BRANCH (0) 102D, BIT 3
036183,000239:
036184,000240: # GONEBY INDICATES GONE PAST TARGET (SET) SELF-INITIALZNG 112D, BIT 8
036185,000241:
036186,000242: # CONSTANTS AND GAINS VALUE
036187,000243: # ------------------- -----
036188,000244:
036189,000245: # C1 FACTOR IN ALP COMPUTATION 1.25
036190,000246: # C16 CONSTD GAIN ON DRAG .01
036191,000247: # C17 CONSTD GAIN ON RDOT .001
036192,000248: # C18 BIAS VEL. FOR FINAL PHASE START 500 FPS
036193,000249: # C20 MAX DRAG FOR DOWN-LIFT 175 FPSS
036194,000250: # CHOOK FACTOR IN AHOOK COMPUTATION .25
036195,000251: # CH1 FACTOR IN GAMMAL COMPUTATION 1.0
036196,000252: # COS15 COS( 15 DEG ) .965
036197,000253: # DLEWD0 INITIAL VARIATION IN LEWD -.05
036198,000254: # D2 DRAG TO CHANGE LEWD 175 FPSS
036199,000255: # DT COMPUTATION CYCLE TIME INTERVAL 2 SEC.
036200,000256: # GMAX MAXIMUM ACCELERATION 257.6 FPSS (8 G-S)
036201,000257: # KA1 FACTOR IN KA CALC 1.3 GS
036202,000258: # KA2 FACTOR IN KA CALC .2 GS
036203,000259: # KA3 FACTOR IN D0 CALC 90 FPSS
036204,000260: # KA4 FACTOR IN D0 CALC 40 FPSS
036205,000261: # KB1 OPTIMIZED UPCONTROL GAIN 3.4
036206,000262: # KB2 OPTIMIZED UPCONTROL GAIN .0034
036207,000263: # KDMIN INCREMENT ON Q7 TO DETECT END OF KEPLER PHASE .5 FPSS
036208,000264: # KTETA TIME OF FLIGHT CONSTANT 1000
036209,000265: # KLAT1 FACTOR IN KLAT CALC 1/24
036210,000266: # K44 GAIN USED IN INITIAL ROLL SECTION 19749550 FPS
036211,000267: # LATBIAS LATERAL SWITCH BIAS TERM .41252961 NM
036212,000268: # LEWD1 NOMINAL UPCONTROL L/D .15
036213,000269: # POINT1 FACTOR TO REDUCE UPCONTROL GAIN .1
036214,000270: # Q2 FINAL PHASE RANGE - 23500 Q3 -1002 NM
036215,000271: # Q3 FINAL PHASE DRANGE/D V .07 NM/FPS
036216,000272: # Q5 FINAL PHASE DRANGE/D GAMMA 7050 NM/RAD
036217,000273: # Q6 FINAL PHASE INITIAL FLIGHT PATH ANGLE .0349 RAD
036218,000274: # Q7F MIN DRAG FOR UPCONTROL 6 FPSS
036219,000275: # Q7MIN MIN VALUE FOR Q7 IN FACTOR CALCULATION 40 FPSS
036220,000276: # Q19 FACTOR IN GAMMAL1 CALCULATION .5
036221,000277: # Q21 FACTOR IN Q2 CALCULATION. 1000 NM
036222,000278: # Q22 FACTOR IN Q2 CALCULATION. -1302 NM
036223,000279: # VFINAL1 VELOCITY TO START FINAL PHASE ON INITIAL ENTRY 27000 FPS
036224,000280: # VFINAL FACTOR IN INITIAL UP-DOWN CALC 26600 FPS
036225,000281: # VLMIN MINIMUM VL 18000 FPS
036226,000282: # VMIN VELOCITY TO SWITCH TO RELATIVE VEL VSAT/2
036227,000283: # VRCONTRL RDOT TO START INTO HUNTEST 700 FPS
036228,000284: # VRCONT=COMPUTER NAME
036229,000285: # 25NM TOLERANCE TO STOP RANGE ITERATION 25 NM
036230,000286: # VQUIT VELOCITY TO STOP STEERING 1000 FPS
036231,000287:
036232,000288: # CONVERSION FACTORS AND SCALING CONSTANTS
036233,000289: # ---------- ------- --- ------- ---------
036234,000290:
036235,000291: # ATK ANGLE IN RAD TO NM 3437.7468 NM/RAD
036236,000292: # GS NOMINAL G VALUE FOR SCALING 32.2 FPSS
036237,000293: # HS ATMOSPHERE SCALE HEIGHT 28500 FT
036238,000294: # J GRAVITY HARMONIC COEFFICIENT .00162346
036239,000295: # KWE EQUATORIAL EARTH RATE 1546.70168 FPS
036240,000296: # MUE EARTH GRAVITATIONAL CONSTANT 3.986032233 E14 CUBIC M/ SEC SEC
036241,000297: # RE EARTH RADIUS 21202900 FT
036242,000298: # REQ EARTH EQUATORIAL RADIUS 20925738.2 FT
036243,000299: # VSAT SATELLITE VELOCITY AT RE 25766.1973 FPS
036244,000300: # WIE EARTH RATE .0000729211505 RAD/SEC
036245,000301:
036246,000302: # (END GSOP AS-278, VOL 1, FIG. 5.6-3 CONSTANTS, GAINS, ETC.)
036247,000303:
036248,000304: # DISPLAY QUANTITIES
036249,000305: # ------------------
036250,000306:
036251,000307: # (SEE SECTION 4 OF THE GSOP FOR SIGN CONVENTIONS.)
036252,000308:
036253,000309: # VARIABLE DESCRIPTION MAXIMUM VALUE
036254,000310: # -------- ----------- ------- -----
036255,000311:
036256,000312: # QMAX PREDICTED MAXIMUM ENTRY ACCEL 163.84 GS N 60
036257,000313: # VPRED PREDICTED VELOCITY AT ALTITUDE 128 M/CENTISEC N 60
036258,000314: # 400K FT ABOVE FISCHER RADIUS.
036259,000315: # GAMMAEI PREDICTED GAMMA AT ALTITUDE 1 REVOLUTION N 60
036260,000316: # 400K FT ABOVE FISCHER RADIUS.
036261,000317: # D DRAG ACCELERATION 805 FPSS N 64
036262,000318: # VMAGI INERTIAL VELOCITY MAGNITUDE 128 M/CENTISEC N 64, N 68
036263,000319: # THETAH DESIRED RANGE ANGLE NM 1 REVOLUTION N 64, N 67
036264,000320: # LAT PRESENT LATITUDE 1 REVOLUTION N 67
036265,000321: # LONG PRESENT LONGITUDE 1 REVOLUTION N 67
036266,000322: # RTOGO RANGE ANGLE TO SPLASH FROM 1 REVOLUTION N 63
036267,000323: # EMSALT FT ABOVE FISCHER RADIUS. (IN NM)
036268,000324: # VIO PREDICTED VELOCITY AT ALTITUDE 128 M/CENTISEC N 63
036269,000325: # EMSALT FT ABOVE FISCHER RADIUS.
036270,000326: # TTE TIME OF FREE FALL TO ALT B 28 CENTISEC N 63
036271,000327: # EMSALT FT ABOVE FISCHER RADIUS.
036272,000328: # ROLLC ROLL COMMAND 1 REVOLUTION N 66, N 68, N 69
036273,000329: # LATANG CROSS-RANGE ERROR (XRNGERR) 4 RADIANS N 66
036274,000330: # DNRNGERR DOWN RANGE ERROR 1 REVOLUTION N 66
036275,000331: # (PREDANG - THETAH IN NM)
036276,000332: # HDOT ALTITUDE RATE 128 M/CENTISEC N 68
036277,000333: # Q7 MINIMUM DRAG FOR UPCONTROL 805 FPSS N 69
036278,000334: # VL EXIT VELOCITY FOR UP-CONTROL 2 VSAT N 69
036279,000335:
036280,000336: # BODY ATTITUDE QUANTITIES (CM/POSE)
036281,000337: # -----------------------------------
036282,000338:
036283,000339: # VARIABLE DESCRIPTION MAXIMUM VALUE
036284,000340: # -------- ----------- ------- -----
036285,000341: # -
036286,000342: # -VREL NEGATIVE VELOCITY REL TO ATMOS. 2 VSAT
036287,000343: # -
036288,000344: # OLDUYA USED FOR UYA BELOW 1000 FPS 2
036289,000345: # -
036290,000346: # UXA/2 UNIT VECTOR TRIAD 2
036291,000347: # -
036292,000348: # UYA/2 BASED ON 2
036293,000349: # -
036294,000350: # UZA/2 THE TRAJECTORY. 2
036295,000351: # -
036296,000352: # UBX/2 UNIT VECTOR 2
036297,000353: # -
036298,000354: # UBY/2 BODY TRIAD 2
036299,000355: # -
036300,000356: # UBZ/2 FOR CM. 2
036301,000357:
End of include-file ENTRY_LEXICON.agc. Parent file is MAIN.agc