Source Code
This is the source-code for the Apollo 9 Command Module's Guidance Computer.
These files were derived originally from the scan from MIT's Dibner Institute's
now-discontinued website titled "History of Recent Science and Technology", which
in turn was originally created by Gary Neff, though his high-quality scans were
unfortunately reduced in legibility when presented online.
The markings on the front of the
printout imply that it was the original AGC developer Norm Brodeur's copy.
A scan by Ron Burkey has superceded it, made from a more-legible copy from the collection of original
AGC developer Fred Martin. The source code was transcribed from
those images by Ron Burkey. Note that the page images
presented online are of reduced quality, and that higher-quality images
are available. Report any conversion errors or legibility
problems in page images to info@sandroid.org.
Notations on the program listing read, in part:ASSEMBLE REVISION 249 OF AGC PROGRAM COLOSSUS BY NASA 2021111-041 20'35 OCT. 28,1968Note that the date is the date of the printout, not the date of the program revision. |
035343,000002: ## Copyright: Public domain.
035344,000003: ## Filename: ENTRY_LEXICON.agc
035345,000004: ## Purpose: Part of the source code for Colossus, build 249.
035346,000005: ## It is part of the source code for the Command Module's (CM)
035347,000006: ## Apollo Guidance Computer (AGC), for Apollo 9.
035348,000007: ## Assembler: yaYUL
035349,000008: ## Reference: pp. 791-797.
035350,000009: ## Contact: Ron Burkey <info@sandroid.org>.
035351,000010: ## Website: www.ibiblio.org/apollo.
035352,000011: ## Mod history: 08/19/04 RSB. Transcribed .
035353,000012: ## 2017-01-06 RSB Page numbers now agree with those on the
035354,000013: ## original harcopy, as opposed to the PDF page
035355,000014: ## numbers in 1701.pdf.
035356,000015: ## 2017-01-07 RSB Cross-diff'd comment text (not whitespace)
035357,000016: ## vs the already-proofed corresponding Colossus
035358,000017: ## 237 and Comanche 55 source-code files
035359,000018: ## and corrected errors found.
035360,000019: ## 2017-01-22 RSB Back-ported comment error fixes detected in diff'ing
035361,000020: ## Artemis 72 vs Comanche 55.
035362,000021: ##
035363,000022: ## The contents of the "Colossus249" files, in general, are transcribed
035364,000023: ## from a scanned copy of the program listing. Notations on this
035365,000024: ## document read, in part:
035366,000025: ##
035367,000026: ## Assemble revision 249 of AGC program Colossus by NASA
035368,000027: ## 2021111-041. October 28, 1968.
035369,000028: ##
035370,000029: ## This AGC program shall also be referred to as
035371,000030: ## Colossus 1A
035372,000031: ##
035373,000032: ## Prepared by
035374,000033: ## Massachusetts Institute of Technology
035375,000034: ## 75 Cambridge Parkway
035376,000035: ## Cambridge, Massachusetts
035377,000036: ## under NASA contract NAS 9-4065.
035378,000037: ##
035379,000038: ## Refer directly to the online document mentioned above for further information.
035380,000039: ## Please report any errors (relative to the scanned pages) to info@sandroid.org.
035381,000040: ##
035382,000041: ## In some cases, where the source code for Luminary 131 overlaps that of
035383,000042: ## Colossus 249, this code is instead copied from the corresponding Luminary 131
035384,000043: ## source file, and then is proofed to incorporate any changes.
035385,000044:
Page 791 |
035387,000046: # VARIABLE DESCRIPTION MAXIMUM VALUE * COMPUTER NAME
035388,000047: # -------- ----------- ------- ----- -------- ----
035389,000048: # -
035390,000049: # URT0 INITIAL TARGET VECTOR 2 (UNIT VECTOR) = RTINIT
035391,000050: # -
035392,000051: # UZ UNIT VECTOR NORTH 1 = UNITW
035393,000052: # -
035394,000053: # V VELOCITY VECTOR 2 VSAT = VEL
035395,000054: # -
035396,000055: # R POSITION VECTOR 2 EXP 29 METERS = RN
035397,000056: # -
035398,000057: # VI INERTIAL VELOCITY 128 M/CENTISEC = VN
035399,000058: # -
035400,000059: # RTE VECTOR EAST AT INITIAL TARGET 2 = RTEAST
035401,000060: # -
035402,000061: # UTR NORMAL TO RTE AND UZ 2 = RTNORM
035403,000062: # -
035404,000063: # URT TARGET VECTOR 2 = RT
035405,000064: # -
035406,000065: # UNI UNIT NORMAL TO TRAJECTORY PLANE 2
035407,000066: # -
035408,000067: # DELV INTEGRATED ACCEL. FROM PIPAS 5.85 16384 CM/S
035409,000068: # -
035410,000069: # G GRAVITY VECTOR 128 M/CENTISEC = GDT/2
035411,000070:
035412,000071: # A0 INITIAL DRAG FOR UPCONTRL 805 FPSS FPSS=FT/SEC/SEC
035413,000072:
035414,000073: # AHOOKDV TERM IN GAMMAL CALC. = AHOOK DVL 16
035415,000074:
035416,000075: # A1 DRAG VALUE IN FACTOR CALCULATION 805 FPSS
035417,000076:
035418,000077: # ALP CONST FOR UPCONTRL 1
035419,000078:
035420,000079: # ASKEP KEPLER RANGE 21600 NM NM = NAUTICAL MILE
035421,000080:
035422,000081: # ASP1 FINAL PHASE RANGE 21600 NM
035423,000082:
035424,000083: # ASPUP UP-RANGE 21600 NM
035425,000084:
035426,000085: # ASP3 GAMMA CORRECTION 21600 NM
035427,000086:
035428,000087: # ASPDWN RANGE DOWN TO PULL-UP 21600 NM
035429,000088:
035430,000089: # ASP PREDICTED RANGE 21600 NM NOT STORED
035431,000090:
035432,000091: # COSG COSINE(GAMMAL) 2 = COSG/2
035433,000092:
035434,000093: # C/D0 RECIPROCAL DRAG, -4/D0 B-8 64/FPSS
035435,000094:
035436,000095: # D TOTAL ACCELERATION 805 FPSS
035437,000096:
035438,000097: # D0 CONTROLLED CONSTANT D 805 FPSS
035439,000098:
035440,000099: # DHOOK TERM IN GAMMAL COMPUTATION 805 FPSS
035441,000100:
035442,000101: # DIFF THETNM-ASP (RANGE DIFFERENCE) 21600 NM
035443,000102:
035444,000103: # DIFFOLD PREVIOUS VALUE OF DIFF 21600 NM
035445,000104:
035446,000105: # DLEWD CHANGE IN LEWD 1
035447,000106:
035448,000107: # DR REFERENCE DRAG FOR DOWNCONTROL 805 FPSS NOT STORED
035449,000108:
035450,000109: # DREFR REFERENCE DRAG 805 FPSS NOT STORED
035451,000110:
035452,000111: # DVL VS1-VL 2 VSAT
035453,000112:
035454,000113: # E ECCENTRICITY 4 NOT STORED
035455,000114:
035456,000115: # F1 DRANGE/D DRAG (FINAL PHASE) 2700/805 = FX +5
035457,000116:
035458,000117: # F2 DRANGE/D RDOT (FINAL PHASE) 2700/2VS NM/FPS = FX +4
Page 792 |
035460,000119:
035461,000120: # F3 DRANGE/D (L/D) 2700 NM = FX
035462,000121:
035463,000122: # FACT1 CONST FOR UPCONTRL 805 FPSS
035464,000123:
035465,000124: # FACT2 CONST FOR UPCONTRL 1/805 FPSS
035466,000125:
035467,000126: # FACTOR USED IN UPCONTRL 1 * MAXIMUM VALUE DENOTES UNSCALED
035468,000127: #
035469,000128: # GAMMAL FLIGHT PATH ANGLE AT VL 1 RADIAN VARIABLE VALUE WHEN SCALED
035470,000129:
035471,000130: # GAMMAL1 SIMPLE FORM OF GAMMAL 1 RADIAN VARIABLE HAS MAXIMUM VALUE OF ONE.
Page 793 |
035473,000132: # VARIABLE DESCRIPTION MAXIMUM VALUE COMPUTER NAME
035474,000133: # -------- ----------- ------- ----- -------- ----
035475,000134:
035476,000135: # HEADSUP INDICATOR FOR INITIAL ROLL 1
035477,000136:
035478,000137: # KA DRAG TO LIFT UP IF DOWN 805 FPSS = KAT
035479,000138:
035480,000139: # KLAT LATERAL SWITCH GAIN 1 (NOM = .0125)
035481,000140:
035482,000141: # K2ROLL INDICATOR FOR ROLL SWITCH
035483,000142:
035484,000143: # LAD MAX L/D (MIN ACTUAL VEHICLE L/D) 1
035485,000144:
035486,000145: # LADPAD NOMINAL VEHICLE L/D, SP PAD LOAD 1 (NOM = 0.3)
035487,000146:
035488,000147: # LATANG LATERAL RANGE 4 RADIANS
035489,000148:
035490,000149: # LEQ EXCESS C.F. OVER GRAV=(VSQ-1)GS 128.8 FPSS
035491,000150:
035492,000151: # LEWD UPCONTROL REFERENCE L/D 1
035493,000152:
035494,000153: # LOD FINAL PHASE L/D 1 (NOM = 0.18)
035495,000154:
035496,000155: # LODPAD FINAL PHASE L/D, SP PAD LOAD 1
035497,000156:
035498,000157: # L/D DESIRED LIFT TO DRAG RATIO 1
035499,000158: # (VERTICAL PLANE)
035500,000159: #
035501,000160: # L/D1 TEMP STORAGE FOR L/D IN LATERAL 1
035502,000161:
035503,000162: # L/DCMINR LAD COS(15DEG) 1 (NOM = 0.2895)
035504,000163:
035505,000164: # PREDANGL PREDICTED RANGE (FINAL PHASE) 2700 NM = PREDANG
035506,000165:
035507,000166: # Q2 FINAL PHASE RANGE -23500 Q3 21600 NM
035508,000167: # Q2 = FCN(LAD)
035509,000168:
035510,000169: # Q7 MINIMUM DRAG FOR UPCONTROL 805FPSS
035511,000170:
035512,000171: # RDOT ALTITUDE RATE 2 VSAT
035513,000172:
035514,000173: # RDOTREF REFERENCE RDOT FOR UPCONTROL 2 VSAT
035515,000174:
035516,000175: # RDTR REFERENCE RDOT FOR DOWNCONT 2 VSAT NOT SAVED
035517,000176:
035518,000177: # ROLLC ROLL COMMAND 1 REVOLUTION
035519,000178:
035520,000179: # RTOGO RANGE TO GO (FINAL PHASE) 2700 NM = FX +2
035521,000180:
035522,000181: # SL SINE OF LATITUDE 1 NOT SAVED
035523,000182:
035524,000183: # T TIME B 28 CENTISEC = TIME2,TIME1
035525,000184:
035526,000185: # THETA DESIRED RANGE (RADIANS) 2 PI RADIANS = THETAH
035527,000186:
035528,000187: # THETNM DESIRED RANGE (NM) 21600 NM NON EXISTENT
035529,000188:
035530,000189: # V VELOCITY MAGNITUDE 2 VSAT
035531,000190: #
035532,000191: # V1 INITIAL VELOCITY FOR UPCONTROL 2 VSAT
035533,000192:
035534,000193: # VL EXIT VELOCITY FOR UPCONTROL 2 VSAT
035535,000194:
035536,000195: # VREF REFERENCE VELOCITY FOR UPCONTROL 2 VSAT
035537,000196:
035538,000197: # VS1 VSAT OR V1, WHICHEVER IS SMALLER 2 VSAT
035539,000198: # 2 2
035540,000199: # VBARS VL /VSAT 4
035541,000200: # 2 2
035542,000201: # VSQ NORMALISED VEL. SQUARED = V /VSAT 4 = VSQUARE
035543,000202:
035544,000203: # WT EARTH RATE TIMES TIME 1 REVOLUTION NOT SAVED
035545,000204: # = WIE (DTEAROT)
035546,000205: # X INTERMEDIATE VARIABLE IN G-LIMITER 2 VSAT NOT SAVED
035547,000206:
035548,000207: # Y LATERAL MISS LIMIT 4 RADIANS NOT SAVED
035549,000208:
Page 794 |
035551,000210: # EXTRA COMPUTER ERASABLE LOCATIONS NOT SHOWN ON FLOW CHARTS
035552,000211: # -----------------------------------------------------------
035553,000212:
035554,000213: # VARIABLE DESCRIPTION MAXIMUM VALUE
035555,000214: # -------- ----------- ------- -----
035556,000215:
035557,000216: # GOTOADDR ADDRESS SELECTED BY SEQUENCER
035558,000217:
035559,000218: # XPIPBUF BUFFER TO STORE X PIPA COUNTS
035560,000219:
035561,000220: # YPIPBUF BUFFER TO STORE Y PIPA COUNTS
035562,000221:
035563,000222: # ZPIPBUF BUFFER TO STORE Z PIPA COUNTS
035564,000223:
035565,000224: # PIPCTR COUNTS PASSES THRU PIPA READ ROUTINE
035566,000225:
035567,000226: # JJ INDEX IN FINAL PHASE TABLE LOOK-UP
035568,000227:
035569,000228: # MM INDEX IN FINAL PHASE TABLE LOOK-UP
035570,000229:
035571,000230: # GRAD INTERPOLATION FACTOR IN FINAL PHASE
035572,000231:
035573,000232: # FX DRANGE/D L/D = F3 2700 NM
035574,000233:
035575,000234: # FX +1 AREF 805 FPSS
035576,000235:
035577,000236: # FX +2 RTOGO 2700 NM
035578,000237:
035579,000238: # FX +3 RDOTREF VSAT/4
035580,000239:
035581,000240: # FX +4 DRANGE/D RDOT = F2 21600/2VS NM/FPS
035582,000241:
035583,000242: # FX +5 DRANGE/D DRAG = F1 2700/805 NM/FPSS
035584,000243:
035585,000244: # TEM1B TEMPORARY LOCATION
035586,000245:
035587,000246: # TIME/RTO TIME OF INITIAL TARGET RTINIT B 28 CENTISEC
035588,000247:
035589,000248: # DTEAROT EST TIME BETWEEN RTINIT AND RT B 28 CENTISEC
035590,000249: # -
035591,000250: # UNITV UNIT V VECTOR 2
035592,000251: # -
035593,000252: # UNITR UNIT R VECTOR 2
035594,000253: # -
035595,000254: # -VREL NEGATIVE VELOCITY REL TO ATMOSP 2 VSAT
035596,000255:
035597,000256: # COMPUTER SWITCHES INITIAL STATE CM/FLAGS = STATE +6
035598,000257: # -------- -------- ------------- -------------------
035599,000258:
035600,000259: # ENTRYDSP DO ENTRY DISPLAY, IF SET NON-BRANCH (1) 92D, BIT 13
035601,000260: # GONEPAST INDICATES OVERSHOOT OF TARGET NON-BRANCH (0) 95D, BIT 10
035602,000261: # RELVELSW RELATIVE VELOCITY SWITCH NON-BRANCH (0) 96D, BIT 9
035603,000262: # EGSW FINAL PHASE SWITCH NON-BRANCH (0) 97D, BIT 8
035604,000263: # FIRSTPAS INITIAL PASS THRU HUNTEST NON-BRANCH (0) 98D, BIT 7
035605,000264: # HIND INDICATES ITERATION IN HUNTEST NON-BRANCH (0) 99D, BIT 6
035606,000265: # INRLSW INDICATES INIT ROLL ATTITUDE SET NON-BRANCH (0) 100D, BIT 5
035607,000266: # LATSW INHIBIT DOWNLIFT SWITCH IF NOT SET BRANCH (1) 101D, BIT 4
035608,000267: # .05GSW INDICATES DRAG EXCEEDS .05 GS BRANCH (0) 102D, BIT 3
035609,000268:
035610,000269: # GONEBY INDICATES GONE PAST TARGET (SET) SELF-INITIALZNG 112D, BIT 8
035611,000270:
Page 795 |
035613,000272: # CONSTANTS AND GAINS VALUE
035614,000273: # ------------------- -----
035615,000274:
035616,000275: # C1 FACTOR IN ALP COMPUTATION 1.25
035617,000276: # C16 CONSTD GAIN ON DRAG .01
035618,000277: # C17 CONSTD GAIN ON RDOT .001
035619,000278: # C18 BIAS VEL. FOR FINAL PHASE START 500 FPS
035620,000279: # C20 MAX DRAG FOR DOWN-LIFT 175 FPSS
035621,000280: # CHOOK FACTOR IN AHOOK COMPUTATION .25
035622,000281: # CH1 FACTOR IN GAMMAL COMPUTATION 1.0
035623,000282: # COS15 COS( 15 DEG ) .965
035624,000283: # DLEWD0 INITIAL VARIATION IN LEWD -.05
035625,000284: # D2 DRAG TO CHANGE LEWD 175 FPSS
035626,000285: # DT COMPUTATION CYCLE TIME INTERVAL 2 SEC.
035627,000286: # GMAX MAXIMUM ACCELERATION 257.6 FPSS (8 G-S)
035628,000287: # KA1 FACTOR IN KA CALC 1.3 GS
035629,000288: # KA2 FACTOR IN KA CALC .2 GS
035630,000289: # KA3 FACTOR IN D0 CALC 90 FPSS
035631,000290: # KA4 FACTOR IN D0 CALC 40 FPSS
035632,000291: # KB1 OPTIMIZED UPCONTROL GAIN 3.4
035633,000292: # KB2 OPTIMIZED UPCONTROL GAIN .0034
035634,000293: # KDMIN INCREMENT ON Q7 TO DETECT END OF KEPLER PHASE .5 FPSS
035635,000294: # KTETA TIME OF FLIGHT CONSTANT 1000
035636,000295: # KLAT1 FACTOR IN KLAT CALC 1/24
035637,000296: # K44 GAIN USED IN INITIAL ROLL SECTION 19749550 FPS
035638,000297: # LATBIAS LATERAL SWITCH BIAS TERM .41252961 NM
035639,000298: # LEWD1 NOMINAL UPCONTROL L/D .15
035640,000299: # POINT1 FACTOR TO REDUCE UPCONTROL GAIN .1
035641,000300: # Q2 FINAL PHASE RANGE - 23500 Q3 -1002 NM
035642,000301: # Q3 FINAL PHASE DRANGE/D V .07 NM/FPS
035643,000302: # Q5 FINAL PHASE DRANGE/D GAMMA 7050 NM/RAD
035644,000303: # Q6 FINAL PHASE INITIAL FLIGHT PATH ANGLE .0349 RAD
035645,000304: # Q7F MIN DRAG FOR UPCONTROL 6 FPSS
035646,000305: # Q7MIN MIN VALUE FOR Q7 IN FACTOR CALCULATION 40 FPSS
035647,000306: # Q19 FACTOR IN GAMMAL1 CALCULATION .5
035648,000307: # Q21 FACTOR IN Q2 CALCULATION. 1000 NM
035649,000308: # Q22 FACTOR IN Q2 CALCULATION. -1302 NM
035650,000309: # VFINAL1 VELOCITY TO START FINAL PHASE ON INITIAL ENTRY 27000 FPS
035651,000310: # VFINAL FACTOR IN INITIAL UP-DOWN CALC 26600 FPS
035652,000311: # VLMIN MINIMUM VL 18000 FPS
035653,000312: # VMIN VELOCITY TO SWITCH TO RELATIVE VEL VSAT/2
035654,000313: # VRCONTRL RDOT TO START INTO HUNTEST 700 FPS
035655,000314: # VRCONT=COMPUTER NAME
035656,000315: # 25NM TOLERANCE TO STOP RANGE ITERATION 25 NM
035657,000316: # VQUIT VELOCITY TO STOP STEERING 1000 FPS
035658,000317:
Page 796 |
035660,000319: # CONVERSION FACTORS AND SCALING CONSTANTS
035661,000320: # ---------- ------- --- ------- ---------
035662,000321:
035663,000322: # ATK ANGLE IN RAD TO NM 3437.7468 NM/RAD
035664,000323: # GS NOMINAL G VALUE FOR SCALING 32.2 FPSS
035665,000324: # HS ATMOSPHERE SCALE HEIGHT 28500 FT
035666,000325: # J GRAVITY HARMONIC COEFFICIENT .00162346
035667,000326: # KWE EQUATORIAL EARTH RATE 1546.70168 FPS
035668,000327: # MUE EARTH GRAVITATIONAL CONSTANT 3.986032233 E14 CUBIC M/ SEC SEC
035669,000328: # RE EARTH RADIUS 21202900 FT
035670,000329: # REQ EARTH EQUATORIAL RADIUS 20925738.2 FT
035671,000330: # VSAT SATELLITE VELOCITY AT RE 25766.1973 FPS
035672,000331: # WIE EARTH RATE .0000729211505 RAD/SEC
035673,000332:
035674,000333: # (END GSOP AS-278, VOL 1, FIG. 5.6-3 CONSTANTS, GAINS, ETC.)
035675,000334:
035676,000335: # DISPLAY QUANTITIES
035677,000336: # ------------------
035678,000337:
035679,000338: # (SEE SECTION 4 OF THE GSOP FOR SIGN CONVENTIONS.)
035680,000339:
035681,000340: # VARIABLE DESCRIPTION MAXIMUM VALUE
035682,000341: # -------- ----------- ------- -----
035683,000342:
035684,000343: # QMAX PREDICTED MAXIMUM ENTRY ACCEL 163.84 GS N 60
035685,000344: # VPRED PREDICTED VELOCITY AT ALTITUDE 128 M/CENTISEC N 60
035686,000345: # 400K FT ABOVE FISCHER RADIUS.
035687,000346: # GAMMAEI PREDICTED GAMMA AT ALTITUDE 1 REVOLUTION N 60
035688,000347: # 400K FT ABOVE FISCHER RADIUS.
035689,000348: # D DRAG ACCELERATION 805 FPSS N 64
035690,000349: # VMAGI INERTIAL VELOCITY MAGNITUDE 128 M/CENTISEC N 64, N 68
035691,000350: # THETAH DESIRED RANGE ANGLE NM 1 REVOLUTION N 64, N 67
035692,000351: # LAT PRESENT LATITUDE 1 REVOLUTION N 67
035693,000352: # LONG PRESENT LONGITUDE 1 REVOLUTION N 67
035694,000353: # RTOGO RANGE ANGLE TO SPLASH FROM 1 REVOLUTION N 63
035695,000354: # EMSALT FT ABOVE FISCHER RADIUS. (IN NM)
035696,000355: # VIO PREDICTED VELOCITY AT ALTITUDE 128 M/CENTISEC N 63
035697,000356: # EMSALT FT ABOVE FISCHER RADIUS.
035698,000357: # TTE TIME OF FREE FALL TO ALT B 28 CENTISEC N 63
035699,000358: # EMSALT FT ABOVE FISCHER RADIUS.
035700,000359: # ROLLC ROLL COMMAND 1 REVOLUTION N 66, N 68, N 69
035701,000360: # LATANG CROSS-RANGE ERROR (XRNGERR) 4 RADIANS N 66
035702,000361: # DNRNGERR DOWN RANGE ERROR 1 REVOLUTION N 66
035703,000362: # (PREDANG - THETAH IN NM)
035704,000363: # HDOT ALTITUDE RATE 128 M/CENTISEC N 68
035705,000364: # Q7 MINIMUM DRAG FOR UPCONTROL 805 FPSS N 69
035706,000365: # VL EXIT VELOCITY FOR UP-CONTROL 2 VSAT N 69
035707,000366:
Page 797 |
035709,000368: # BODY ATTITUDE QUANTITIES (CM/POSE)
035710,000369: # -----------------------------------
035711,000370:
035712,000371: # VARIABLE DESCRIPTION MAXIMUM VALUE
035713,000372: # -------- ----------- ------- -----
035714,000373: # -
035715,000374: # -VREL NEGATIVE VELOCITY REL TO ATMOS. 2 VSAT
035716,000375: # -
035717,000376: # OLDUYA USED FOR UYA BELOW 1000 FPS 2
035718,000377: # -
035719,000378: # UXA/2 UNIT VECTOR TRIAD 2
035720,000379: # -
035721,000380: # UYA/2 BASED ON 2
035722,000381: # -
035723,000382: # UZA/2 THE TRAJECTORY. 2
035724,000383: # -
035725,000384: # UBX/2 UNIT VECTOR 2
035726,000385: # -
035727,000386: # UBY/2 BODY TRIAD 2
035728,000387: # -
035729,000388: # UBZ/2 FOR CM. 2
035730,000389:
End of include-file ENTRY_LEXICON.agc. Parent file is MAIN.agc