Source Code

This source code is very close to the Apollo Guidance Computer software for the Apollo 13 Lunar module. This revision of the Luminary 131 program is from December of 1969, whereas there was a later revision in January of 1970, and still another revision in February, which is the code that flew on the mission. As far as this transcription is concerned, it was originally from a copy made in 1991 of a printout from the collection of AGC developer Don Eyles for collector David Craig. It was subsequently scanned by Gary Neff, reprocessed for online presentation at the now-discontinued History of Recent Science and Technology (HRST) website of MIT's Dibner Institute (the full-quality scans being discarded in the process), and finally transcribed by Ron Burkey for the Virtual AGC Project. Although a high-quality replacement scan for a completely illegible page was later provided by Gary Neff, the reduced legibility of the reprocessed HRST posting nevertheless caused many errors to be introduced into the transcription. Accordingly, a second scan of the same physical printout was made in 2017 for the Virtual AGC Project's collection at the Internet Archive, and used to correct the transcription errors. All of the scanned materials mentioned, as well as other Luminary 131 related material, are available online. Don Eyles apprently made additional hand-written notes in printout between 1991 and 2017, so the two scans are not identical in that respect. The page-headings in the printout read, in part:
	GAP:  ASSEMBLE REVISION 131 OF AGC PROGRAM LUMINARY BY NASA 2021112-091
	17:53 DEC. 19, 1969
Note that the date is the date the printout was made, not the date on which the program revision was released, although these happen to be very close together.

009758,000002:                                                                                                  ## Copyright:   Public domain.
009759,000003:                                                                                                  ## Filename:    RESTART_TABLES.agc
009760,000004:                                                                                                  ## Purpose:     A section of Luminary 1C, revision 131.
009761,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
009762,000006:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 13.
009763,000007:                                                                                                  ##              This file is intended to be a faithful transcription, except
009764,000008:                                                                                                  ##              that the code format has been changed to conform to the
009765,000009:                                                                                                  ##              requirements of the yaYUL assembler rather than the 
009766,000010:                                                                                                  ##              original YUL assembler.
009767,000011:                                                                                                  ## Reference:   pp. 239-244
009768,000012:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
009769,000013:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
009770,000014:                                                                                                  ## Mod history: 05/06/03 RSB.   Began transcribing.
009771,000015:                                                                                                  ##              05/14/05 RSB    Corrected website references above.
009772,000016:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
009773,000017:                                                                                                  ##                              original harcopy, as opposed to the PDF page
009774,000018:                                                                                                  ##                              numbers in 1701.pdf.
009775,000019:                                                                                                  ##              2017-02-08 RSB  Comment-text fixes identified while proofing Artemis 72.
009776,000020:                                                                                                  ##              2017-02-20 RSB  Proofed comment text using octopus/ProoferComments.
009777,000021:                                                                                                  ##              2017-03-01 RSB  Restored a period which was present in both Luminary 116
009778,000022:                                                                                                  ##                              and 210, and was therefore presumably missing due to a 
009779,000023:                                                                                                  ##                              printer problem.
009780,000024:                                                                                                  ##              2017-03-13 RSB  GOP00FIX -> GOPOOFIX.
009781,000025: 

Page 239

009783,000027:                                                                                                  #  RESTART TABLES
009784,000028:                                                                                                  #  ------------------
009785,000029: 
009786,000030:                                                                                                  #  THERE ARE TWO FORMS OF RESTART TABLES FOR EACH GROUP.  THEY ARE KNOWN AS THE EVEN RESTART TABLES AND THE ODD
009787,000031:                                                                                                  #  RESTART TABLES.  THE ODD TABLES HAVE ONLY ONE ENTRY OF THREE LOCATIONS WHILE THE EVEN TABLES HAVE TWO ENTRIES
009788,000032:                                                                                                  #  EACH USING THREE LOCATIONS.  THE INFORMATION AS TO WHETHER IT IS A JOB, WAITLIST, OR A LONGCALL IS GIVEN BY THE
009789,000033:                                                                                                  #  WAY THINGS ARE PUT IN TO THE TABLES.
009790,000034: 
009791,000035:                                                                                                  #  A JOB HAS ITS PRIORITY STORED IN PRDTTAB OF THE CORRECT PHASE SPOT - A POSITIVE PRIORITY INDICATES A
009792,000036:                                                                                                  #  FINDVAC JOB, A NEGATIVE PRIORITY A NOVAC.  THE 2CADR OF THE JOB IS STORED IN THE CADRTAB.
009793,000037:                                                                                                  #  FOR EXAMPLE,
009794,000038: 
009795,000039:                                                                                                  #                5.7SPOT         OCT     23000
009796,000040:                                                                                                  #                                2CADR   SOMEJOB
009797,000041: 

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.

