Source Code
This is a reconstruction of the AGC program Luminary 99 Rev 0. It was the third release
of the Lunar Module flight software targeted for use in Apollo 11, after Luminary 96 and 97.
A bug (which had been around since at least Apollo 10, Luminary 69) was
discovered in Rev 0 shortly before the Apollo 11 flight, resulting in a last minute
revision into Rev 1,
which is what actually flew rather than
the Rev 0 presented here. A hardcopy of Rev 0 is known to
exist — it belonged to AGC developer Allan Klumpp for many years — but
unfortunately the Virtual AGC Project has not had access to that hardcopy. Thus
the code you see here had been reconstructed (we believe accurately) rather than
transcribed. The first step of the reconstruction of the Rev 0 source code was
the transcription of the Rev 1 source code from a hardcopy in the MIT Museum collection.
The process of reverting the active portion of the source code (i.e., other than
program comments) from Rev 1 to Rev 0 was very minor, consisting
only of moving the position of the STARTSB1 label in
FRESH START AND RESTART. Allan had previously given
us the checksums of the memory banks of Rev 0, and we have verified the program presented here has checksums
identical to all banks of Allan's listing of Rev 0. The notations on Allan's Rev 0 program listing read,
in part:GAP: ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-051 A single program comment is known to differ between Rev 0 and Rev 1, but these are harder to reconstruct and verify than changes to the active portion of the code. Thus it is possible that there are additional differences between the program comments in Rev 0 and Rev 1 that are unknown to us, and therefore are not reflected in the code presented here. |
047636,000002: ## Copyright: Public domain.
047637,000003: ## Filename: FIXED-FIXED_CONSTANT_POOL.agc
047638,000004: ## Purpose: Part of the reconstructed source code for LMY99 Rev 0,
047639,000005: ## otherwise known as Luminary Rev 99, the third release
047640,000006: ## of the Apollo Guidance Computer (AGC) software for Apollo 11.
047641,000007: ## It differs from LMY99 Rev 1 (the flown version) only in the
047642,000008: ## placement of a single label. The corrections shown here have
047643,000009: ## been verified to have the same bank checksums as AGC developer
047644,000010: ## Allan Klumpp's copy of Luminary Rev 99, and so are believed
047645,000011: ## to be accurate. This file is intended to be a faithful
047646,000012: ## recreation, except that the code format has been changed to
047647,000013: ## conform to the requirements of the yaYUL assembler rather than
047648,000014: ## the original YUL assembler.
047649,000015: ##
047650,000016: ## Assembler: yaYUL
047651,000017: ## Contact: Ron Burkey <info@sandroid.org>.
047652,000018: ## Website: www.ibiblio.org/apollo.
047653,000019: ## Pages: 1095-1099
047654,000020: ## Mod history: 2009-05-25 RSB Adapted from the corresponding
047655,000021: ## Luminary131 file, using page
047656,000022: ## images from Luminary 1A.
047657,000023: ## 2016-12-17 RSB Proofed text comments with octopus/ProoferComments
047658,000024: ## and corrected the errors found.
047659,000025: ## 2017-03-13 RSB Comment-text fixes noted in proofing Luminary 116.
047660,000026: ## 2017-08-01 MAS Created from LMY99 Rev 1.
047661,000027:
047662,000028: ## This source code has been transcribed or otherwise adapted from
047663,000029: ## digitized images of a hardcopy from the MIT Museum. The digitization
047664,000030: ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
047665,000031: ## the Museum. Many thanks to both. The images (with suitable reduction
047666,000032: ## in storage size and consequent reduction in image quality as well) are
047667,000033: ## available online at www.ibiblio.org/apollo. If for some reason you
047668,000034: ## find that the images are illegible, contact me at info@sandroid.org
047669,000035: ## about getting access to the (much) higher-quality images which Paul
047670,000036: ## actually created.
047671,000037: ##
047672,000038: ## The code has been modified to match LMY99 Revision 0, otherwise
047673,000039: ## known as Luminary Revision 99, the Apollo 11 software release preceeding
047674,000040: ## the listing from which it was transcribed. It has been verified to
047675,000041: ## contain the same bank checksums as AGC developer Allan Klumpp's listing
047676,000042: ## of Luminary Revision 99 (for which we do not have scans).
047677,000043: ##
047678,000044: ## Notations on Allan Klumpp's listing read, in part:
047679,000045: ##
047680,000046: ## ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-51
047681,000047:
Page 1095 |
047683,000049: 4732 BLOCK 02
047684,000050: 4732 COUNT* $$/FCONS
047685,000051:
047686,000052: # THE FOLLOWING TABLE OF 18 VALUES IS INDEXED. DO NOT INSERT OR REMOVE ANY QUANTITIES.
047687,000053:
047688,000054: 4732 37777 DPOSMAX OCT 37777 # MUST PRECEDE POSMAX
047689,000055: 4733 37777 POSMAX OCT 37777
047690,000056:
047691,000057: 4734 4734 LIMITS = NEG1/2
047692,000058:
047693,000059: 4734 57777 NEG1/2 OCT -20000 # USED BY SIN ROUTINE (MUST BE TWO
047694,000060: # LOCATIONS IN FRONT OF BIT14)
047695,000061:
047696,000062: # BIT TABLE
047697,000063:
047698,000064: 4735 40000 BIT15 OCT 40000
047699,000065: 4736 20000 BIT14 OCT 20000
047700,000066: 4737 10000 BIT13 OCT 10000
047701,000067: 4740 04000 BIT12 OCT 04000
047702,000068: 4741 02000 BIT11 OCT 02000
047703,000069: 4742 01000 BIT10 OCT 01000
047704,000070: 4743 00400 BIT9 OCT 00400
047705,000071: 4744 00200 BIT8 OCT 00200
047706,000072: 4745 00100 BIT7 OCT 00100
047707,000073: 4746 00040 BIT6 OCT 00040
047708,000074: 4747 00020 BIT5 OCT 00020
047709,000075: 4750 00010 BIT4 OCT 00010
047710,000076: 4751 00004 BIT3 OCT 00004
047711,000077: 4752 00002 BIT2 OCT 00002
047712,000078: 4753 00001 BIT1 OCT 00001
047713,000079:
047714,000080: # DO NOT DESTROY THIS COMBINATION, SINCE IT IS USED IN DOUBLE PRECISION INSTRUCTIONS.
047715,000081: 4754 77777 NEG0 OCT -0 # MUST PRECEDE ZERO
047716,000082: 4755 00000 ZERO OCT 0 # MUST FOLLOW NEG0
047717,000083: # BIT1 OCT 00001
047718,000084: # NO.WDS OCT 2 INTERPRETER
047719,000085: # OCTAL3 OCT 3 INTERPRETER
047720,000086: # R3D1 OCT 4 PINBALL
047721,000087: 4756 00005 FIVE OCT 5
047722,000088: # REVCNT OCT 6 INTERPRETER
047723,000089: 4757 00007 SEVEN OCT 7
047724,000090: # BIT4 OCT 00010
047725,000091: # R2D1 OCT 11 PINBALL
047726,000092: 4760 4320 OCT11 = R2D1 # P20S
047727,000093: # BINCON DEC 10 PINBALL (OCTAL 12)
047728,000094: 4760 00013 ELEVEN DEC 11 B-14
047729,000095: # OCT14 OCT 14 ALARM AND ABORT (FILLER)
047730,000096: 4761 00015 OCT15 OCT 15
047731,000097: # R1D1 OCT 16 PINBALL
047732,000098: 4762 00017 LOW4 OCT 17
Page 1096 |
047734,000100: # BIT5 OCT 00020
047735,000101: # ND1 OCT 21 PINBALL
047736,000102: # VD1 OCT 23 PINBALL
047737,000103: # OCT24 OCT 24 SERVICE ROUTINES
047738,000104: # MD1 OCT 25 PINBALL
047739,000105: 4763 00030 BITS4&5 OCT 30
047740,000106: # OCT31 OCT 31 SERVICE ROUTINES
047741,000107: 4764 00033 OCT33 OCT 33
047742,000108: 4765 4764 DEC27 = OCT33
047743,000109: 4765 00035 OCT35 OCT 35
047744,000110: 4766 4765 DEC29 = OCT35
047745,000111: 4766 00032 CALLCODE OCT 00032
047746,000112: # LOW5 OCT 37 PINBALL
047747,000113: # 33DEC DEC 33 PINBALL (OCTAL 41)
047748,000114: # 34DEC DEC 34 PINBALL (OCTAL 42)
047749,000115: 4767 00045 TBUILDFX DEC 37 B-14 # BUILDUP FOR CONVIENCE IN DAPTESTING
047750,000116: 4770 00046 TDECAYFX DEC 38 B-14 # CONVENIENCE FOR DAPTESTING
047751,000117: # BIT6 OCT 00040
047752,000118: 4771 00050 OCT50 OCT 50
047753,000119: 4772 00055 DEC45 DEC 45 B-14
047754,000120: 4773 00060 SUPER011 OCT 60 # BITS FOR SUPERBNK SETTING 011.
047755,000121: 4774 00062 .5SEC DEC 50 B-14
047756,000122: # BIT7 OCT 00100
047757,000123:
047758,000124: 4775 4745 SUPER100 = BIT7 # BITS FOR SUPERBNK SETTING 100
047759,000125: # (LAST 4K OF ROPE)
047760,000126: 4775 00120 SUPER101 OCT 120 # BITS FOR SUPERBNK SETTING 101
047761,000127: # OCT121 OCT 121 SERVICE ROUTINES
047762,000128: # (FIRST 8K OF ACM)
047763,000129: 4776 00140 SUPER110 OCT 140 # BITS FOR SUPERBNK SETTING 110.
047764,000130: # (LAST 8K OF ACM)
047765,000131: 4777 00144 1SEC DEC 100 B-14
047766,000132: # LOW7 OCT 177 INTERPRETER
047767,000133: # BIT8 OCT 00200
047768,000134: # OT215 OCT 215 ALARM AND ABORT
047769,000135: # 8,5 OCT 00220 P20-P25 SUNDANCE
047770,000136: 5000 00310 2SECS DEC 200 B-14
047771,000137: # LOW8 OCT 377 PINBALL
047772,000138: # BIT9 OCT 00400
047773,000139: 5001 00401 GN/CCODE OCT 00401 # SET S/C CONTROL SWITCH TO G/N
047774,000140: 5002 00454 3SECS DEC 300 B-14
047775,000141: 5003 00620 4SECS DEC 400 B-14
047776,000142: 5004 00777 LOW9 OCT 777
047777,000143: # BIT10 OCT 01000
047778,000144: # 5.5DEGS DEC .03056 P20-P25 SUNDANCE (OCTAL 00765)
047779,000145: # OCT1103 OCT 1103 ALARM AND ABORT
047780,000146: 5005 01124 C5/2 DEC .0363551 # (OCTAL 01124)
047781,000147: 5006 01211 V05N09 VN 0509 # (SAME AS OCTAL 1211)
047782,000148: 5007 01400 OCT1400 OCT 01400
047783,000149: 5010 01426 V06N22 VN 0622
Page 1097 |
047785,000151: # MID5 OCT 1740 PINBALL
047786,000152: 5011 01776 BITS2-10 OCT 1776
047787,000153: 5012 01777 LOW10 OCT 1777
047788,000154: # BIT11 OCT 02000
047789,000155: # 2K+3 OCT 2003 PINBALL
047790,000156: 5013 02177 LOW7+2K OCT 2177 # OP CODE MASK + BANK 1 FBANK SETTING.
047791,000157: 5014 02400 EBANK5 OCT 02400
047792,000158: 5015 03000 PRIO3 OCT 03000
047793,000159: 5016 03400 EBANK7 OCT 03400
047794,000160: # LOW11 OCT 3777 PINBALL
047795,000161: # BIT12 OCT 04000
047796,000162: # RELTAB OCT 04025 T4RUPT
047797,000163: 5017 05000 PRIO5 OCT 05000
047798,000164: 5020 06000 PRIO6 OCT 06000
047799,000165: 5021 07000 PRIO7 OCT 07000
047800,000166:
047801,000167: # BIT13 OCT 10000
047802,000168: # OCT 10003 T4RUPT RELTAB +1D
047803,000169: # 13,7,2 OCT 10102 P20-P25 SUNDANCE
047804,000170: 5022 11000 PRIO11 OCT 11000
047805,000171: # PRIO12 OCT 12000 BANKCALL
047806,000172: 5023 13000 PRIO13 OCT 13000
047807,000173: 5024 14000 PRIO14 OCT 14000
047808,000174: # OCT 14031 T4RUPT RELTAB +2D
047809,000175: 5025 15000 PRIO15 OCT 15000
047810,000176: 5026 16000 PRIO16 OCT 16000
047811,000177: # 85DEGS DEC .45556 P20-P25 SUNDANCE (OCTAL 16450)
047812,000178: 5027 17000 PRIO17 OCT 17000
047813,000179: 5030 17770 OCT17770 OCT 17770
047814,000180: # BIT14 OCT 20000
047815,000181: # OCT 20033 T4RUPT RELTAB +3D
047816,000182: 5031 21000 PRIO21 OCT 21000
047817,000183: 7710 BLOCK 03
047818,000184: 7710 COUNT* $$/FCONS
047819,000185: 7710 22000 PRIO22 OCT 22000 # SERVICE ROUTINES
047820,000186: 7711 23000 PRIO23 OCT 23000
047821,000187: 7712 24000 PRIO24 OCT 24000
047822,000188: # 5/8+1 OCT 24001 SINGLE PRECISION SUBROUTINES
047823,000189: # OCT 24017 T4RUPT RELTAB +4D
047824,000190: 7713 25000 PRIO25 OCT 25000
047825,000191: 7714 26000 PRIO26 OCT 26000
047826,000192: 7715 27000 PRIO27 OCT 27000
047827,000193: # CHRPRIO OCT 30000 PINBALL
047828,000194: # OCT 30036 T4RUPT RELTAB +5D
047829,000195: 7716 31000 PRIO31 OCT 31000
047830,000196: 7717 31103 C1/2 DEC .7853134 # (OCTAL 31103)
047831,000197: 7720 32000 PRIO32 OCT 32000
047832,000198: 7721 33000 PRIO33 OCT 33000
047833,000199: 7722 34000 PRIO34 OCT 34000
047834,000200: # OCT 34034 T4RUPT RELTAB +6D
Page 1098 |
047836,000202: 7723 35000 PRIO35 OCT 35000
047837,000203: 7724 36000 PRIO36 OCT 36000
047838,000204: 7725 37000 PRIO37 OCT 37000
047839,000205: 7726 37401 63/64+1 OCT 37401
047840,000206: # MID7 OCT 37600 PINBALL
047841,000207: 7727 37766 OCT37766 OCT 37766
047842,000208: 7730 37774 OCT37774 OCT 37774
047843,000209: 7731 37776 OCT37776 OCT 37776
047844,000210: # DPOSMAX OCT 37777
047845,000211: # BIT15 OCT 40000
047846,000212: # OCT40001 OCT 40001 INTERPRETER (CS 1 INSTRUCTION)
047847,000213: 7732 40014 DLOADCOD OCT 40014
047848,000214: 7733 40015 DLOAD* OCT 40015
047849,000215: # OCT 40023 T4RUPT RELTAB +7D
047850,000216: 7734 40040 BIT15+6 OCT 40040
047851,000217: 7735 40200 OCT40200 OCT 40200
047852,000218: # OCT 44035 T4RUPT RELTAB +8D
047853,000219: # OCT 50037 T4RUPT RELTAB +9D
047854,000220: # OCT 54000 T4RUPT RELTAB +10D
047855,000221: 7736 57777 -BIT14 OCT 57777
047856,000222: # RELTAB11 OCT 60000 T4RUPT
047857,000223: 7737 65552 C3/2 DEC -.3216147 # (OCTAL 65552)
047858,000224: 7740 70000 13,14,15 OCT 70000
047859,000225: 7741 73777 -1/8 OCT 73777
047860,000226: 7742 74000 HIGH4 OCT 74000
047861,000227: 7743 74056 -ENDERAS DEC -2001 B-14 # (OCTAL 74056)
047862,000228: # HI5 OCT 76000 PINBALL
047863,000229: 7744 77700 HIGH9 OCT 77700
047864,000230: # -ENDVAC DEC -45 INTERPRETER (OCTAL 77722)
047865,000231: # -OCT10 OCT -10 (OCT 77767)
047866,000232: # NEG4 DEC -4 (OCTAL 77773)
047867,000233: 7745 77774 NEG3 DEC -3 B-14
047868,000234: 7746 77775 NEG2 OCT 77775
047869,000235: 7747 77776 NEGONE DEC -1 B-14
047870,000236:
Page 1099 |
047872,000238:
047873,000239: # DEFINED BY EQUALS
047874,000240:
047875,000241: # IT WOULD BE TO THE USERS ADVANTAGE TO OCCASIONALLY CHECK ANY OF THESE SYMBOLS IN ORDER TO PREVENT ANY
047876,000242: # ACCIDENTAL DEFINITION CHANGES.
047877,000243:
047878,000244: 7750 7747 MINUS1 = NEG1
047879,000245: 7750 7747 NEG1 = NEGONE
047880,000246: 7750 4753 ONE = BIT1
047881,000247: 7750 4752 TWO = BIT2
047882,000248: 7750 6245 THREE = OCTAL3
047883,000249: 7750 6245 LOW2 = THREE
047884,000250: 7750 4751 FOUR = BIT3
047885,000251: 7750 6242 SIX = REVCNT
047886,000252: 7750 4757 LOW3 = SEVEN
047887,000253: 7750 4750 EIGHT = BIT4
047888,000254: 7750 4320 NINE = R2D1
047889,000255: 7750 4363 TEN = BINCON
047890,000256: 7750 4760 NOUTCON = ELEVEN
047891,000257: 7750 4360 OCT23 = VD1
047892,000258: 7750 4362 OCT25 = MD1
047893,000259: 7750 4742 PRIO1 = BIT10
047894,000260: 7750 5007 EBANK3 = OCT1400
047895,000261: 7750 4741 PRIO2 = BIT11
047896,000262: 7750 4775 OCT120 = SUPER101
047897,000263: 7750 4776 OCT140 = SUPER110
047898,000264: 7750 4741 2K = BIT11
047899,000265: 7750 4741 EBANK4 = BIT11
047900,000266: 7750 4740 PRIO4 = BIT12
047901,000267: 7750 5015 EBANK6 = PRIO3
047902,000268: 7750 4737 QUARTER = BIT13
047903,000269: 7750 4737 PRIO10 = BIT13
047904,000270: 7750 7663 OCT10001 = CCSL
047905,000271: 7750 4736 POS1/2 = HALF
047906,000272: 7750 4736 PRIO20 = BIT14
047907,000273: 7750 4736 HALF = BIT14
047908,000274: 7750 4355 PRIO30 = CHRPRIO
047909,000275: 7750 4355 BIT13-14 = PRIO30 # INTERPRETER USES IN PROCESSING STORECODE
047910,000276: 7750 6471 OCT30002 = TLOAD +1
047911,000277: 7750 7722 B12T14 = PRIO34
047912,000278: 7750 4735 NEGMAX = BIT15
047913,000279: 7750 4735 VLOADCOD = BIT15
047914,000280: 7750 6107 VLOAD* = OCT40001
047915,000281: 7750 4101 OCT60000 = RELTAB11
047916,000282: 7750 4350 BANKMASK = HI5
047917,000283:
End of include-file FIXED-FIXED_CONSTANT_POOL.agc. Parent file is MAIN.agc