Source Code
These source-code files are part of a reconstructed copy of LM131 revision 1,
the final release of the Apollo 13 Lunar Module (LM) Apollo Guidance Computer
(AGC) software.
The source reconstruction began with source code of Luminary 131 previously transcribed from a digitized copy of that program. A dump of the flight spare core rope memory module B5, part number 2010802-171, serial number RAY 411, was obtained. This module is the only module different between Luminary 131 and LM131 revision 1. The dump was disassembled and all changes were incorporated into these source files. Note that page numbers in the reconstructed code match those on the Luminary 131 printout, although the changed code would likely have changed page numbers for a real LM131 revision 1 listing. Comments from 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. |
009678,000002: ## Copyright: Public domain. 009679,000003: ## Filename: RESTART_TABLES.agc 009680,000004: ## Purpose: A section of LM131 revision 1. 009681,000005: ## It is part of the reconstructed source code for the final 009682,000006: ## release of the flight software for the Lunar Module's (LM) 009683,000007: ## Apollo Guidance Computer (AGC) for Apollo 13. The code has 009684,000008: ## been reconstructed from a listing of Luminary 131 and a dump 009685,000009: ## of a core rope memory module B5, part number 2010802-171, 009686,000010: ## which is the only module different between LM131 revision 1 009687,000011: ## and Luminary 131. The executable generated from this source 009688,000012: ## has been verified against the module dump, so while the names, 009689,000013: ## comments, and ordering may not be exactly correct, the 009690,000014: ## resulting binary is. 009691,000015: ## Reference: pp. 239-244 009692,000016: ## Assembler: yaYUL 009693,000017: ## Contact: Ron Burkey <info@sandroid.org>. 009694,000018: ## Website: www.ibiblio.org/apollo/index.html 009695,000019: ## Mod history: 2022-10-28 MAS Created from Luminary 131. 009696,000020:
Page 239 |
009698,000022: # RESTART TABLES 009699,000023: # ------------------ 009700,000024: 009701,000025: # THERE ARE TWO FORMS OF RESTART TABLES FOR EACH GROUP. THEY ARE KNOWN AS THE EVEN RESTART TABLES AND THE ODD 009702,000026: # RESTART TABLES. THE ODD TABLES HAVE ONLY ONE ENTRY OF THREE LOCATIONS WHILE THE EVEN TABLES HAVE TWO ENTRIES 009703,000027: # EACH USING THREE LOCATIONS. THE INFORMATION AS TO WHETHER IT IS A JOB, WAITLIST, OR A LONGCALL IS GIVEN BY THE 009704,000028: # WAY THINGS ARE PUT IN TO THE TABLES. 009705,000029: 009706,000030: # A JOB HAS ITS PRIORITY STORED IN PRDTTAB OF THE CORRECT PHASE SPOT - A POSITIVE PRIORITY INDICATES A 009707,000031: # FINDVAC JOB, A NEGATIVE PRIORITY A NOVAC. THE 2CADR OF THE JOB IS STORED IN THE CADRTAB. 009708,000032: # FOR EXAMPLE, 009709,000033: 009710,000034: # 5.7SPOT OCT 23000 009711,000035: # 2CADR SOMEJOB 009712,000036:
In the line below, the printout certainly has no period at the end of the line. However, the corresponding lines in Luminary 116 and 210 have such a period and are otherwise identical. Therefore, this is presumably a printer error, and the period has been restored. |
009716,000040: # A RESTART OF GROUP 5 WITH PHASE SEVEN WOULD THEN CAUSE SOMEJOB TO BE RESTARTED AS A FINDVAC WITH PRIORITY 23. 009717,000041: 009718,000042: # 5.5SPOT OCT -23000 009719,000043: # 2CADR ANYJOB 009720,000044: 009721,000045: # HERE A RESTART OF GROUP 5 WITH PHASE 7 WOULD CAUSE ANYJOB TO BE RESTARTED AS A NOVAC WITH PRIORITY 23. 009722,000046: # A LONGCALL HAS ITS GENADR OF ITS 2CADR STORED NEGATIVELY AND ITS BBCON STORED POSITIVELY. IN ITS PRDTTAB IS 009723,000047: # PLACED THE LOCATION OF A DP REGISTER THAT CONTAINS THE DELTA TIME THAT LONGCALL HAD BEEN ORIGINALLY STARTED 009724,000048: # WITH. EXAMPLE, 009725,000049: 009726,000050: # 3.6SPOT GENADR DELTAT 009727,000051: # -GENADR LONGTASK 009728,000052: # BBCON LONGTASK 009729,000053: # OCT 31000 009730,000054: # 2CADR JOBAGAIN 009731,000055: 009732,000056: # THIS WOULD START UP LONGTASK AT THE APPROPRIATE TIME, OR IMMEDIATELY IF THE TIME HAD ALREADY PASSED. IT SHOULD 009733,000057: # BE NOTED THAT IF DELTAT IS IN A SWITCHED E BANK, THIS INFORMATOIN SHOULD BE IN THE BBCON OF THE 2CADR OF THE 009734,000058: # TASK. FROM ABOVE, WE SEE THAT THE SECOND PART O FTHIS PHASE WOULD BE STARTED AS A JOB WITH A PRIORITY OF 31. 009735,000059: 009736,000060: # WAITLIST CALLS ARE IDENTIFIED BY THE FACT THAT THEIR 2CADR IS STORED NEGATIVELY. IF PRDTTAB OF THE PHASE SPOT 009737,000061: # IS POSITIVE, THEN IT CONTAINS THE DELTA TIME, IF PRDTTAB IS NEGATIVE THEN IT IS THE -GENADR OF AN ERASABLE 009738,000062: # LOCATION CONTAINING THE DELTA TIME, THAT IS, THE TIME IS STORED INDIRECTLY. IT SHOULD BE NOTED AS ABOVE, THAT 009739,000063: # IF THE TIME IS STORED INDIRECTLY, THE BBCON MUST CONTAIN THE NECESSARY E BANK INFORMATION IF APPLICABLE. WITH 009740,000064: # WAITLIST WE HAVE ONE FURTHER OPTION, IF -0 IS STORED IN PRDTTAB, IT WILL CAUSE AN IMMEDIATE RESTART OF THE 009741,000065: # TASK. EXAMPLES, 009742,000066: 009743,000067: # OCT 77777 THIS WILL CAUSE AN IMMEDIATE RESTART 009744,000068: # -2CADR ATASK OF THE TASK :ATASK: 009745,000069: # 009746,000070: # DEC 200 IF THE TIME OF THE 2 SECONDS SINCE DUMMY 009747,000071: # -2CADR DUMMY WAS PUT ON WAITLIST IS UP, IT WILL BEGIN 009748,000072: # IN 10 MS, OTHERWISE IT WILL BEGIN WHEN 009749,000073: # IT NORMALLY WOULD HAVE BEGUN.
Page 240 |
009751,000075: # -GENADR DTIME WHERE DTIME CONTAINS THE DELTA TIME 009752,000076: # -2CADR TASKTASK OTHERWISE THIS IS AS ABOVE 009753,000077: 009754,000078: # ***** NOW THE TABLES THEMSELVES ***** 009755,000079: 009756,000080: 01,2002 BANK 01 009757,000081: 01,2000 SETLOC RESTART 009758,000082: 01,2000 BANK 009759,000083: 009760,000084: 01,2002 PRDTTAB EQUALS 12000 # USED TO FIND THE PRIORITY OR DELTATIME 009761,000085: 01,2002 CADRTAB EQUALS 12001 # THIS AND THE NEXT RELATIVE LOC CONTAIN 009762,000086: # RESTART 2CADR 009763,000087: 009764,000088: 01,2002 COUNT* $$/RSTAB # TABLES IN BANK 1. 009765,000089: 01,2002 00010 SIZETAB TC 1.2SPOT -12006 009766,000090: 01,2003 00020 TC 1.3SPOT -12004 009767,000091: 01,2004 00010 TC 2.2SPOT -12006 009768,000092: 01,2005 00026 TC 2.3SPOT -12004 009769,000093: 01,2006 00010 TC 3.2SPOT -12006 009770,000094: 01,2007 00056 TC 3.3SPOT -12004 009771,000095: 01,2010 00062 TC 4.2SPOT -12006 009772,000096: 01,2011 00072 TC 4.3SPOT -12004 009773,000097: 01,2012 00145 TC 5.2SPOT -12006 009774,000098: 01,2013 00163 TC 5.3SPOT -12004 009775,000099: 01,2014 00010 TC 6.2SPOT -12006 009776,000100: 01,2015 00174 TC 6.3SPOT -12004 009777,000101: 01,2016 21000 1.2SPOT OCT 21000 # A DUMMY EXAMPLE TO BE REPLACED AS SOON 009778,000102: 01,2017 0074 EBANK= STATE 009779,000103: 01,2017 05155 04060 2CADR ENDOFJOB # AS THERE IS A LEGITIMATE 1.2SPOT 009780,000104: 009781,000105: 01,2021 00144 DEC 100 B-14 009782,000106: 01,2022 0074 EBANK= STATE 009783,000107: 01,2022 05261 04060 2CADR TASKOVER 009784,000108: 009785,000109: # ANY MORE GROUP 1.EVEN RESTART VALUES SHOULD GO HERE 009786,000110: 009787,000111: 01,2024 76300 1.3SPOT -GENADR SAVET-30 009788,000112: 01,2025 E7,1515 EBANK= DVCNTR 009789,000113: 01,2025 75427 03710 -2CADR ULLGTASK 009790,000114: 009791,000115: 01,2027 32000 1.5SPOT OCT 32000 009792,000116: 01,2030 E7,1654 EBANK= HMEAS 009793,000117: 01,2030 03630 66067 2CADR REREPOS 009794,000118: 009795,000119: # ANY MORE GROUP 1.ODD RESTART VALUES SHOULD GO HERE 009796,000120: 009797,000121: 01,2032 01,2016 2.2SPOT EQUALS 1.2SPOT 009798,000122: 009799,000123: # ANY MORE GROUP 2.EVEN RESTART VALUES SHOULD GO HERE 009800,000124: 009801,000125: 01,2032 02627 2.3SPOT GENADR 600SECS
Page 241 |
009803,000127: 01,2033 75175 -GENADR STATEINT 009804,000128: 01,2034 E3,1554 EBANK= RRECTCSM 009805,000129: 01,2034 26063 BBCON STATEINT 009806,000130: 009807,000131: 01,2035 05000 2.5SPOT OCT 05000 009808,000132: 01,2036 E3,1554 EBANK= RRECTCSM 009809,000133: 01,2036 02611 26063 2CADR STATINT1 009810,000134: 009811,000135: 01,2040 02734 2.7SPOT DEC 1500 B-14 009812,000136: 01,2041 E7,1456 EBANK= LOSCOUNT 009813,000137: 01,2041 75533 27710 -2CADR P20LEMC1 009814,000138: 009815,000139: 01,2043 14000 2.11SPOT OCT 14000 009816,000140: 01,2044 E7,1762 EBANK= P21TIME 009817,000141: 01,2044 02414 50067 2CADR P25LEM1 009818,000142: 009819,000143: 01,2046 10000 2.13SPOT OCT 10000 009820,000144: 01,2047 E7,1456 EBANK= LOSCOUNT 009821,000145: 01,2047 02223 54067 2CADR RELINUS 009822,000146: 009823,000147: 01,2051 26000 2.15SPOT OCT 26000 009824,000148: 01,2052 E7,1456 EBANK= LOSCOUNT 009825,000149: 01,2052 02654 50067 2CADR R22RSTRT 009826,000150: 009827,000151: 01,2054 77777 2.17SPOT OCT 77777 009828,000152: 01,2055 E7,1700 EBANK= VGPREV 009829,000153: 01,2055 75436 03710 -2CADR REDO2.17 009830,000154: 009831,000155: 01,2057 00031 2.21SPOT DEC 25 B-14 009832,000156: 01,2060 E7,1515 EBANK= DVCNTR 009833,000157: 01,2060 75771 35710 -2CADR R10,R11 009834,000158: 009835,000159: # ANY MORE GROUP 2.ODD RESTART VALUES SHOULD GO HERE. 009836,000160: 009837,000161: 01,2062 01,2016 3.2SPOT EQUALS 1.2SPOT 009838,000162: 009839,000163: # ANY MORE GROUP 3.EVEN RESTART VALUES SHOULD GO HERE 009840,000164: 009841,000165: 01,2062 76355 3.3SPOT -GENADR ZOOMTIME 009842,000166: 01,2063 E7,1515 EBANK= DVCNTR 009843,000167: 01,2063 74110 05710 -2CADR ZOOM 009844,000168: 009845,000169: 01,2065 20000 3.5SPOT OCT 20000 009846,000170: 01,2066 E7,1453 EBANK= TTOGO 009847,000171: 01,2066 02540 56067 2CADR S40.13 009848,000172: 009849,000173: # ANY MORE GROUP 3.ODD RESTART VALUES SHOULD GO HERE 009850,000174: 009851,000175: 01,2070 04704 4.2SPOT DEC 2500 B-14 009852,000176: 01,2071 E7,1453 EBANK= TTOGO
Page 242 |
009854,000178: 01,2071 75423 03710 -2CADR TIG-5 009855,000179: 009856,000180: 01,2073 77777 OCT 77777 009857,000181: 01,2074 E7,1453 EBANK= TTOGO 009858,000182: 01,2074 75433 03710 -2CADR REDO4.2 009859,000183: 009860,000184: # ANY MORE GROUP 4.EVEN RESTART VALUES SHOULD GO HERE 009861,000185: 009862,000186: 01,2076 25000 4.3SPOT OCT 25000 009863,000187: 01,2077 E7,1515 EBANK= DVCNTR 009864,000188: 01,2077 03533 64067 2CADR GOABORT 009865,000189: 009866,000190: 01,2101 00062 4.5SPOT DEC 50 B-14 009867,000191: 01,2102 E7,1453 EBANK= TTOGO 009868,000192: 01,2102 75211 03710 -2CADR ULLAGOFF 009869,000193: 009870,000194: 01,2104 00764 4.7SPOT DEC 500 B-14 009871,000195: 01,2105 E7,1515 EBANK= DVCNTR 009872,000196: 01,2105 75370 03710 -2CADR TIG-0 009873,000197: 009874,000198: 01,2107 76260 4.11SPOT -GENADR TGO +1 009875,000199: 01,2110 E7,1515 EBANK= DVCNTR 009876,000200: 01,2110 74231 03710 -2CADR ENGOFTSK 009877,000201: 009878,000202: 01,2112 12000 4.13SPOT OCT 12000 009879,000203: 01,2113 E7,1462 EBANK= TRKMKCNT 009880,000204: 01,2113 03227 74067 2CADR POSTBURN 009881,000205: 009882,000206: 01,2115 00764 4.15SPOT DEC 500 B-14 009883,000207: 01,2116 E7,1453 EBANK= TTOGO 009884,000208: 01,2116 75477 03710 -2CADR TIG-30 009885,000209: 009886,000210: 01,2120 77777 4.17SPOT OCT 77777 009887,000211: 01,2121 E7,1515 EBANK= DVCNTR 009888,000212: 01,2121 75423 03710 -2CADR TIG-5 009889,000213: 009890,000214: 01,2123 13000 4.21SPOT OCT 13000 009891,000215: 01,2124 E5,1730 EBANK= STAR 009892,000216: 01,2124 03012 30065 2CADR R51.1 +1 009893,000217: 009894,000218: 01,2126 77777 4.23SPOT OCT 77777 009895,000219: 01,2127 E7,1515 EBANK= DVCNTR 009896,000220: 01,2127 75345 03710 -2CADR IGNITION 009897,000221: 009898,000222: 01,2131 01477 4.25SPOT GENADR SAVET-30 009899,000223: 01,2132 75535 -GENADR TIG-35 009900,000224: 01,2133 E7,1477 EBANK= SAVET-30 009901,000225: 01,2133 74067 BBCON TIG-35 009902,000226:
Page 243 |
009904,000228: 01,2134 52777 4.27SPOT OCT 52777 009905,000229: 01,2135 E7,1515 EBANK= DVCNTR 009906,000230: 01,2135 02070 42067 2CADR P70A 009907,000231: 009908,000232: 01,2137 52777 4.31SPOT OCT 52777 009909,000233: 01,2140 E7,1515 EBANK= DVCNTR 009910,000234: 01,2140 02073 42067 2CADR P71A 009911,000235: 009912,000236: 01,2142 46777 4.33SPOT OCT 46777 009913,000237: 01,2143 E7,1515 EBANK= DVCNTR 009914,000238: 01,2143 02024 10067 2CADR GOPOOFIX 009915,000239: 009916,000240: 01,2145 46777 4.35SPOT OCT 46777 009917,000241: 01,2146 E7,1515 EBANK= DVCNTR 009918,000242: 01,2146 05655 04067 2CADR GOPOODOO 009919,000243: 009920,000244: 01,2150 52777 4.37SPOT OCT 52777 009921,000245: 01,2151 E7,1455 EBANK= WHICH 009922,000246: 01,2151 02575 74067 2CADR COMFAIL 009923,000247: 009924,000248: # ANY MORE 4.ODD RESTART VALUES SHOULD GO HERE. 009925,000249: 01,2153 22000 5.2SPOT OCT 22000 009926,000250: 01,2154 E7,1515 EBANK= DVCNTR 009927,000251: 01,2154 02463 46067 2CADR NORMLIZE 009928,000252: 009929,000253: 01,2156 00310 DEC 200 B-14 009930,000254: 01,2157 E7,1515 EBANK= DVCNTR 009931,000255: 01,2157 74166 01710 -2CADR REREADAC 009932,000256: 009933,000257: 01,2161 00310 5.4SPOT DEC 200 B-14 009934,000258: 01,2162 E7,1515 EBANK= DVCNTR 009935,000259: 01,2162 74166 01710 -2CADR REREADAC 009936,000260: 009937,000261: 01,2164 20000 OCT 20000 009938,000262: 01,2165 E7,1515 EBANK= DVCNTR 009939,000263: 01,2165 02206 66067 2CADR SERVICER 009940,000264: 009941,000265: # ANY MORE GROUP 5.EVEN RESTART VALUES SHOULD GO HERE 009942,000266: 009943,000267: 01,2167 00310 5.3SPOT DEC 200 B-14 009944,000268: 01,2170 E7,1515 EBANK= DVCNTR 009945,000269: 01,2170 74166 01710 -2CADR REREADAC 009946,000270: 009947,000271: 01,2172 77777 5.5SPOT OCT 77777 009948,000272: 01,2173 E7,1515 EBANK= DVCNTR 009949,000273: 01,2173 74326 01710 -2CADR REDO5.5 009950,000274:
Page 244 |
009952,000276: 01,2175 77777 5.7SPOT OCT 77777 009953,000277: 01,2176 E7,1515 EBANK= DVCNTR 009954,000278: 01,2176 74361 01710 -2CADR BIBIBIAS 009955,000279: 009956,000280: # ANY MORE GROUP 5.ODD RESTART VALUES SHOULD GO HERE 009957,000281: 009958,000282: 01,2200 01,2016 6.2SPOT EQUALS 1.2SPOT 009959,000283: 01,2200 00144 6.3SPOT DEC 100 B-14 009960,000284: 01,2201 E7,1441 EBANK= TIG 009961,000285: 01,2201 75054 03710 -2CADR CLOKTASK 009962,000286: 009963,000287: 01,2203 30000 6.5SPOT OCT 30000 # PROTECT INCREMENTING OF TIME2,TIME1 BY 009964,000288: 01,2204 E3,1706 EBANK= TEPHEM # P27(UPDATE PROGRAM) VIA V70 OR V73. 009965,000289: 01,2204 03557 10063 2CADR TIMEDIDR 009966,000290: 009967,000291: 01,2206 17000 6.7SPOT OCT 17000 009968,000292: 01,2207 E7,1700 EBANK= VGPREV 009969,000293: 01,2207 03354 74067 2CADR REDO6.7 009970,000294: 009971,000295: End of include-file RESTART_TABLES.agc. Parent file is MAIN.agc