009801,000045:                                                                                                  #  A RESTART OF GROUP 5 WITH PHASE SEVEN WOULD THEN CAUSE SOMEJOB TO BE RESTARTED AS A FINDVAC WITH PRIORITY 23.
009802,000046: 
009803,000047:                                                                                                  #                5.5SPOT         OCT     -23000
009804,000048:                                                                                                  #                                2CADR   ANYJOB
009805,000049: 
009806,000050:                                                                                                  #  HERE A RESTART OF GROUP 5 WITH PHASE 7 WOULD CAUSE ANYJOB TO BE RESTARTED AS A NOVAC WITH PRIORITY 23.
009807,000051:                                                                                                  #  A LONGCALL HAS ITS GENADR OF ITS 2CADR STORED NEGATIVELY AND ITS BBCON STORED POSITIVELY.  IN ITS PRDTTAB IS
009808,000052:                                                                                                  #  PLACED THE LOCATION OF A DP REGISTER THAT CONTAINS THE DELTA TIME THAT LONGCALL HAD BEEN ORIGINALLY STARTED
009809,000053:                                                                                                  #  WITH.  EXAMPLE,
009810,000054: 
009811,000055:                                                                                                  #                3.6SPOT         GENADR  DELTAT
009812,000056:                                                                                                  #                                -GENADR LONGTASK
009813,000057:                                                                                                  #                                BBCON   LONGTASK
009814,000058:                                                                                                  #                                OCT     31000
009815,000059:                                                                                                  #                                2CADR   JOBAGAIN
009816,000060: 
009817,000061:                                                                                                  #  THIS WOULD START UP LONGTASK AT THE APPROPRIATE TIME, OR IMMEDIATELY IF THE TIME HAD ALREADY PASSED.  IT SHOULD
009818,000062:                                                                                                  #  BE NOTED THAT IF DELTAT IS IN A SWITCHED E BANK, THIS INFORMATOIN SHOULD BE IN THE BBCON OF THE 2CADR OF THE
009819,000063:                                                                                                  #  TASK.  FROM ABOVE, WE SEE THAT THE SECOND PART O FTHIS PHASE WOULD BE STARTED AS A JOB WITH A PRIORITY OF 31.
009820,000064: 
009821,000065:                                                                                                  #  WAITLIST CALLS ARE IDENTIFIED BY THE FACT THAT THEIR 2CADR IS STORED NEGATIVELY.  IF PRDTTAB OF THE PHASE SPOT
009822,000066:                                                                                                  #  IS POSITIVE, THEN IT CONTAINS THE DELTA TIME, IF PRDTTAB IS NEGATIVE THEN IT IS THE -GENADR OF AN ERASABLE
009823,000067:                                                                                                  #  LOCATION CONTAINING THE DELTA TIME, THAT IS, THE TIME IS STORED INDIRECTLY.  IT SHOULD BE NOTED AS ABOVE, THAT
009824,000068:                                                                                                  #  IF THE TIME IS STORED INDIRECTLY, THE BBCON MUST CONTAIN THE NECESSARY E BANK INFORMATION IF APPLICABLE.  WITH
009825,000069:                                                                                                  #  WAITLIST WE HAVE ONE FURTHER OPTION, IF -0 IS STORED IN PRDTTAB, IT WILL CAUSE AN IMMEDIATE RESTART OF THE
009826,000070:                                                                                                  #  TASK.  EXAMPLES,
009827,000071: 
009828,000072:                                                                                                  #                                OCT     77777           THIS WILL CAUSE AN IMMEDIATE RESTART
009829,000073:                                                                                                  #                                -2CADR  ATASK           OF THE TASK :ATASK:
009830,000074:                                                                                                  #        
009831,000075:                                                                                                  #                                DEC     200             IF THE TIME OF THE 2 SECONDS SINCE DUMMY
009832,000076:                                                                                                  #                                -2CADR  DUMMY           WAS PUT ON WAITLIST IS UP, IT WILL BEGIN
009833,000077:                                                                                                  #                                                        IN 10 MS, OTHERWISE IT WILL BEGIN WHEN
009834,000078:                                                                                                  #                                                        IT NORMALLY WOULD HAVE BEGUN.

