Source Code

These source-code files are part of a reconstructed copy of Comanche 51, the initial release (though not the final mission release) of the Apollo 11 Command Module (CM) Apollo Guidance Computer (AGC) software. The flown, final release was Comanche 55. The reconstruction is believed to be exactly accurate, but in the absence of an actual Apollo-era listing of Comanche 51, some explanation of the reconstruction process is needed to insure confidence in that accuracy.

The starting point was the source code of Comanche 55, whose original source code is available. Comanche 55 source code was then modified by undoing changes known to have been made between revisions 51 and 55. The most-significant steps involved reverting changes related to the R-2 lunar potential model, the details of which were known from the previous, separate, independent reconstruction of the Apollo 10 Lunar Module software Luminary 69/2. The now-reconstructed Comanche 51 source code was verified by assembling it and checking that the assembled code had the expected known-correct memory-bank checksums. Note that page numbers in the reconstructed code match those on the Comanche 55 or Luminary 69 printouts, although the source code would likely have different page numbers in a contemporary Comanche 51 listing.

Annotations that were not present in the contemporary source code have been added to the reconstructed code to justify each change relative to Comanche 55. Here's a guide to some of the Apollo documentation relevant to those annotations:
Among documentation not actually referenced in the annotations, there is a short writeup about the reconstruction process in our software repository that may be helpful in understanding it from a different perspective. There's also a handy table that lists what the number of memory-words should be for each routine in Comanche 51, which could make a nice double-check; however, we've not performed that double-check ourselves.

Comments expected to have been present in the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC Project's GitHub repository.

051066,000002:                                                                                                  ## Copyright:   Public domain.
051067,000003:                                                                                                  ## Filename:    FIXED-FIXED_CONSTANT_POOL.agc
051068,000004:                                                                                                  ## Purpose:     A section of Comanche revision 051.
051069,000005:                                                                                                  ##              It is part of the reconstructed source code for the
051070,000006:                                                                                                  ##              original release of the flight software for the Command
051071,000007:                                                                                                  ##              Module's (CM) Apollo Guidance Computer (AGC) for Apollo 11.
051072,000008:                                                                                                  ##              The code has been recreated from a copy of Comanche 055. It
051073,000009:                                                                                                  ##              has been adapted such that the resulting bugger words
051074,000010:                                                                                                  ##              exactly match those specified for Comanche 51 in NASA drawing
051075,000011:                                                                                                  ##              2021153D, which gives relatively high confidence that the
051076,000012:                                                                                                  ##              reconstruction is correct.
051077,000013:                                                                                                  ## Reference:   pp. 1200-1204
051078,000014:                                                                                                  ## Assembler:   yaYUL
051079,000015:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
051080,000016:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
051081,000017:                                                                                                  ## Mod history: 2019-07-30 MAS  Created from Comanche 55.
051082,000018: 

Page 1200

