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