Page 240

009836,000080:                                                                                                  #                                -GENADR DTIME           WHERE DTIME CONTAINS THE DELTA TIME
009837,000081:                                                                                                  #                                -2CADR  TASKTASK        OTHERWISE THIS IS AS ABOVE
009838,000082: 
009839,000083:                                                                                                  #  ***** NOW THE TABLES THEMSELVES *****
009840,000084: 
009841,000085: 01,2002                                           BANK     01                                    
009842,000086: 01,2000                                           SETLOC   RESTART                               
009843,000087: 01,2000                                           BANK                                           
009844,000088: 
009845,000089: 01,2002                        PRDTTAB            EQUALS   12000                                 #  USED TO FIND THE PRIORITY OR DELTATIME
009846,000090: 01,2002                        CADRTAB            EQUALS   12001                                 #  THIS AND THE NEXT RELATIVE LOC CONTAIN
009847,000091:                                                                                                  #  RESTART 2CADR
009848,000092: 
009849,000093: 01,2002                                           COUNT*   $$/RSTAB                              #  TABLES IN BANK 1.
009850,000094: 01,2002           00010        SIZETAB            TC       1.2SPOT    -12006                     
009851,000095: 01,2003           00020                           TC       1.3SPOT    -12004                     
009852,000096: 01,2004           00010                           TC       2.2SPOT    -12006                     
009853,000097: 01,2005           00026                           TC       2.3SPOT    -12004                     
009854,000098: 01,2006           00010                           TC       3.2SPOT    -12006                     
009855,000099: 01,2007           00056                           TC       3.3SPOT    -12004                     
009856,000100: 01,2010           00062                           TC       4.2SPOT    -12006                     
009857,000101: 01,2011           00072                           TC       4.3SPOT    -12004                     
009858,000102: 01,2012           00145                           TC       5.2SPOT    -12006                     
009859,000103: 01,2013           00163                           TC       5.3SPOT    -12004                     
009860,000104: 01,2014           00010                           TC       6.2SPOT    -12006                     
009861,000105: 01,2015           00174                           TC       6.3SPOT    -12004                     
009862,000106: 01,2016           21000        1.2SPOT            OCT      21000                                 #  A DUMMY EXAMPLE TO BE REPLACED AS SOON
009863,000107: 01,2017     0074                                  EBANK=   STATE                                 
009864,000108: 01,2017           05155 04060                     2CADR    ENDOFJOB                              #  AS THERE IS A LEGITIMATE 1.2SPOT
009865,000109: 
009866,000110: 01,2021           00144                           DEC      100        B-14                       
009867,000111: 01,2022     0074                                  EBANK=   STATE                                 
009868,000112: 01,2022           05261 04060                     2CADR    TASKOVER                              
009869,000113: 
009870,000114:                                                                                                  #  ANY MORE GROUP 1.EVEN RESTART VALUES SHOULD GO HERE
009871,000115: 
009872,000116: 01,2024           76300        1.3SPOT            -GENADR  SAVET-30                              
009873,000117: 01,2025  E7,1515                                  EBANK=   DVCNTR                                
009874,000118: 01,2025           75427 03710                     -2CADR   ULLGTASK                              
009875,000119: 
009876,000120: 01,2027           32000        1.5SPOT            OCT      32000                                 
009877,000121: 01,2030  E7,1654                                  EBANK=   HMEAS                                 
009878,000122: 01,2030           03630 66067                     2CADR    REREPOS                               
009879,000123: 
009880,000124:                                                                                                  #  ANY MORE GROUP 1.ODD RESTART VALUES SHOULD GO HERE
009881,000125: 
009882,000126: 01,2032  01,2016               2.2SPOT            EQUALS   1.2SPOT                               
009883,000127: 
009884,000128:                                                                                                  #  ANY MORE GROUP 2.EVEN RESTART VALUES SHOULD GO HERE
009885,000129: 
009886,000130: 01,2032           02627        2.3SPOT            GENADR   600SECS                               