051084,000020:    4776                                           BLOCK    02                                    
051085,000021:    4776                                           COUNT    02/FCONS                              
051086,000022: 
051087,000023:                                                                                                  #  THE FOLLOWING TABLE OF 18 VALUES IS INDEXED.  DO NOT INSERT OR REMOVE ANY QUANTITIES.
051088,000024: 
051089,000025:    4776           37777        DPOSMAX            OCT      37777                                 #  MUST PRECEDE POSMAX
051090,000026:    4777           37777        POSMAX             OCT      37777                                 
051091,000027: 
051092,000028:    5000     5000               LIMITS             =        NEG1/2                                
051093,000029: 
051094,000030:    5000           57777        NEG1/2             OCT      -20000                                #  USED BY SIN ROUTINE (MUST BE TWO 
051095,000031:                                                                                                  #  LOCATIONS IN FRONT OF BIT14)
051096,000032: 
051097,000033:                                                                                                  #  BIT TABLE                                     
051098,000034: 
051099,000035:    5001           40000        BIT15              OCT      40000                                 
051100,000036:    5002           20000        BIT14              OCT      20000                                 
051101,000037:    5003           10000        BIT13              OCT      10000                                 
051102,000038:    5004           04000        BIT12              OCT      04000                                 
051103,000039:    5005           02000        BIT11              OCT      02000                                 
051104,000040:    5006           01000        BIT10              OCT      01000                                 
051105,000041:    5007           00400        BIT9               OCT      00400                                 
051106,000042:    5010           00200        BIT8               OCT      00200                                 
051107,000043:    5011           00100        BIT7               OCT      00100                                 
051108,000044:    5012           00040        BIT6               OCT      00040                                 
051109,000045:    5013           00020        BIT5               OCT      00020                                 
051110,000046:    5014           00010        BIT4               OCT      00010                                 
051111,000047:    5015           00004        BIT3               OCT      00004                                 
051112,000048:    5016           00002        BIT2               OCT      00002                                 
051113,000049:    5017           00001        BIT1               OCT      00001                                 
051114,000050: 
051115,000051:                                                                                                  #  DO NOT DESTROY THIS COMBINATION, SINCE IT IS USED IN DOUBLE PRECISION INSTRUCTIONS.
051116,000052:    5020           77777        NEG0               OCT      -0                                    #  MUST PRECEDE ZERO
051117,000053:    5021           00000        ZERO               OCT      0                                     #  MUST FOLLOW NEG0
051118,000054:                                                                                                  #  BIT1          OCT     00001
051119,000055:                                                                                                  #  NO.WDS        OCT     2               INTERPRETER
051120,000056:                                                                                                  #  OCTAL3        OCT     3               INTERPRETER
051121,000057:                                                                                                  #  R3D1          OCT     4               PINBALL
051122,000058:    5022           00005        FIVE               OCT      5                                     
051123,000059:                                                                                                  #  REVCNT        OCT     6               INTERPRETER
051124,000060:    5023           00007        SEVEN              OCT      7                                     
051125,000061:                                                                                                  #  BIT4          OCT     00010
051126,000062:                                                                                                  #  R2D1          OCT     11              PINBALL
051127,000063:    5024     4334               OCT11              =        R2D1                                  #  P20S
051128,000064:                                                                                                  #  BINCON        DEC     10              PINBALL         (OCTAL 12)
051129,000065:    5024           00013        ELEVEN             DEC      11         B-14                       
051130,000066:                                                                                                  #  OCT14         OCT     14              ALARM AND ABORT (FILLER)
051131,000067:    5025           00015        OCT15              OCT      15                                    
051132,000068:                                                                                                  #  R1D1          OCT     16              PINBALL

Page 1201

