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.

042133,000002:                                                                                                  ## Copyright:   Public domain.
042134,000003:                                                                                                  ## Filename:    FIXED-FIXED_CONSTANT_POOL.agc
042135,000004:                                                                                                  ## Purpose:     A section of a reconstructed, mixed version of Sundance
042136,000005:                                                                                                  ##              It is part of the reconstructed source code for the Lunar
042137,000006:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 9.
042138,000007:                                                                                                  ##              No original listings of this program are available;
042139,000008:                                                                                                  ##              instead, this file was created via disassembly of dumps
042140,000009:                                                                                                  ##              of various revisions of Sundance core rope modules.
042141,000010:                                                                                                  ## Assembler:   yaYUL
042142,000011:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
042143,000012:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
042144,000013:                                                                                                  ## Mod history: 2020-06-17 MAS  Created from Luminary 69.
042145,000014: 
042146,000015:                                                                                                  ## Sundance 292
042147,000016: 
042148,000017:    5005                                           BLOCK    02                                    
042149,000018:    5005                                           COUNT*   $$/FCONS                              
042150,000019: 
042151,000020:                                                                                                  #  THE FOLLOWING TABLE OF 18 VALUES IS INDEXED.  DO NOT INSERT OR REMOVE ANY QUANTITIES.
042152,000021: 
042153,000022:    5005           37777        DPOSMAX            OCT      37777                                 #  MUST PRECEDE POSMAX
042154,000023:    5006           37777        POSMAX             OCT      37777                                 
042155,000024: 
042156,000025:    5007     5007               LIMITS             =        NEG1/2                                
042157,000026: 
042158,000027:    5007           57777        NEG1/2             OCT      -20000                                #  USED BY SIN ROUTINE (MUST BE TWO 
042159,000028:                                                                                                  #  LOCATIONS IN FRONT OF BIT14)
042160,000029: 
042161,000030:                                                                                                  #  BIT TABLE                                     
042162,000031: 
042163,000032:    5010           40000        BIT15              OCT      40000                                 
042164,000033:    5011           20000        BIT14              OCT      20000                                 
042165,000034:    5012           10000        BIT13              OCT      10000                                 
042166,000035:    5013           04000        BIT12              OCT      04000                                 
042167,000036:    5014           02000        BIT11              OCT      02000                                 
042168,000037:    5015           01000        BIT10              OCT      01000                                 
042169,000038:    5016           00400        BIT9               OCT      00400                                 
042170,000039:    5017           00200        BIT8               OCT      00200                                 
042171,000040:    5020           00100        BIT7               OCT      00100                                 
042172,000041:    5021           00040        BIT6               OCT      00040                                 
042173,000042:    5022           00020        BIT5               OCT      00020                                 
042174,000043:    5023           00010        BIT4               OCT      00010                                 
042175,000044:    5024           00004        BIT3               OCT      00004                                 
042176,000045:    5025           00002        BIT2               OCT      00002                                 
042177,000046:    5026           00001        BIT1               OCT      00001                                 
042178,000047: 
042179,000048:                                                                                                  #  DO NOT DESTROY THIS COMBINATION, SINCE IT IS USED IN DOUBLE PRECISION INSTRUCTIONS.
042180,000049:    5027           77777        NEG0               OCT      -0                                    #  MUST PRECEDE ZERO
042181,000050:    5030           00000        ZERO               OCT      0                                     #  MUST FOLLOW NEG0
042182,000051:                                                                                                  #  BIT1          OCT     00001
042183,000052:                                                                                                  #  NO.WDS        OCT     2               INTERPRETER
042184,000053:                                                                                                  #  OCTAL3        OCT     3               INTERPRETER
042185,000054:                                                                                                  #  R3D1          OCT     4               PINBALL
042186,000055:    5031           00005        FIVE               OCT      5                                     
042187,000056:                                                                                                  #  REVCNT        OCT     6               INTERPRETER
042188,000057:    5032           00007        SEVEN              OCT      7                                     
042189,000058:                                                                                                  #  BIT4          OCT     00010
042190,000059:                                                                                                  #  R2D1          OCT     11              PINBALL
042191,000060:    5033     4332               OCT11              =        R2D1                                  #  P20S
042192,000061:                                                                                                  #  BINCON        DEC     10              PINBALL         (OCTAL 12)
042193,000062:    5033           00013        ELEVEN             DEC      11         B-14                       
042194,000063:                                                                                                  #  OCT14         OCT     14              ALARM AND ABORT (FILLER)
042195,000064:    5034           00015        OCT15              OCT      15                                    
042196,000065:                                                                                                  #  R1D1          OCT     16              PINBALL
042197,000066:    5035           00017        LOW4               OCT      17                                    
042198,000067:                                                                                                  #  BIT5          OCT     00020
042199,000068:                                                                                                  #  ND1           OCT     21              PINBALL
042200,000069:                                                                                                  #  VD1           OCT     23              PINBALL
042201,000070:                                                                                                  #  OCT24         OCT     24              SERVICE ROUTINES
042202,000071:                                                                                                  #  MD1           OCT     25              PINBALL
042203,000072:                                                                                                  #  OCT31         OCT     31              SERVICE ROUTINES
042204,000073:    5036           00032        CALLCODE           OCT      00032                                 
042205,000074:                                                                                                  #  LOW5          OCT     37              PINBALL
042206,000075:                                                                                                  #  33DEC         DEC     33              PINBALL         (OCTAL 41)
042207,000076:                                                                                                  #  34DEC         DEC     34              PINBALL         (OCTAL 42)
042208,000077:    5037           00045        TBUILDFX           DEC      37         B-14                       #  BUILDUP FOR CONVIENCE IN DAPTESTING
042209,000078:    5040           00046        TDECAYFX           DEC      38         B-14                       #  CONVENIENCE FOR DAPTESTING
042210,000079:                                                                                                  #  BIT6          OCT     00040
042211,000080:    5041           00050        OCT50              OCT      50                                    
042212,000081:    5042           00055        DEC45              DEC      45         B-14                       
042213,000082:    5043           00060        SUPER011           OCT      60                                    #  BITS FOR SUPERBNK SETTING 011.
042214,000083:    5044           00062        .5SEC              DEC      50         B-14                       
042215,000084:                                                                                                  #  BIT7          OCT     00100
042216,000085: 
042217,000086:    5045     5020               SUPER100           =        BIT7                                  #  BITS FOR SUPERBNK SETTING 100
042218,000087:                                                                                                  #  (LAST 4K OF ROPE)
042219,000088:    5045           00120        SUPER101           OCT      120                                   #  BITS FOR SUPERBNK SETTING 101
042220,000089:                                                                                                  #  OCT121        OCT     121             SERVICE ROUTINES
042221,000090:                                                                                                  #  (FIRST 8K OF ACM)
042222,000091:    5046           00140        SUPER110           OCT      140                                   #  BITS FOR SUPERBNK SETTING 110.
042223,000092:                                                                                                  #  (LAST 8K OF ACM)
042224,000093:    5047           00144        1SEC               DEC      100        B-14                       
042225,000094:                                                                                                  #  LOW7          OCT     177             INTERPRETER
042226,000095:                                                                                                  #  BIT8          OCT     00200
042227,000096:                                                                                                  #  OT215         OCT     215             ALARM AND ABORT
042228,000097:                                                                                                  #  8,5           OCT     00220           P20-P25 SUNDANCE
042229,000098:    5050           00310        2SECS              DEC      200        B-14                       
042230,000099:                                                                                                  #  LOW8          OCT     377             PINBALL
042231,000100:                                                                                                  #  BIT9          OCT     00400
042232,000101:    5051           00401        GN/CCODE           OCT      00401                                 #  SET S/C CONTROL SWITCH TO G/N
042233,000102:    5052           00454        3SECS              DEC      300        B-14                       
042234,000103:    5053           00620        4SECS              DEC      400        B-14                       
042235,000104:    5054           00777        LOW9               OCT      777                                   
042236,000105:                                                                                                  #  BIT10         OCT     01000
042237,000106:                                                                                                  #  5.5DEGS       DEC     .03056          P20-P25 SUNDANCE        (OCTAL 00765)
042238,000107:                                                                                                  #  OCT1103       OCT     1103            ALARM AND ABORT
042239,000108:    5055           01124        C5/2               DEC      .0363551                              #                        (OCTAL 01124)
042240,000109:    5056           01211        V05N09             VN       0509                                  #  (SAME AS OCTAL 1211)
042241,000110:    5057           01400        OCT1400            OCT      01400                                 
042242,000111:    5060           01426        V06N22             VN       0622                                  
042243,000112:                                                                                                  #  MID5          OCT     1740            PINBALL
042244,000113:    5061           01776        BITS2-10           OCT      1776                                  
042245,000114:    5062           01777        LOW10              OCT      1777                                  
042246,000115:                                                                                                  #  BIT11         OCT     02000
042247,000116:                                                                                                  #  2K+3          OCT     2003            PINBALL
042248,000117:    5063           02177        LOW7+2K            OCT      2177                                  #  OP CODE MASK + BANK 1 FBANK SETTING.
042249,000118:    5064           02400        EBANK5             OCT      02400                                 
042250,000119:    5065           03000        PRIO3              OCT      03000                                 
042251,000120:    5066           03400        EBANK7             OCT      03400                                 
042252,000121:                                                                                                  #  LOW11         OCT     3777            PINBALL
042253,000122:                                                                                                  #  BIT12         OCT     04000
042254,000123:                                                                                                  #  RELTAB        OCT     04025           T4RUPT
042255,000124:    5067           05000        PRIO5              OCT      05000                                 
042256,000125:    5070           06000        PRIO6              OCT      06000                                 
042257,000126:    5071           07000        PRIO7              OCT      07000                                 
042258,000127: 
042259,000128:                                                                                                  #  BIT13         OCT     10000
042260,000129:                                                                                                  #                OCT     10003           T4RUPT  RELTAB +1D
042261,000130:                                                                                                  #  13,7,2        OCT     10102           P20-P25 SUNDANCE
042262,000131:    5072           11000        PRIO11             OCT      11000                                 
042263,000132:                                                                                                  #  PRIO12        OCT     12000           BANKCALL
042264,000133:    5073           13000        PRIO13             OCT      13000                                 
042265,000134:    5074           14000        PRIO14             OCT      14000                                 
042266,000135:                                                                                                  #                OCT     14031           T4RUPT  RELTAB +2D
042267,000136:    5075           15000        PRIO15             OCT      15000                                 
042268,000137:    5076           16000        PRIO16             OCT      16000                                 
042269,000138:                                                                                                  #  85DEGS        DEC     .45556          P20-P25 SUNDANCE        (OCTAL 16450)
042270,000139:    5077           17000        PRIO17             OCT      17000                                 
042271,000140:    5100           17770        OCT17770           OCT      17770                                 
042272,000141:                                                                                                  #  BIT14         OCT     20000
042273,000142:                                                                                                  #                OCT     20033           T4RUPT  RELTAB +3D
042274,000143:    5101           21000        PRIO21             OCT      21000                                 
042275,000144:    7662                                           BLOCK    03                                    
042276,000145:    7662                                           COUNT*   $$/FCONS                              
042277,000146:    7662           22000        PRIO22             OCT      22000                                 #  SERVICE ROUTINES
042278,000147:    7663           23000        PRIO23             OCT      23000                                 
042279,000148:    7664           24000        PRIO24             OCT      24000                                 
042280,000149:                                                                                                  #  5/8+1         OCT     24001           SINGLE PRECISION SUBROUTINES
042281,000150:                                                                                                  #                OCT     24017           T4RUPT  RELTAB +4D
042282,000151:    7665           25000        PRIO25             OCT      25000                                 
042283,000152:    7666           26000        PRIO26             OCT      26000                                 
042284,000153:    7667           27000        PRIO27             OCT      27000                                 
042285,000154:                                                                                                  #  CHRPRIO       OCT     30000           PINBALL
042286,000155:                                                                                                  #                OCT     30036           T4RUPT  RELTAB +5D
042287,000156:    7670           31000        PRIO31             OCT      31000                                 
042288,000157:    7671           31103        C1/2               DEC      .7853134                              #                        (OCTAL 31103)
042289,000158:    7672           32000        PRIO32             OCT      32000                                 
042290,000159:    7673           33000        PRIO33             OCT      33000                                 
042291,000160:    7674           34000        PRIO34             OCT      34000                                 
042292,000161:                                                                                                  #                OCT     34034           T4RUPT  RELTAB +6D              
042293,000162:    7675           35000        PRIO35             OCT      35000                                 
042294,000163:    7676           36000        PRIO36             OCT      36000                                 
042295,000164:    7677           37000        PRIO37             OCT      37000                                 
042296,000165:    7700           37401        63/64+1            OCT      37401                                 
042297,000166:                                                                                                  #  MID7          OCT     37600           PINBALL
042298,000167:    7701           37766        OCT37766           OCT      37766                                 
042299,000168:    7702           37774        OCT37774           OCT      37774                                 
042300,000169:    7703           37776        OCT37776           OCT      37776                                 
042301,000170:                                                                                                  #  DPOSMAX       OCT     37777
042302,000171:                                                                                                  #  BIT15         OCT     40000
042303,000172:                                                                                                  #  OCT40001      OCT     40001           INTERPRETER (CS 1 INSTRUCTION)
042304,000173:    7704           40014        DLOADCOD           OCT      40014                                 
042305,000174:    7705           40015        DLOAD*             OCT      40015                                 
042306,000175:                                                                                                  #                OCT     40023           T4RUPT  RELTAB +7D
042307,000176:    7706           40040        BIT15+6            OCT      40040                                 
042308,000177:                                                                                                  #                OCT     44035           T4RUPT  RELTAB +8D
042309,000178:                                                                                                  #                OCT     50037           T4RUPT   RELTAB +9D
042310,000179:                                                                                                  #                OCT     54000           T4RUPT   RELTAB +10D
042311,000180:    7707           57777        -BIT14             OCT      57777                                 
042312,000181:                                                                                                  #  RELTAB11      OCT     60000           T4RUPT
042313,000182:    7710           65552        C3/2               DEC      -.3216147                             #                        (OCTAL 65552)
042314,000183:    7711           70000        13,14,15           OCT      70000                                 
042315,000184:    7712           73777        -1/8               OCT      73777                                 
042316,000185:    7713           74000        HIGH4              OCT      74000                                 
042317,000186:    7714           74056        -ENDERAS           DEC      -2001      B-14                       #                        (OCTAL 74056)
042318,000187:                                                                                                  #  HI5           OCT     76000           PINBALL
042319,000188:    7715           77700        HIGH9              OCT      77700                                 
042320,000189:                                                                                                  #  -ENDVAC       DEC     -45             INTERPRETER             (OCTAL 77722)
042321,000190:                                                                                                  #  -OCT10        OCT     -10                                      (OCT 77767)
042322,000191:    7716           77770        OCT77770           OCT      77770                                 
042323,000192:                                                                                                  #  NEG4          DEC     -4                                      (OCTAL 77773)
042324,000193:    7717           77774        NEG3               DEC      -3         B-14                       
042325,000194:    7720           77775        NEG2               OCT      77775                                 
042326,000195:    7721           77776        NEGONE             DEC      -1         B-14                       
042327,000196: 
042328,000197: 
042329,000198:                                                                                                  #  DEFINED BY EQUALS
042330,000199: 
042331,000200:                                                                                                  #  IT WOULD BE TO THE USERS ADVANTAGE TO OCCASIONALLY CHECK ANY OF THESE SYMBOLS IN ORDER TO PREVENT ANY
042332,000201:                                                                                                  #  ACCIDENTAL DEFINITION CHANGES.
042333,000202: 
042334,000203:    7722     7721               MINUS1             =        NEG1                                  
042335,000204:    7722     7721               NEG1               =        NEGONE                                
042336,000205:    7722     5026               ONE                =        BIT1                                  
042337,000206:    7722     5025               TWO                =        BIT2                                  
042338,000207:    7722     6221               THREE              =        OCTAL3                                
042339,000208:    7722     6221               LOW2               =        THREE                                 
042340,000209:    7722     5024               FOUR               =        BIT3                                  
042341,000210:    7722     6216               SIX                =        REVCNT                                
042342,000211:    7722     5032               LOW3               =        SEVEN                                 
042343,000212:    7722     5023               EIGHT              =        BIT4                                  
042344,000213:    7722     4332               NINE               =        R2D1                                  
042345,000214:    7722     4375               TEN                =        BINCON                                
042346,000215:    7722     5033               NOUTCON            =        ELEVEN                                
042347,000216:    7722     4372               OCT23              =        VD1                                   
042348,000217:    7722     4374               OCT25              =        MD1                                   
042349,000218:    7722     5015               PRIO1              =        BIT10                                 
042350,000219:    7722     5057               EBANK3             =        OCT1400                               
042351,000220:    7722     5014               PRIO2              =        BIT11                                 
042352,000221:    7722     5045               OCT120             =        SUPER101                              
042353,000222:    7722     5046               OCT140             =        SUPER110                              
042354,000223:    7722     5014               2K                 =        BIT11                                 
042355,000224:    7722     5014               EBANK4             =        BIT11                                 
042356,000225:    7722     5013               PRIO4              =        BIT12                                 
042357,000226:    7722     5065               EBANK6             =        PRIO3                                 
042358,000227:    7722     5012               QUARTER            =        BIT13                                 
042359,000228:    7722     5012               PRIO10             =        BIT13                                 
042360,000229:    7722     5011               POS1/2             =        HALF                                  
042361,000230:    7722     5011               PRIO20             =        BIT14                                 
042362,000231:    7722     5011               HALF               =        BIT14                                 
042363,000232:    7722     4367               PRIO30             =        CHRPRIO                               
042364,000233:    7722     4367               BIT13-14           =        PRIO30                                #  INTERPRETER USES IN PROCESSING STORECODE
042365,000234:    7722     6445               OCT30002           =        TLOAD      +1                         
042366,000235:    7722     7674               B12T14             =        PRIO34                                
042367,000236:    7722     5010               NEGMAX             =        BIT15                                 
042368,000237:    7722     5010               VLOADCOD           =        BIT15                                 
042369,000238:    7722     6063               VLOAD*             =        OCT40001                              
042370,000239:    7722     4105               OCT60000           =        RELTAB11                              
042371,000240:    7722     4362               BANKMASK           =        HI5                                   
042372,000241: 

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