Page 241

009888,000132: 01,2033           75175                           -GENADR  STATEINT                              
009889,000133: 01,2034  E3,1554                                  EBANK=   RRECTCSM                              
009890,000134: 01,2034           26063                           BBCON    STATEINT                              
009891,000135: 
009892,000136: 01,2035           05000        2.5SPOT            OCT      05000                                 
009893,000137: 01,2036  E3,1554                                  EBANK=   RRECTCSM                              
009894,000138: 01,2036           02611 26063                     2CADR    STATINT1                              
009895,000139: 
009896,000140: 01,2040           02734        2.7SPOT            DEC      1500       B-14                       
009897,000141: 01,2041  E7,1456                                  EBANK=   LOSCOUNT                              
009898,000142: 01,2041           75533 27710                     -2CADR   P20LEMC1                              
009899,000143: 
009900,000144: 01,2043           14000        2.11SPOT           OCT      14000                                 
009901,000145: 01,2044  E7,1762                                  EBANK=   P21TIME                               
009902,000146: 01,2044           02414 50067                     2CADR    P25LEM1                               
009903,000147: 
009904,000148: 01,2046           10000        2.13SPOT           OCT      10000                                 
009905,000149: 01,2047  E7,1456                                  EBANK=   LOSCOUNT                              
009906,000150: 01,2047           02223 54067                     2CADR    RELINUS                               
009907,000151: 
009908,000152: 01,2051           26000        2.15SPOT           OCT      26000                                 
009909,000153: 01,2052  E7,1456                                  EBANK=   LOSCOUNT                              
009910,000154: 01,2052           02654 50067                     2CADR    R22RSTRT                              
009911,000155: 
009912,000156: 01,2054           77777        2.17SPOT           OCT      77777                                 
009913,000157: 01,2055  E7,1700                                  EBANK=   VGPREV                                
009914,000158: 01,2055           75436 03710                     -2CADR   REDO2.17                              
009915,000159: 
009916,000160: 01,2057           00031        2.21SPOT           DEC      25         B-14                       
009917,000161: 01,2060  E7,1515                                  EBANK=   DVCNTR                                
009918,000162: 01,2060           75771 35710                     -2CADR   R10,R11                               
009919,000163: 
009920,000164:                                                                                                  #  ANY MORE GROUP 2.ODD RESTART VALUES SHOULD GO HERE.
009921,000165: 
009922,000166: 01,2062  01,2016               3.2SPOT            EQUALS   1.2SPOT                               
009923,000167: 
009924,000168:                                                                                                  #  ANY MORE GROUP 3.EVEN RESTART VALUES SHOULD GO HERE
009925,000169: 
009926,000170: 01,2062           76355        3.3SPOT            -GENADR  ZOOMTIME                              
009927,000171: 01,2063  E7,1515                                  EBANK=   DVCNTR                                
009928,000172: 01,2063           74110 05710                     -2CADR   ZOOM                                  
009929,000173: 
009930,000174: 01,2065           20000        3.5SPOT            OCT      20000                                 
009931,000175: 01,2066  E7,1453                                  EBANK=   TTOGO                                 
009932,000176: 01,2066           02540 56067                     2CADR    S40.13                                
009933,000177: 
009934,000178:                                                                                                  #  ANY MORE GROUP 3.ODD RESTART VALUES SHOULD GO HERE
009935,000179: 
009936,000180: 01,2070           04704        4.2SPOT            DEC      2500       B-14                       
009937,000181: 01,2071  E7,1453                                  EBANK=   TTOGO                                 

Page 242