051134,000070:    5026           00017        LOW4               OCT      17                                    
051135,000071:                                                                                                  #  BIT5          OCT     00020
051136,000072:                                                                                                  #  ND1           OCT     21              PINBALL
051137,000073:                                                                                                  #  VD1           OCT     23              PINBALL
051138,000074:                                                                                                  #  OCT24         OCT     24              SERVICE ROUTINES
051139,000075:                                                                                                  #  MD1           OCT     25              PINBALL
051140,000076:    5027           00030        BITS4&5            OCT      30                                    
051141,000077:                                                                                                  #  OCT31         OCT     31              SERVICE ROUTINES
051142,000078:    5030           00032        CALLCODE           OCT      00032                                 
051143,000079:                                                                                                  #  LOW5          OCT     37              PINBALL
051144,000080:                                                                                                  #  33DEC         DEC     33              PINBALL         (OCTAL 41)
051145,000081:                                                                                                  #  34DEC         DEC     34              PINBALL         (OCTAL 42)
051146,000082:    5031           00045        TBUILDFX           DEC      37         B-14                       #  BUILDUP FOR CONVIENCE IN DAPTESTING
051147,000083:    5032           00046        TDECAYFX           DEC      38         B-14                       #  CONVENIENCE FOR DAPTESTING
051148,000084:                                                                                                  #  BIT6          OCT     00040
051149,000085:    5033           00050        OCT50              OCT      50                                    
051150,000086:    5034           00055        DEC45              DEC      45         B-14                       
051151,000087:    5035           00060        SUPER011           OCT      60                                    #  BITS FOR SUPERBNK SETTING 011.
051152,000088:    5036           00062        .5SEC              DEC      50         B-14                       
051153,000089:                                                                                                  #  BIT7          OCT     00100
051154,000090: 
051155,000091:    5037     5011               SUPER100           =        BIT7                                  #  BITS FOR SUPERBNK SETTING 100
051156,000092:                                                                                                  #  (LAST 4K OF ROPE)
051157,000093:    5037           00120        SUPER101           OCT      120                                   #  BITS FOR SUPERBNK SETTING 101
051158,000094:                                                                                                  #  OCT121        OCT     121             SERVICE ROUTINES
051159,000095:                                                                                                  #  (FIRST 8K OF ACM)
051160,000096:    5040           00140        SUPER110           OCT      140                                   #  BITS FOR SUPERBNK SETTING 110.
051161,000097:                                                                                                  #  (LAST 8K OF ACM)
051162,000098:    5041           00144        1SEC               DEC      100        B-14                       
051163,000099:                                                                                                  #  LOW7          OCT     177             INTERPRETER
051164,000100:                                                                                                  #  BIT8          OCT     00200
051165,000101:                                                                                                  #  OT215         OCT     215             ALARM AND ABORT
051166,000102:                                                                                                  #  8,5           OCT     00220           P20-P25 SUNDANCE
051167,000103:    5042           00310        2SECS              DEC      200        B-14                       
051168,000104:                                                                                                  #  LOW8          OCT     377             PINBALL
051169,000105:                                                                                                  #  BIT9          OCT     00400
051170,000106:    5043           00401        GN/CCODE           OCT      00401                                 #  SET S/C CONTROL SWITCH TO G/N
051171,000107:    5044           00454        3SECS              DEC      300        B-14                       
051172,000108:    5045           00620        4SECS              DEC      400        B-14                       
051173,000109:    5046           00777        LOW9               OCT      777                                   
051174,000110:                                                                                                  #  BIT10         OCT     01000
051175,000111:                                                                                                  #  5.5DEGS       DEC     .03056          P20-P25 SUNDANCE        (OCTAL 00765)
051176,000112:                                                                                                  #  OCT1103       OCT     1103            ALARM AND ABORT
051177,000113:    5047           01124        C5/2               DEC      .0363551                              #                        (OCTAL 01124)
051178,000114:    5050           01211        V05N09             VN       0509                                  #  (SAME AS OCTAL 1211)
051179,000115:    5051           01400        OCT1400            OCT      01400                                 
051180,000116:    5052           01426        V06N22             VN       0622                                  
051181,000117:                                                                                                  #  MID5          OCT     1740            PINBALL
051182,000118:    5053           01776        BITS2-10           OCT      1776                                  
051183,000119:    5054           01777        LOW10              OCT      1777                                  

Page 1202

