Source Code

These source code files are a reconstruction of Sundance, the Apollo 9 LM (Lunar Module) AGC (Apollo Guidance Computer) flight software, created from binary dumps of original core rope program modules, as follows:
  • B1 — Revision 292
  • B2 — Revision 302
  • B3 — Revision 302
  • B4 — Revision 302
  • B5 — Revision 292
  • B6 — Revision 306
This means that source code does not represent a specific historical revision of Sundance, but rather a mixture of the three released versions. Nonetheless, it is capable of flying the whole Apollo 9 mission. This source code matches the binary dumps, as closely as feasible, but 100% match is not possible, due mostly to changes in memory addresses at which code and variables were allocated in different revisions of Sundance. Refer to this list of explanations for each binary mismatch.

Since only binary dumps (rather than listings) of Sundance are available as source material, all comments and labels are approximate. They have been taken from other AGC programs where possible, or, in some places, written from scratch to match what we believe would have been in the original listing.

008657,000002:                                                                                                  ## Copyright:   Public domain.
008658,000003:                                                                                                  ## Filename:    RESTART_TABLES.agc
008659,000004:                                                                                                  ## Purpose:     A section of a reconstructed, mixed version of Sundance
008660,000005:                                                                                                  ##              It is part of the reconstructed source code for the Lunar
008661,000006:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 9.
008662,000007:                                                                                                  ##              No original listings of this program are available;
008663,000008:                                                                                                  ##              instead, this file was created via disassembly of dumps
008664,000009:                                                                                                  ##              of various revisions of Sundance core rope modules.
008665,000010:                                                                                                  ## Assembler:   yaYUL
008666,000011:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
008667,000012:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
008668,000013:                                                                                                  ## Mod history: 2020-06-17 MAS  Created from Luminary 69.
008669,000014: 
008670,000015:                                                                                                  ## Sundance 292
008671,000016: 
008672,000017:                                                                                                  #  RESTART TABLES
008673,000018: 
008674,000019:                                                                                                  #  ------------------
008675,000020: 
008676,000021:                                                                                                  #  THERE ARE TWO FORMS OF RESTART TABLES FOR EACH GROUP.  THEY ARE KNOWN AS THE EVEN RESTART TABLES AND THE ODD
008677,000022:                                                                                                  #  RESTART TABLES.  THE ODD TABLES HAVE ONLY ONE ENTRY OF THREE LOCATIONS WHILE THE EVEN TABLES HAVE TWO ENTRIES
008678,000023:                                                                                                  #  EACH USING THREE LOCATIONS. THE INFORMATION AS TO WHETHER IT IS A JOB, WAITLIST, OR A LONGCALL IS GIVEN BY THE
008679,000024:                                                                                                  #  WAY THINGS ARE PUT INTO THE TABLES.
008680,000025:                                                                                                  #       A JOB HAS ITS PRIORITY STORED IN PRDTTAB OF THE CORRECT PHASE SPOT - A POSITIVE PRIORITY INDICATES A
008681,000026:                                                                                                  #  FINDVAC JOB, A NEGATIVE PRIORITY A NOVAC.  THE 2CADR OF THE JOB IS STORED IN THE CADRTAB.
008682,000027:                                                                                                  #  FOR EXAMPLE,
008683,000028: 
008684,000029:                                                                                                  #                                          5.7SPOT  OCT    23000
008685,000030:                                                                                                  #                                                   2CADR  SOMEJOB
008686,000031: 
008687,000032:                                                                                                  #  A RESTART OF GROUP 5 WITH PHASE SEVEN WOULD THEN CAUSE SOMEJOB TO BE RESTARTED AS A FINDVAC WITH PRIORITY 23.
008688,000033: 
008689,000034:                                                                                                  #                                          5.5SPOT  OCT    -23000
008690,000035:                                                                                                  #                                                   2CADR  ANYJOB
008691,000036: 
008692,000037:                                                                                                  #  HERE A RESTART OF GROUP 5 WITH PHASE 7 WOULD CAUSE ANYJOB TO BE RESTARTED AS A NOVAC WITH PRIORITY 23.
008693,000038:                                                                                                  #  A LONGCALL HAS ITS GENADR OF ITS 2CADR STORED NEGATIVELY AND ITS BBCON STORED POSITIVELY.  IN ITS PRDTTAB IS
008694,000039:                                                                                                  #  PLACED THE LOCATION OF A DP REGISTER THAT CONTAINS THE DELTA TIME THAT LONGCALL HAD BEEN ORIGINALLY STARTED
008695,000040:                                                                                                  #  WITH.  EXAMPLE,
008696,000041: 
008697,000042:                                                                                                  #                                          3.6SPOT  GENADR DELTAT
008698,000043:                                                                                                  #                                                  -GENADR LONGTASK
008699,000044:                                                                                                  #                                                   BBCON  LONGTASK
008700,000045: 
008701,000046:                                                                                                  #                                                   OCT    31000
008702,000047:                                                                                                  #                                                   2CADR  JOBAGAIN
008703,000048: 
008704,000049:                                                                                                  #  THIS WOULD START UP LONGTASK AT THE APPROPRIATE TIME, OR IMMEDIATELY IF THE TIME HAD ALREADY PASSED. IT SHOULD
008705,000050:                                                                                                  #  BE NOTED THAT IF DELTAT IS IN A SWITCHED E BANK, THIS INFORMATOIN SHOULD BE IN THE BBCON OFTHE 2CADR OF THE
008706,000051:                                                                                                  #  TASK.  FROM ABOVE, WE SEE THAT THE SECOND PART OF THIS PHASE WOULD BE STARTED AS A JOB WITH A PRIORITY OF 31.
008707,000052: 
008708,000053:                                                                                                  #  WAITLIST CALLS ARE IDENTIFIED BY THE FACT THAT THEIR 2CADR IS STORED NEGATIVELY. IF PRDTTAB OF THE PHASE SPOT
008709,000054:                                                                                                  #  IS POSITIVE, THEN IT CONTAINS THE DELTA TIME, IF PRDTTAB IS NEGATIVE THEN IT IS THE -GENADR OF AN ERASABLE
008710,000055:                                                                                                  #  LOCATION CONTAINING THE DELTA TIME, THAT IS, THE TIME IS STORED INDIRECTLY.  IT SHOULD BE NOTED AS ABOVE, THAT
008711,000056:                                                                                                  #  IF THE TIME IS STORED INDIRECTLY, THE BBCON MUST CONTAIN THE NECESSARY E BANK INFORMATION IF APPLICABLE.  WITH
008712,000057:                                                                                                  #  WAITLIST WE HAVE ONE FURTHER OPTION, IF -0 IS STORED IN PRDTTAB, IT WILL CAUSE AN IMMEDIATE RESTART OF THE
008713,000058:                                                                                                  #  TASK.  EXAMPLES,
008714,000059: 
008715,000060:                                                                                                  #                                                   OCT    77777           THIS WILL CAUSE AN IMMEDIATE RESTART
008716,000061:                                                                                                  #                                                  -2CADR  ATASK           OF THE TASK :ATASK:
008717,000062: 
008718,000063:                                                                                                  #                                                   DEC    200             IF THE TIME OF THE 2 SECONDS SINCE DUMMY
008719,000064:                                                                                                  #                                                  -2CADR  DUMMY           WAS PUT ON WAITLIST IS UP, IT WILL BEGIN
008720,000065:                                                                                                  #                                                                          IN 10 MS, OTHERWISE IT WILL BEGIN WHEN
008721,000066:                                                                                                  #                                                                          IT NORMALLY WOULD HAVE BEGUN.
008722,000067: 
008723,000068:                                                                                                  #                                                  -GENADR DTIME           WHERE DTIME CONTAINS THE DELTA TIME
008724,000069:                                                                                                  #                                                  -2CADR  TASKTASK        OTHERWISE THIS IS AS ABOVE
008725,000070: 
008726,000071:                                                                                                  #  *****    NOW THE TABLES THEMSELVES *****
008727,000072: 
008728,000073: 01,2000                                           BANK     01                                    
008729,000074: 01,2000                                           SETLOC   RESTART                               
008730,000075: 01,2000                                           BANK                                           
008731,000076: 
008732,000077: 01,2000                        PRDTTAB            EQUALS   12000                                 #  USED TO FIND THE PRIORITY OR DELTATIME
008733,000078: 01,2000                        CADRTAB            EQUALS   12001                                 #  THIS AND THE NEXT RELATIVE LOC CONTAIN
008734,000079:                                                                                                  #  RESTART 2CADR
008735,000080: 
008736,000081: 01,2000                                           COUNT*   $$/RSTAB                              #  TABLES IN BANK 1.
008737,000082: 01,2000           00006        SIZETAB            TC       1.2SPOT    -12006                     
008738,000083: 01,2001           00016                           TC       1.3SPOT    -12004                     
008739,000084: 01,2002           00006                           TC       2.2SPOT    -12006                     
008740,000085: 01,2003           00024                           TC       2.3SPOT    -12004                     
008741,000086: 01,2004           00006                           TC       3.2SPOT    -12006                     
008742,000087: 01,2005           00046                           TC       3.3SPOT    -12004                     
008743,000088: 01,2006           00047                           TC       4.2SPOT    -12006                     
008744,000089: 01,2007           00057                           TC       4.3SPOT    -12004                     
008745,000090: 01,2010           00113                           TC       5.2SPOT    -12006                     
008746,000091: 01,2011           00137                           TC       5.3SPOT    -12004                     
008747,000092: 01,2012           00006                           TC       6.2SPOT    -12006                     
008748,000093: 01,2013           00150                           TC       6.3SPOT    -12004                     
008749,000094: 01,2014           21000        1.2SPOT            OCT      21000                                 #  A DUMMY EXAMPLE TO BE REPLACED AS SOON
008750,000095: 01,2015     0074                                  EBANK=   STATE                                 
008751,000096: 01,2015           05225 04060                     2CADR    ENDOFJOB                              #  AS THERE IS A LEGITIMATE 1.2SPOT
008752,000097: 01,2017           00144                           DEC      100        B-14                       
008753,000098: 01,2020     0074                                  EBANK=   STATE                                 
008754,000099: 01,2020           05321 04060                     2CADR    TASKOVER                              
008755,000100: 
008756,000101:                                                                                                  #  ANY MORE GROUP 1.EVEN RESTART VALUES SHOULD GO HERE
008757,000102: 
008758,000103: 01,2022           76321        1.3SPOT            -GENADR  SAVET-30                              
008759,000104: 01,2023  E7,1472                                  EBANK=   DVCNTR                                
008760,000105: 01,2023           75401 03710                     -2CADR   ULLGTASK                              
008761,000106: 01,2025           10000        1.5SPOT            OCT      10000                                 
008762,000107: 01,2026  E7,1702                                  EBANK=   VG                                    
008763,000108: 01,2026           03071 56067                     2CADR    S40.9                                 
008764,000109:                                                                                                  #  ANY MORE GROUP 1.ODD RESTART VALUES SHOULD GO HERE
008765,000110: 
008766,000111: 01,2030  01,2014               2.2SPOT            EQUALS   1.2SPOT                               
008767,000112:                                                                                                  #  ANY MORE GROUP 2.EVEN RESTART VALUES SHOULD GO HERE
008768,000113: 
008769,000114: 01,2030           02606        2.3SPOT            GENADR   600SECS                               
008770,000115: 01,2031           75215                           -GENADR  STATEINT                              
008771,000116: 01,2032  E3,1554                                  EBANK=   RRECTCSM                              
008772,000117: 01,2032           26063                           BBCON    STATEINT                              
008773,000118: 
008774,000119: 01,2033           05000        2.5SPOT            OCT      05000                                 
008775,000120: 01,2034  E3,1554                                  EBANK=   RRECTCSM                              
008776,000121: 01,2034           02571 26063                     2CADR    STATINT1                              
008777,000122: 01,2036           02734        2.7SPOT            DEC      1500       B-14                       
008778,000123: 01,2037  E7,1433                                  EBANK=   LOSCOUNT                              
008779,000124: 01,2037           75565 27710                     -2CADR   P20LEMC1                              
008780,000125: 
008781,000126: 01,2041           14000        2.11SPOT           OCT      14000                                 
008782,000127: 01,2042  E7,1745                                  EBANK=   P21TIME                               
008783,000128: 01,2042           02367 50067                     2CADR    P25LEM1                               
008784,000129: 01,2044           10000        2.13SPOT           OCT      10000                                 
008785,000130: 01,2045  E7,1433                                  EBANK=   LOSCOUNT                              
008786,000131: 01,2045           02232 54067                     2CADR    RELINUS                               
008787,000132: 01,2047           26000        2.15SPOT           OCT      26000                                 
008788,000133: 01,2050  E7,1433                                  EBANK=   LOSCOUNT                              
008789,000134: 01,2050           02634 50067                     2CADR    R22RSTRT                              
008790,000135:                                                                                                  #  ANY MORE GROUP 2.ODD RESTART VALUES SHOULD GO HERE.
008791,000136: 
008792,000137: 01,2052  01,2014               3.2SPOT            EQUALS   1.2SPOT                               
008793,000138:                                                                                                  #  ANY MORE GROUP 3.EVEN RESTART VALUES SHOULD GO HERE
008794,000139: 
008795,000140: 01,2052           76356        3.3SPOT            -GENADR  ZOOMTIME                              
008796,000141: 01,2053  E7,1472                                  EBANK=   DVCNTR                                
008797,000142: 01,2053           75211 03710                     -2CADR   ZOOM                                  
008798,000143:                                                                                                  #  ANY MORE GROUP 3.ODD RESTART VALUES SHOULD GO HERE
008799,000144: 
008800,000145: 01,2055           04704        4.2SPOT            DEC      2500       B-14                       
008801,000146: 01,2056  E7,1426                                  EBANK=   TTOGO                                 
008802,000147: 01,2056           75375 03710                     -2CADR   TIG-5                                 
008803,000148: 01,2060           77777                           OCT      77777                                 
008804,000149: 01,2061  E7,1426                                  EBANK=   TTOGO                                 
008805,000150: 01,2061           75405 03710                     -2CADR   REDO4.2                               
008806,000151:                                                                                                  #  ANY MORE GROUP 4.EVEN RESTART VALUES SHOULD GO HERE
008807,000152: 
008808,000153: 01,2063           00000        4.3SPOT            OCT      0                                     
008809,000154: 01,2064           00000                           OCT      0                                     
008810,000155: 01,2065           00000                           OCT      0                                     
008811,000156: 01,2066           00062        4.5SPOT            DEC      50         B-14                       
008812,000157: 01,2067  E7,1426                                  EBANK=   TTOGO                                 
008813,000158: 01,2067           75225 03710                     -2CADR   ULLAGOFF                              
008814,000159: 01,2071           00764        4.7SPOT            DEC      500        B-14                       
008815,000160: 01,2072  E7,1472                                  EBANK=   DVCNTR                                
008816,000161: 01,2072           75351 03710                     -2CADR   TIG-0                                 
008817,000162: 01,2074           76303        4.11SPOT           -GENADR  TGO        +1                         
008818,000163: 01,2075  E7,1472                                  EBANK=   DVCNTR                                
008819,000164: 01,2075           74240 03710                     -2CADR   ENGOFTSK                              
008820,000165: 01,2077           12000        4.13SPOT           OCT      12000                                 
008821,000166: 01,2100  E7,1447                                  EBANK=   TRKMKCNT                              
008822,000167: 01,2100           03206 74067                     2CADR    POSTBURN                              
008823,000168: 
008824,000169: 01,2102           00764        4.15SPOT           DEC      500        B-14                       
008825,000170: 01,2103  E7,1426                                  EBANK=   TTOGO                                 
008826,000171: 01,2103           75444 03710                     -2CADR   TIG-30                                
008827,000172: 01,2105           77777        4.17SPOT           OCT      77777                                 
008828,000173: 01,2106  E7,1472                                  EBANK=   DVCNTR                                
008829,000174: 01,2106           75375 03710                     -2CADR   TIG-5                                 
008830,000175: 01,2110           13000        4.21SPOT           OCT      13000                                 
008831,000176: 01,2111  E5,1730                                  EBANK=   STAR                                  
008832,000177: 01,2111           02322 30065                     2CADR    R51.1      +1                         
008833,000178: 01,2113           77777        4.23SPOT           OCT      77777                                 
008834,000179: 01,2114  E7,1472                                  EBANK=   DVCNTR                                
008835,000180: 01,2114           75331 03710                     -2CADR   IGNITION                              
008836,000181: 01,2116           01456        4.25SPOT           GENADR   SAVET-30                              
008837,000182: 01,2117           75502                           -GENADR  TIG-35                                
008838,000183: 01,2120  E7,1456                                  EBANK=   SAVET-30                              
008839,000184: 01,2120           74067                           BBCON    TIG-35                                
008840,000185:                                                                                                  #  ANY MORE 4.ODD RESTART VALUES SHOULD GO HERE.
008841,000186: 
008842,000187: 01,2121           22000        5.2SPOT            OCT      22000                                 
008843,000188: 01,2122  E7,1472                                  EBANK=   DVCNTR                                
008844,000189: 01,2122           02355 66067                     2CADR    NORMLIZE                              
008845,000190: 01,2124           00310                           DEC      200        B-14                       
008846,000191: 01,2125  E7,1472                                  EBANK=   DVCNTR                                
008847,000192: 01,2125           75310 11710                     -2CADR   REREADAC                              
008848,000193: 
008849,000194: 01,2127           00310        5.4SPOT            DEC      200        B-14                       
008850,000195: 01,2130  E7,1472                                  EBANK=   DVCNTR                                
008851,000196: 01,2130           75310 11710                     -2CADR   REREADAC                              
008852,000197: 
008853,000198: 01,2132           20000                           OCT      20000                                 
008854,000199: 01,2133  E7,1472                                  EBANK=   DVCNTR                                
008855,000200: 01,2133           02127 66067                     2CADR    SERVICER                              
008856,000201: 
008857,000202: 01,2135           45777        5.6SPOT            OCT      45777                                 
008858,000203: 01,2136  E3,1460                                  EBANK=   NBDX                                  
008859,000204: 01,2136           03651 14063                     2CADR    NORMBIAS                              
008860,000205: 
008861,000206: 01,2140           00310                           DEC      200        B-14                       
008862,000207: 01,2141  E7,1472                                  EBANK=   DVCNTR                                
008863,000208: 01,2141           75310 11710                     -2CADR   REREADAC                              
008864,000209:                                                                                                  #  ANY MORE GROUP 5.EVEN RESTART VALUES SHOULD GO HERE
008865,000210: 
008866,000211: 01,2143           00310        5.3SPOT            DEC      200        B-14                       
008867,000212: 01,2144  E7,1472                                  EBANK=   DVCNTR                                
008868,000213: 01,2144           75310 11710                     -2CADR   REREADAC                              
008869,000214: 
008870,000215: 01,2146           77777        5.5SPOT            OCT      77777                                 
008871,000216: 01,2147  E7,1472                                  EBANK=   DVCNTR                                
008872,000217: 01,2147           75712 11710                     -2CADR   REDO5.5                               
008873,000218: 
008874,000219: 01,2151           77777        5.7SPOT            OCT      77777                                 
008875,000220: 01,2152  E7,1472                                  EBANK=   DVCNTR                                
008876,000221: 01,2152           75770 11710                     -2CADR   BIBIBIAS                              
008877,000222:                                                                                                  #  ANY MORE GROUP 5.ODD RESTART VALUES SHOULD GO HERE
008878,000223: 
008879,000224: 01,2154  01,2014               6.2SPOT            EQUALS   1.2SPOT                               
008880,000225: 01,2154           00144        6.3SPOT            DEC      100        B-14                       
008881,000226: 01,2155  E7,1424                                  EBANK=   TIG                                   
008882,000227: 01,2155           75070 03710                     -2CADR   CLOKTASK                              
008883,000228: 01,2157           30000        6.5SPOT            OCT      30000                                 #  PROTECT INCREMENTING OF TIME2,TIME1 BY
008884,000229: 01,2160  E3,1706                                  EBANK=   TEPHEM                                #  P27(UPDATE PROGRAM) VIA V70 OR V73.
008885,000230: 01,2160           03417 10063                     2CADR    TIMEDIDR                              
008886,000231: 01,2162           17000        6.7SPOT            OCT      17000                                 
008887,000232: 01,2163  E7,1673                                  EBANK=   VGPREV                                
008888,000233: 01,2163           03333 74067                     2CADR    REDO6.7                               

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