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.

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

Page 239

009801,000027:                                                                                                  #  RESTART TABLES
009802,000028:                                                                                                  #  ------------------
009803,000029: 
009804,000030:                                                                                                  #  THERE ARE TWO FORMS OF RESTART TABLES FOR EACH GROUP.  THEY ARE KNOWN AS THE EVEN RESTART TABLES AND THE ODD
009805,000031:                                                                                                  #  RESTART TABLES.  THE ODD TABLES HAVE ONLY ONE ENTRY OF THREE LOCATIONS WHILE THE EVEN TABLES HAVE TWO ENTRIES
009806,000032:                                                                                                  #  EACH USING THREE LOCATIONS.  THE INFORMATION AS TO WHETHER IT IS A JOB, WAITLIST, OR A LONGCALL IS GIVEN BY THE
009807,000033:                                                                                                  #  WAY THINGS ARE PUT IN TO THE TABLES.
009808,000034: 
009809,000035:                                                                                                  #  A JOB HAS ITS PRIORITY STORED IN PRDTTAB OF THE CORRECT PHASE SPOT - A POSITIVE PRIORITY INDICATES A
009810,000036:                                                                                                  #  FINDVAC JOB, A NEGATIVE PRIORITY A NOVAC.  THE 2CADR OF THE JOB IS STORED IN THE CADRTAB.
009811,000037:                                                                                                  #  FOR EXAMPLE,
009812,000038: 
009813,000039:                                                                                                  #                5.7SPOT         OCT     23000
009814,000040:                                                                                                  #                                2CADR   SOMEJOB
009815,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.

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

Page 240

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

Page 241

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

Page 242

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

Page 243

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

Page 244

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

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