051185,000121:                                                                                                  #  BIT11         OCT     02000
051186,000122:                                                                                                  #  2K+3          OCT     2003            PINBALL
051187,000123:    5055           02177        LOW7+2K            OCT      2177                                  #  OP CODE MASK + BANK 1 FBANK SETTING.
051188,000124:    5056           02400        EBANK5             OCT      02400                                 
051189,000125:    5057           03000        PRIO3              OCT      03000                                 
051190,000126:    5060           03400        EBANK7             OCT      03400                                 
051191,000127:                                                                                                  #  LOW11         OCT     3777            PINBALL
051192,000128:                                                                                                  #  BIT12         OCT     04000
051193,000129:                                                                                                  #  RELTAB        OCT     04025           T4RUPT
051194,000130:    5061           05000        PRIO5              OCT      05000                                 
051195,000131:    5062           06000        PRIO6              OCT      06000                                 
051196,000132:    5063           07000        PRIO7              OCT      07000                                 
051197,000133: 
051198,000134:                                                                                                  #  BIT13         OCT     10000
051199,000135:                                                                                                  #                OCT     10003           T4RUPT  RELTAB +1D
051200,000136:                                                                                                  #  13,7,2        OCT     10102           P20-P25 SUNDANCE
051201,000137:    5064           11000        PRIO11             OCT      11000                                 
051202,000138:                                                                                                  #  PRIO12        OCT     12000           BANKCALL
051203,000139:    5065           13000        PRIO13             OCT      13000                                 
051204,000140:    5066           14000        PRIO14             OCT      14000                                 
051205,000141:                                                                                                  #                OCT     14031           T4RUPT  RELTAB +2D
051206,000142:    5067           15000        PRIO15             OCT      15000                                 
051207,000143:    5070           16000        PRIO16             OCT      16000                                 
051208,000144:                                                                                                  #  85DEGS        DEC     .45556          P20-P25 SUNDANCE        (OCTAL 16450)
051209,000145:    5071           17000        PRIO17             OCT      17000                                 
051210,000146:    5072           17770        OCT17770           OCT      17770                                 
051211,000147:                                                                                                  #  BIT14         OCT     20000
051212,000148:                                                                                                  #                OCT     20033           T4RUPT  RELTAB +3D
051213,000149:    5073           21000        PRIO21             OCT      21000                                 
051214,000150:    7657                                           BLOCK    03                                    
051215,000151:    7657                                           COUNT    03/FCONS                              
051216,000152: 
051217,000153:    7657           22000        PRIO22             OCT      22000                                 #  SERVICE ROUTINES
051218,000154:    7660           23000        PRIO23             OCT      23000                                 
051219,000155:    7661           24000        PRIO24             OCT      24000                                 
051220,000156:                                                                                                  #  5/8+1         OCT     24001           SINGLE PRECISION SUBROUTINES
051221,000157:                                                                                                  #                OCT     24017           T4RUPT  RELTAB +4D
051222,000158:    7662           25000        PRIO25             OCT      25000                                 
051223,000159:    7663           26000        PRIO26             OCT      26000                                 
051224,000160:    7664           27000        PRIO27             OCT      27000                                 
051225,000161:                                                                                                  #  CHRPRIO       OCT     30000           PINBALL
051226,000162:                                                                                                  #                OCT     30036           T4RUPT  RELTAB +5D
051227,000163:    7665           31000        PRIO31             OCT      31000                                 
051228,000164:    7666           31103        C1/2               DEC      .7853134                              #                        (OCTAL 31103)
051229,000165:    7667           32000        PRIO32             OCT      32000                                 
051230,000166:    7670           33000        PRIO33             OCT      33000                                 
051231,000167:    7671           34000        PRIO34             OCT      34000                                 
051232,000168:                                                                                                  #                OCT     34034           T4RUPT  RELTAB +6D              
051233,000169:    7672           35000        PRIO35             OCT      35000                                 
051234,000170:    7673           36000        PRIO36             OCT      36000                                 

Page 1203

051236,000172:    7674           37000        PRIO37             OCT      37000                                 
051237,000173:    7675           37401        63/64+1            OCT      37401                                 
051238,000174:                                                                                                  #  MID7          OCT     37600           PINBALL
051239,000175:    7676           37766        OCT37766           OCT      37766                                 
051240,000176:    7677           37774        OCT37774           OCT      37774                                 
051241,000177:    7700           37776        OCT37776           OCT      37776                                 
051242,000178:                                                                                                  #  DPOSMAX       OCT     37777
051243,000179:                                                                                                  #  BIT15         OCT     40000
051244,000180:                                                                                                  #  OCT40001      OCT     40001           INTERPRETER (CS 1 INSTRUCTION)
051245,000181:    7701           40014        DLOADCOD           OCT      40014                                 
051246,000182:    7702           40015        DLOAD*             OCT      40015                                 
051247,000183:                                                                                                  #                OCT     40023           T4RUPT  RELTAB +7D
051248,000184:    7703           40040        BIT15+6            OCT      40040                                 
051249,000185:    7704           40200        OCT40200           OCT      40200                                 
051250,000186:                                                                                                  #                OCT     44035           T4RUPT  RELTAB +8D
051251,000187:                                                                                                  #                OCT     50037           T4RUPT  RELTAB +9D
051252,000188:                                                                                                  #                OCT     54000           T4RUPT  RELTAB +10D
051253,000189:    7705           57777        -BIT14             OCT      57777                                 
051254,000190:                                                                                                  #  RELTAB11      OCT     60000           T4RUPT
051255,000191:    7706           65552        C3/2               DEC      -.3216147                             #                        (OCTAL 65552)
051256,000192:    7707           70000        13,14,15           OCT      70000                                 
051257,000193:    7710           73777        -1/8               OCT      73777                                 
051258,000194:    7711           74000        HIGH4              OCT      74000                                 
051259,000195:    7712           74056        -ENDERAS           DEC      -2001      B-14                       #                        (OCTAL 74056)
051260,000196:                                                                                                  #  HI5           OCT     76000           PINBALL
051261,000197:    7713           77700        HIGH9              OCT      77700                                 
051262,000198:                                                                                                  #  -ENDVAC       DEC     -45             INTERPRETER             (OCTAL 77722)
051263,000199:                                                                                                  #  -OCT10        OCT     -10                                      (OCT 77767)
051264,000200:                                                                                                  #  NEG4          DEC     -4                                      (OCTAL 77773)
051265,000201:    7714           77774        NEG3               DEC      -3         B-14                       
051266,000202:    7715           77775        NEG2               OCT      77775                                 
051267,000203:    7716           77776        NEGONE             DEC      -1         B-14                       
051268,000204: 

