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.

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

Page 239

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

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

Page 240

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

Page 241

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

Page 242

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

Page 243

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

Page 244

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

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