009939,000183: 01,2071           75423 03710                     -2CADR   TIG-5                                 
009940,000184: 
009941,000185: 01,2073           77777                           OCT      77777                                 
009942,000186: 01,2074  E7,1453                                  EBANK=   TTOGO                                 
009943,000187: 01,2074           75433 03710                     -2CADR   REDO4.2                               
009944,000188: 
009945,000189:                                                                                                  #  ANY MORE GROUP 4.EVEN RESTART VALUES SHOULD GO HERE
009946,000190: 
009947,000191: 01,2076           25000        4.3SPOT            OCT      25000                                 
009948,000192: 01,2077  E7,1515                                  EBANK=   DVCNTR                                
009949,000193: 01,2077           03533 64067                     2CADR    GOABORT                               
009950,000194: 
009951,000195: 01,2101           00062        4.5SPOT            DEC      50         B-14                       
009952,000196: 01,2102  E7,1453                                  EBANK=   TTOGO                                 
009953,000197: 01,2102           75211 03710                     -2CADR   ULLAGOFF                              
009954,000198: 
009955,000199: 01,2104           00764        4.7SPOT            DEC      500        B-14                       
009956,000200: 01,2105  E7,1515                                  EBANK=   DVCNTR                                
009957,000201: 01,2105           75370 03710                     -2CADR   TIG-0                                 
009958,000202: 
009959,000203: 01,2107           76260        4.11SPOT           -GENADR  TGO        +1                         
009960,000204: 01,2110  E7,1515                                  EBANK=   DVCNTR                                
009961,000205: 01,2110           74231 03710                     -2CADR   ENGOFTSK                              
009962,000206: 
009963,000207: 01,2112           12000        4.13SPOT           OCT      12000                                 
009964,000208: 01,2113  E7,1462                                  EBANK=   TRKMKCNT                              
009965,000209: 01,2113           03227 74067                     2CADR    POSTBURN                              
009966,000210: 
009967,000211: 01,2115           00764        4.15SPOT           DEC      500        B-14                       
009968,000212: 01,2116  E7,1453                                  EBANK=   TTOGO                                 
009969,000213: 01,2116           75477 03710                     -2CADR   TIG-30                                
009970,000214: 
009971,000215: 01,2120           77777        4.17SPOT           OCT      77777                                 
009972,000216: 01,2121  E7,1515                                  EBANK=   DVCNTR                                
009973,000217: 01,2121           75423 03710                     -2CADR   TIG-5                                 
009974,000218: 
009975,000219: 01,2123           13000        4.21SPOT           OCT      13000                                 
009976,000220: 01,2124  E5,1730                                  EBANK=   STAR                                  
009977,000221: 01,2124           03012 30065                     2CADR    R51.1      +1                         
009978,000222: 
009979,000223: 01,2126           77777        4.23SPOT           OCT      77777                                 
009980,000224: 01,2127  E7,1515                                  EBANK=   DVCNTR                                
009981,000225: 01,2127           75345 03710                     -2CADR   IGNITION                              
009982,000226: 
009983,000227: 01,2131           01477        4.25SPOT           GENADR   SAVET-30                              
009984,000228: 01,2132           75535                           -GENADR  TIG-35                                
009985,000229: 01,2133  E7,1477                                  EBANK=   SAVET-30                              
009986,000230: 01,2133           74067                           BBCON    TIG-35                                
009987,000231: 

Page 243