Page 1204

051270,000206: 
051271,000207:                                                                                                  #  DEFINED BY EQUALS
051272,000208: 
051273,000209:                                                                                                  #  IT WOULD BE TO THE USERS ADVANTAGE TO OCCASIONALLY CHECK ANY OF THESE SYMBOLS IN ORDER TO PREVENT ANY
051274,000210:                                                                                                  #  ACCIDENTAL DEFINITION CHANGES.
051275,000211: 
051276,000212:    7717     7716               MINUS1             =        NEG1                                  
051277,000213:    7717     7716               NEG1               =        NEGONE                                
051278,000214:    7717     5017               ONE                =        BIT1                                  
051279,000215:    7717     5016               TWO                =        BIT2                                  
051280,000216:    7717     6214               THREE              =        OCTAL3                                
051281,000217:    7717     6214               LOW2               =        THREE                                 
051282,000218:    7717     5015               FOUR               =        BIT3                                  
051283,000219:    7717     6211               SIX                =        REVCNT                                
051284,000220:    7717     5023               LOW3               =        SEVEN                                 
051285,000221:    7717     5014               EIGHT              =        BIT4                                  
051286,000222:    7717     4334               NINE               =        R2D1                                  
051287,000223:    7717     4377               TEN                =        BINCON                                
051288,000224:    7717     5024               NOUTCON            =        ELEVEN                                
051289,000225:    7717     4374               OCT23              =        VD1                                   
051290,000226:    7717     4376               OCT25              =        MD1                                   
051291,000227:    7717     5006               PRIO1              =        BIT10                                 
051292,000228:    7717     5051               EBANK3             =        OCT1400                               
051293,000229:    7717     5005               PRIO2              =        BIT11                                 
051294,000230:    7717     5037               OCT120             =        SUPER101                              
051295,000231:    7717     5040               OCT140             =        SUPER110                              
051296,000232:    7717     5005               2K                 =        BIT11                                 
051297,000233:    7717     5005               EBANK4             =        BIT11                                 
051298,000234:    7717     5004               PRIO4              =        BIT12                                 
051299,000235:    7717     5057               EBANK6             =        PRIO3                                 
051300,000236:    7717     5003               QUARTER            =        BIT13                                 
051301,000237:    7717     5003               PRIO10             =        BIT13                                 
051302,000238:    7717     7632               OCT10001           =        CCSL                                  
051303,000239:    7717     5002               POS1/2             =        HALF                                  
051304,000240:    7717     5002               PRIO20             =        BIT14                                 
051305,000241:    7717     5002               HALF               =        BIT14                                 
051306,000242:    7717     4371               PRIO30             =        CHRPRIO                               
051307,000243:    7717     4371               BIT13-14           =        PRIO30                                #  INTERPRETER USES IN PROCESSING STORECODE
051308,000244:    7717     6440               OCT30002           =        TLOAD      +1                         
051309,000245:    7717     7671               B12T14             =        PRIO34                                
051310,000246:    7717     5001               NEGMAX             =        BIT15                                 
051311,000247:    7717     5001               VLOADCOD           =        BIT15                                 
051312,000248:    7717     6056               VLOAD*             =        OCT40001                              
051313,000249:    7717     4105               OCT60000           =        RELTAB11                              
051314,000250:    7717     4364               BANKMASK           =        HI5                                   
051315,000251: 

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