Source Code

These source code files are an attempted reconstruction of Sundance revision 306, 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
These dumps were then modified using memos, checklists, observed address changes, and the Sundance GSOPs to get the entire program to match Sundance revision 306 as closely as possible. Without more information, it is not possible to say how close it actually is; however, this code should be quite close. It is capable of flying the whole Apollo 9 mission using the original checklists and padload. 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.

042299,000002:                                                                                                  ## Copyright:   Public domain.
042300,000003:                                                                                                  ## Filename:    FIXED-FIXED_CONSTANT_POOL.agc
042301,000004:                                                                                                  ## Purpose:     A section of an attempt to reconstruct Sundance revision 306
042302,000005:                                                                                                  ##              as closely as possible with available information. Sundance
042303,000006:                                                                                                  ##              306 is the source code for the Lunar Module's (LM) Apollo
042304,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 9. This program was created
042305,000008:                                                                                                  ##              using the mixed-revision SundanceXXX as a starting point, and
042306,000009:                                                                                                  ##              pulling back features from Luminary 69 believed to have been
042307,000010:                                                                                                  ##              added based on memos, checklists, observed address changes,
042308,000011:                                                                                                  ##              or the Sundance GSOPs.
042309,000012:                                                                                                  ## Assembler:   yaYUL
042310,000013:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
042311,000014:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
042312,000015:                                                                                                  ## Mod history: 2020-07-24 MAS  Created from SundanceXXX.
042313,000016: 
042314,000017: 
042315,000018: 
042316,000019:    5005                                           BLOCK    02                                    
042317,000020:    5005                                           COUNT*   $$/FCONS                              
042318,000021: 
042319,000022:                                                                                                  #  THE FOLLOWING TABLE OF 18 VALUES IS INDEXED.  DO NOT INSERT OR REMOVE ANY QUANTITIES.
042320,000023: 
042321,000024:    5005           37777        DPOSMAX            OCT      37777                                 #  MUST PRECEDE POSMAX
042322,000025:    5006           37777        POSMAX             OCT      37777                                 
042323,000026: 
042324,000027:    5007     5007               LIMITS             =        NEG1/2                                
042325,000028: 
042326,000029:    5007           57777        NEG1/2             OCT      -20000                                #  USED BY SIN ROUTINE (MUST BE TWO 
042327,000030:                                                                                                  #  LOCATIONS IN FRONT OF BIT14)
042328,000031: 
042329,000032:                                                                                                  #  BIT TABLE                                     
042330,000033: 
042331,000034:    5010           40000        BIT15              OCT      40000                                 
042332,000035:    5011           20000        BIT14              OCT      20000                                 
042333,000036:    5012           10000        BIT13              OCT      10000                                 
042334,000037:    5013           04000        BIT12              OCT      04000                                 
042335,000038:    5014           02000        BIT11              OCT      02000                                 
042336,000039:    5015           01000        BIT10              OCT      01000                                 
042337,000040:    5016           00400        BIT9               OCT      00400                                 
042338,000041:    5017           00200        BIT8               OCT      00200                                 
042339,000042:    5020           00100        BIT7               OCT      00100                                 
042340,000043:    5021           00040        BIT6               OCT      00040                                 
042341,000044:    5022           00020        BIT5               OCT      00020                                 
042342,000045:    5023           00010        BIT4               OCT      00010                                 
042343,000046:    5024           00004        BIT3               OCT      00004                                 
042344,000047:    5025           00002        BIT2               OCT      00002                                 
042345,000048:    5026           00001        BIT1               OCT      00001                                 
042346,000049: 
042347,000050:                                                                                                  #  DO NOT DESTROY THIS COMBINATION, SINCE IT IS USED IN DOUBLE PRECISION INSTRUCTIONS.
042348,000051:    5027           77777        NEG0               OCT      -0                                    #  MUST PRECEDE ZERO
042349,000052:    5030           00000        ZERO               OCT      0                                     #  MUST FOLLOW NEG0
042350,000053:                                                                                                  #  BIT1          OCT     00001
042351,000054:                                                                                                  #  NO.WDS        OCT     2               INTERPRETER
042352,000055:                                                                                                  #  OCTAL3        OCT     3               INTERPRETER
042353,000056:                                                                                                  #  R3D1          OCT     4               PINBALL
042354,000057:    5031           00005        FIVE               OCT      5                                     
042355,000058:                                                                                                  #  REVCNT        OCT     6               INTERPRETER
042356,000059:    5032           00007        SEVEN              OCT      7                                     
042357,000060:                                                                                                  #  BIT4          OCT     00010
042358,000061:                                                                                                  #  R2D1          OCT     11              PINBALL
042359,000062:    5033     4332               OCT11              =        R2D1                                  #  P20S
042360,000063:                                                                                                  #  BINCON        DEC     10              PINBALL         (OCTAL 12)
042361,000064:    5033           00013        ELEVEN             DEC      11         B-14                       
042362,000065:                                                                                                  #  OCT14         OCT     14              ALARM AND ABORT (FILLER)
042363,000066:    5034           00015        OCT15              OCT      15                                    
042364,000067:                                                                                                  #  R1D1          OCT     16              PINBALL
042365,000068:    5035           00017        LOW4               OCT      17                                    
042366,000069:                                                                                                  #  BIT5          OCT     00020
042367,000070:                                                                                                  #  ND1           OCT     21              PINBALL
042368,000071:                                                                                                  #  VD1           OCT     23              PINBALL
042369,000072:                                                                                                  #  OCT24         OCT     24              SERVICE ROUTINES
042370,000073:                                                                                                  #  MD1           OCT     25              PINBALL
042371,000074:                                                                                                  #  OCT31         OCT     31              SERVICE ROUTINES
042372,000075:    5036           00032        CALLCODE           OCT      00032                                 
042373,000076:                                                                                                  #  LOW5          OCT     37              PINBALL
042374,000077:                                                                                                  #  33DEC         DEC     33              PINBALL         (OCTAL 41)
042375,000078:                                                                                                  #  34DEC         DEC     34              PINBALL         (OCTAL 42)
042376,000079:    5037           00045        TBUILDFX           DEC      37         B-14                       #  BUILDUP FOR CONVIENCE IN DAPTESTING
042377,000080:    5040           00046        TDECAYFX           DEC      38         B-14                       #  CONVENIENCE FOR DAPTESTING
042378,000081:                                                                                                  #  BIT6          OCT     00040
042379,000082:    5041           00050        OCT50              OCT      50                                    
042380,000083:    5042           00055        DEC45              DEC      45         B-14                       
042381,000084:    5043           00060        SUPER011           OCT      60                                    #  BITS FOR SUPERBNK SETTING 011.
042382,000085:    5044           00062        .5SEC              DEC      50         B-14                       
042383,000086:                                                                                                  #  BIT7          OCT     00100
042384,000087: 
042385,000088:    5045     5020               SUPER100           =        BIT7                                  #  BITS FOR SUPERBNK SETTING 100
042386,000089:                                                                                                  #  (LAST 4K OF ROPE)
042387,000090:    5045           00120        SUPER101           OCT      120                                   #  BITS FOR SUPERBNK SETTING 101
042388,000091:                                                                                                  #  OCT121        OCT     121             SERVICE ROUTINES
042389,000092:                                                                                                  #  (FIRST 8K OF ACM)
042390,000093:    5046           00140        SUPER110           OCT      140                                   #  BITS FOR SUPERBNK SETTING 110.
042391,000094:                                                                                                  #  (LAST 8K OF ACM)
042392,000095:    5047           00144        1SEC               DEC      100        B-14                       
042393,000096:                                                                                                  #  LOW7          OCT     177             INTERPRETER
042394,000097:                                                                                                  #  BIT8          OCT     00200
042395,000098:                                                                                                  #  OT215         OCT     215             ALARM AND ABORT
042396,000099:                                                                                                  #  8,5           OCT     00220           P20-P25 SUNDANCE
042397,000100:    5050           00310        2SECS              DEC      200        B-14                       
042398,000101:                                                                                                  #  LOW8          OCT     377             PINBALL
042399,000102:                                                                                                  #  BIT9          OCT     00400
042400,000103:    5051           00401        GN/CCODE           OCT      00401                                 #  SET S/C CONTROL SWITCH TO G/N
042401,000104:    5052           00454        3SECS              DEC      300        B-14                       
042402,000105:    5053           00620        4SECS              DEC      400        B-14                       
042403,000106:    5054           00777        LOW9               OCT      777                                   
042404,000107:                                                                                                  #  BIT10         OCT     01000
042405,000108:                                                                                                  #  5.5DEGS       DEC     .03056          P20-P25 SUNDANCE        (OCTAL 00765)
042406,000109:                                                                                                  #  OCT1103       OCT     1103            ALARM AND ABORT
042407,000110:    5055           01124        C5/2               DEC      .0363551                              #                        (OCTAL 01124)
042408,000111:    5056           01211        V05N09             VN       0509                                  #  (SAME AS OCTAL 1211)
042409,000112:    5057           01400        OCT1400            OCT      01400                                 
042410,000113:    5060           01426        V06N22             VN       0622                                  
042411,000114:                                                                                                  #  MID5          OCT     1740            PINBALL
042412,000115:    5061           01776        BITS2-10           OCT      1776                                  
042413,000116:    5062           01777        LOW10              OCT      1777                                  
042414,000117:                                                                                                  #  BIT11         OCT     02000
042415,000118:                                                                                                  #  2K+3          OCT     2003            PINBALL
042416,000119:    5063           02177        LOW7+2K            OCT      2177                                  #  OP CODE MASK + BANK 1 FBANK SETTING.
042417,000120:    5064           02400        EBANK5             OCT      02400                                 
042418,000121:    5065           03000        PRIO3              OCT      03000                                 
042419,000122:    5066           03400        EBANK7             OCT      03400                                 
042420,000123:                                                                                                  #  LOW11         OCT     3777            PINBALL
042421,000124:                                                                                                  #  BIT12         OCT     04000
042422,000125:                                                                                                  #  RELTAB        OCT     04025           T4RUPT
042423,000126:    5067           05000        PRIO5              OCT      05000                                 
042424,000127:    5070           06000        PRIO6              OCT      06000                                 
042425,000128:    5071           07000        PRIO7              OCT      07000                                 
042426,000129: 
042427,000130:                                                                                                  #  BIT13         OCT     10000
042428,000131:                                                                                                  #                OCT     10003           T4RUPT  RELTAB +1D
042429,000132:                                                                                                  #  13,7,2        OCT     10102           P20-P25 SUNDANCE
042430,000133:    5072           11000        PRIO11             OCT      11000                                 
042431,000134:                                                                                                  #  PRIO12        OCT     12000           BANKCALL
042432,000135:    5073           13000        PRIO13             OCT      13000                                 
042433,000136:    5074           14000        PRIO14             OCT      14000                                 
042434,000137:                                                                                                  #                OCT     14031           T4RUPT  RELTAB +2D
042435,000138:    5075           15000        PRIO15             OCT      15000                                 
042436,000139:    5076           16000        PRIO16             OCT      16000                                 
042437,000140:                                                                                                  #  85DEGS        DEC     .45556          P20-P25 SUNDANCE        (OCTAL 16450)
042438,000141:    5077           17000        PRIO17             OCT      17000                                 
042439,000142:    5100           17770        OCT17770           OCT      17770                                 
042440,000143:                                                                                                  #  BIT14         OCT     20000
042441,000144:                                                                                                  #                OCT     20033           T4RUPT  RELTAB +3D
042442,000145:    5101           21000        PRIO21             OCT      21000                                 
042443,000146:    7662                                           BLOCK    03                                    
042444,000147:    7662                                           COUNT*   $$/FCONS                              
042445,000148:    7662           22000        PRIO22             OCT      22000                                 #  SERVICE ROUTINES
042446,000149:    7663           23000        PRIO23             OCT      23000                                 
042447,000150:    7664           24000        PRIO24             OCT      24000                                 
042448,000151:                                                                                                  #  5/8+1         OCT     24001           SINGLE PRECISION SUBROUTINES
042449,000152:                                                                                                  #                OCT     24017           T4RUPT  RELTAB +4D
042450,000153:    7665           25000        PRIO25             OCT      25000                                 
042451,000154:    7666           26000        PRIO26             OCT      26000                                 
042452,000155:    7667           27000        PRIO27             OCT      27000                                 
042453,000156:                                                                                                  #  CHRPRIO       OCT     30000           PINBALL
042454,000157:                                                                                                  #                OCT     30036           T4RUPT  RELTAB +5D
042455,000158:    7670           31000        PRIO31             OCT      31000                                 
042456,000159:    7671           31103        C1/2               DEC      .7853134                              #                        (OCTAL 31103)
042457,000160:    7672           32000        PRIO32             OCT      32000                                 
042458,000161:    7673           33000        PRIO33             OCT      33000                                 
042459,000162:    7674           34000        PRIO34             OCT      34000                                 
042460,000163:                                                                                                  #                OCT     34034           T4RUPT  RELTAB +6D              
042461,000164:    7675           35000        PRIO35             OCT      35000                                 
042462,000165:    7676           36000        PRIO36             OCT      36000                                 
042463,000166:    7677           37000        PRIO37             OCT      37000                                 
042464,000167:    7700           37401        63/64+1            OCT      37401                                 
042465,000168:                                                                                                  #  MID7          OCT     37600           PINBALL
042466,000169:    7701           37766        OCT37766           OCT      37766                                 
042467,000170:    7702           37774        OCT37774           OCT      37774                                 
042468,000171:    7703           37776        OCT37776           OCT      37776                                 
042469,000172:                                                                                                  #  DPOSMAX       OCT     37777
042470,000173:                                                                                                  #  BIT15         OCT     40000
042471,000174:                                                                                                  #  OCT40001      OCT     40001           INTERPRETER (CS 1 INSTRUCTION)
042472,000175:    7704           40014        DLOADCOD           OCT      40014                                 
042473,000176:    7705           40015        DLOAD*             OCT      40015                                 
042474,000177:                                                                                                  #                OCT     40023           T4RUPT  RELTAB +7D
042475,000178:    7706           40040        BIT15+6            OCT      40040                                 
042476,000179:                                                                                                  #                OCT     44035           T4RUPT  RELTAB +8D
042477,000180:                                                                                                  #                OCT     50037           T4RUPT   RELTAB +9D
042478,000181:                                                                                                  #                OCT     54000           T4RUPT   RELTAB +10D
042479,000182:    7707           57777        -BIT14             OCT      57777                                 
042480,000183:                                                                                                  #  RELTAB11      OCT     60000           T4RUPT
042481,000184:    7710           65552        C3/2               DEC      -.3216147                             #                        (OCTAL 65552)
042482,000185:    7711           70000        13,14,15           OCT      70000                                 
042483,000186:    7712           73777        -1/8               OCT      73777                                 
042484,000187:    7713           74000        HIGH4              OCT      74000                                 
042485,000188:    7714           74056        -ENDERAS           DEC      -2001      B-14                       #                        (OCTAL 74056)
042486,000189:                                                                                                  #  HI5           OCT     76000           PINBALL
042487,000190:    7715           77700        HIGH9              OCT      77700                                 
042488,000191:                                                                                                  #  -ENDVAC       DEC     -45             INTERPRETER             (OCTAL 77722)
042489,000192:                                                                                                  #  -OCT10        OCT     -10                                      (OCT 77767)
042490,000193:    7716           77770        OCT77770           OCT      77770                                 
042491,000194:                                                                                                  #  NEG4          DEC     -4                                      (OCTAL 77773)
042492,000195:    7717           77774        NEG3               DEC      -3         B-14                       
042493,000196:    7720           77775        NEG2               OCT      77775                                 
042494,000197:    7721           77776        NEGONE             DEC      -1         B-14                       
042495,000198: 
042496,000199: 
042497,000200:                                                                                                  #  DEFINED BY EQUALS
042498,000201: 
042499,000202:                                                                                                  #  IT WOULD BE TO THE USERS ADVANTAGE TO OCCASIONALLY CHECK ANY OF THESE SYMBOLS IN ORDER TO PREVENT ANY
042500,000203:                                                                                                  #  ACCIDENTAL DEFINITION CHANGES.
042501,000204: 
042502,000205:    7722     7721               MINUS1             =        NEG1                                  
042503,000206:    7722     7721               NEG1               =        NEGONE                                
042504,000207:    7722     5026               ONE                =        BIT1                                  
042505,000208:    7722     5025               TWO                =        BIT2                                  
042506,000209:    7722     6221               THREE              =        OCTAL3                                
042507,000210:    7722     6221               LOW2               =        THREE                                 
042508,000211:    7722     5024               FOUR               =        BIT3                                  
042509,000212:    7722     6216               SIX                =        REVCNT                                
042510,000213:    7722     5032               LOW3               =        SEVEN                                 
042511,000214:    7722     5023               EIGHT              =        BIT4                                  
042512,000215:    7722     4332               NINE               =        R2D1                                  
042513,000216:    7722     4375               TEN                =        BINCON                                
042514,000217:    7722     5033               NOUTCON            =        ELEVEN                                
042515,000218:    7722     4372               OCT23              =        VD1                                   
042516,000219:    7722     4374               OCT25              =        MD1                                   
042517,000220:    7722     5015               PRIO1              =        BIT10                                 
042518,000221:    7722     5057               EBANK3             =        OCT1400                               
042519,000222:    7722     5014               PRIO2              =        BIT11                                 
042520,000223:    7722     5045               OCT120             =        SUPER101                              
042521,000224:    7722     5046               OCT140             =        SUPER110                              
042522,000225:    7722     5014               2K                 =        BIT11                                 
042523,000226:    7722     5014               EBANK4             =        BIT11                                 
042524,000227:    7722     5013               PRIO4              =        BIT12                                 
042525,000228:    7722     5065               EBANK6             =        PRIO3                                 
042526,000229:    7722     5012               QUARTER            =        BIT13                                 
042527,000230:    7722     5012               PRIO10             =        BIT13                                 
042528,000231:    7722     5011               POS1/2             =        HALF                                  
042529,000232:    7722     5011               PRIO20             =        BIT14                                 
042530,000233:    7722     5011               HALF               =        BIT14                                 
042531,000234:    7722     4367               PRIO30             =        CHRPRIO                               
042532,000235:    7722     4367               BIT13-14           =        PRIO30                                #  INTERPRETER USES IN PROCESSING STORECODE
042533,000236:    7722     6445               OCT30002           =        TLOAD      +1                         
042534,000237:    7722     7674               B12T14             =        PRIO34                                
042535,000238:    7722     5010               NEGMAX             =        BIT15                                 
042536,000239:    7722     5010               VLOADCOD           =        BIT15                                 
042537,000240:    7722     6063               VLOAD*             =        OCT40001                              
042538,000241:    7722     4105               OCT60000           =        RELTAB11                              
042539,000242:    7722     4362               BANKMASK           =        HI5                                   
042540,000243: 

End of include-file FIXED-FIXED_CONSTANT_POOL.agc.  Parent file is MAIN.agc