009989,000233: 01,2134           52777        4.27SPOT           OCT      52777                                 
009990,000234: 01,2135  E7,1515                                  EBANK=   DVCNTR                                
009991,000235: 01,2135           02070 42067                     2CADR    P70A                                  
009992,000236: 
009993,000237: 01,2137           52777        4.31SPOT           OCT      52777                                 
009994,000238: 01,2140  E7,1515                                  EBANK=   DVCNTR                                
009995,000239: 01,2140           02073 42067                     2CADR    P71A                                  
009996,000240: 
009997,000241: 01,2142           46777        4.33SPOT           OCT      46777                                 
009998,000242: 01,2143  E7,1515                                  EBANK=   DVCNTR                                
009999,000243: 01,2143           02024 10067                     2CADR    GOPOOFIX                              
010000,000244: 
010001,000245: 01,2145           46777        4.35SPOT           OCT      46777                                 
010002,000246: 01,2146  E7,1515                                  EBANK=   DVCNTR                                
010003,000247: 01,2146           05655 04067                     2CADR    GOPOODOO                              
010004,000248: 
010005,000249: 01,2150           52777        4.37SPOT           OCT      52777                                 
010006,000250: 01,2151  E7,1455                                  EBANK=   WHICH                                 
010007,000251: 01,2151           02575 74067                     2CADR    COMFAIL                               
010008,000252: 
010009,000253:                                                                                                  #  ANY MORE 4.ODD RESTART VALUES SHOULD GO HERE.
010010,000254: 01,2153           22000        5.2SPOT            OCT      22000                                 
010011,000255: 01,2154  E7,1515                                  EBANK=   DVCNTR                                
010012,000256: 01,2154           02463 46067                     2CADR    NORMLIZE                              
010013,000257: 
010014,000258: 01,2156           00310                           DEC      200        B-14                       
010015,000259: 01,2157  E7,1515                                  EBANK=   DVCNTR                                
010016,000260: 01,2157           74166 01710                     -2CADR   REREADAC                              
010017,000261: 
010018,000262: 01,2161           00310        5.4SPOT            DEC      200        B-14                       
010019,000263: 01,2162  E7,1515                                  EBANK=   DVCNTR                                
010020,000264: 01,2162           74166 01710                     -2CADR   REREADAC                              
010021,000265: 
010022,000266: 01,2164           20000                           OCT      20000                                 
010023,000267: 01,2165  E7,1515                                  EBANK=   DVCNTR                                
010024,000268: 01,2165           02206 66067                     2CADR    SERVICER                              
010025,000269: 
010026,000270:                                                                                                  #  ANY MORE GROUP 5.EVEN RESTART VALUES SHOULD GO HERE
010027,000271: 
010028,000272: 01,2167           00310        5.3SPOT            DEC      200        B-14                       
010029,000273: 01,2170  E7,1515                                  EBANK=   DVCNTR                                
010030,000274: 01,2170           74166 01710                     -2CADR   REREADAC                              
010031,000275: 
010032,000276: 01,2172           77777        5.5SPOT            OCT      77777                                 
010033,000277: 01,2173  E7,1515                                  EBANK=   DVCNTR                                
010034,000278: 01,2173           74326 01710                     -2CADR   REDO5.5                               
010035,000279: 

Page 244

010037,000281: 01,2175           77777        5.7SPOT            OCT      77777                                 
010038,000282: 01,2176  E7,1515                                  EBANK=   DVCNTR                                
010039,000283: 01,2176           74361 01710                     -2CADR   BIBIBIAS                              
010040,000284: 
010041,000285:                                                                                                  #  ANY MORE GROUP 5.ODD RESTART VALUES SHOULD GO HERE
010042,000286: 
010043,000287: 01,2200  01,2016               6.2SPOT            EQUALS   1.2SPOT                               
010044,000288: 01,2200           00144        6.3SPOT            DEC      100        B-14                       
010045,000289: 01,2201  E7,1441                                  EBANK=   TIG                                   
010046,000290: 01,2201           75054 03710                     -2CADR   CLOKTASK                              
010047,000291: 
010048,000292: 01,2203           30000        6.5SPOT            OCT      30000                                 #  PROTECT INCREMENTING OF TIME2,TIME1 BY
010049,000293: 01,2204  E3,1706                                  EBANK=   TEPHEM                                #  P27(UPDATE PROGRAM) VIA V70 OR V73.
010050,000294: 01,2204           03557 10063                     2CADR    TIMEDIDR                              
010051,000295: 
010052,000296: 01,2206           17000        6.7SPOT            OCT      17000                                 
010053,000297: 01,2207  E7,1700                                  EBANK=   VGPREV                                
010054,000298: 01,2207           03354 74067                     2CADR    REDO6.7                               
010055,000299: 
010056,000300: 

End of include-file RESTART_TABLES.agc.  Parent file is MAIN.agc