Source Code

These source-code files are part of a reconstructed copy of Comanche 45, the second release, though not the final mission release, of the Apollo 10 Command Module (CM) Apollo Guidance Computer (AGC) software. Comanche 45 was preceded by Comanche 44 and followed by Comanche 45/2 (the flown release). The reconstruction is believed to be exactly accurate, but in the absence of an actual Apollo-era listing of Comanche 45, some explanation of the reconstruction process is needed to insure confidence in that accuracy.

The starting point was the source code of Comanche 44 (itself previously accurately reconstructed). Comanche 44 source code was then modified by incorporating changes known from contemporary documentation to have been made between revisions 44 and 45. The now-reconstructed Comanche 45 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 tend to match those in the Comanche 55, the most-similar revision of Comanche for which we have access to an actual non-reconstructed hardcopy; the source code would likely have different page numbers in a contemporary Comanche 45 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 44. Here's a guide to the Apollo documentation referenced in those annotations:
There is also a detailed commentary about the reconstruction process.

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.

063325,000002:                                                                                                  ## Copyright:   Public domain.
063326,000003:                                                                                                  ## Filename:    ALARM_AND_ABORT.agc
063327,000004:                                                                                                  ## Purpose:     A section of Comanche revision 045.
063328,000005:                                                                                                  ##              It is part of the reconstructed source code for the
063329,000006:                                                                                                  ##              second release of the flight software for the Command
063330,000007:                                                                                                  ##              Module's (CM) Apollo Guidance Computer (AGC) for Apollo 10.
063331,000008:                                                                                                  ##              The code has been recreated from a copy of Comanche 055. It
063332,000009:                                                                                                  ##              has been adapted such that the resulting bugger words
063333,000010:                                                                                                  ##              exactly match those specified for Comanche 45 in NASA drawing
063334,000011:                                                                                                  ##              2021153D, which gives relatively high confidence that the
063335,000012:                                                                                                  ##              reconstruction is correct.
063336,000013:                                                                                                  ## Assembler:   yaYUL
063337,000014:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
063338,000015:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
063339,000016:                                                                                                  ## Mod history: 2020-12-06 MAS  Created from Comanche 44.
063340,000017: 

Page 1493

063342,000019:                                                                                                  #  THE FOLLOWING SUBROUTINE MAY BE CALLED TO DISPLAY A NON-ABORTIVE ALARM CONDITION.  IT MAY BE CALLED
063343,000020:                                                                                                  #  EITHER IN INTERRUPT OR UNDER EXECUTIVE CONTROL.
063344,000021: 
063345,000022:                                                                                                  #  CALLING SEQUENCE IS AS FOLLOWS:
063346,000023:                                                                                                  #                TC      ALARM
063347,000024:                                                                                                  #                OCT     NNNNN
063348,000025:                                                                                                  #                                        (RETURNS HERE)
063349,000026: 
063350,000027:    5650                                           BLOCK    02                                    
063351,000028:    4000                                           SETLOC   FFTAG7                                
063352,000029:    4000                                           BANK                                           
063353,000030: 
063354,000031:    5650     0375                                  EBANK=   FAILREG                               
063355,000032: 
063356,000033:    5650                                           COUNT    02/ALARM                              
063357,000034: 
063358,000035:                                                                                                  #  ALARM TURNS ON THE PROGRAM ALARM LIGHT, BUT DOES NOT DISPLAY.
063359,000036: 
063360,000037:    5650           00004        ALARM              INHINT                                         
063361,000038: 
063362,000039:    5651           30002                           CA       Q                                     
063363,000040:    5652           55363        ALARM2             TS       ALMCADR                               
063364,000041:    5653           50002                           INDEX    Q                                     
063365,000042:    5654           30000                           CA       0                                     
063366,000043:    5655           54001        BORTENT            TS       L                                     
063367,000044: 
063368,000045:    5656           30006        PRIOENT            CA       BBANK                                 
063369,000046:    5657           00006                 +1        EXTEND                                         
063370,000047:    5660           04007                           ROR      SUPERBNK                              #  ADD SUPER BITS.
063371,000048:    5661           55364                           TS       ALMCADR    +1                         
063372,000049: 
063373,000050:    5662           30002        LARMENT            CA       Q                                     #  STORE RETURN FOR ALARM
063374,000051:    5663           54061                           TS       ITEMP1                                
063375,000052: 
063376,000053:    5664           30164                           CA       LOC                                   
063377,000054:    5665           54057                           TS       LOCALARM                              
063378,000055:    5666           30165                           CA       BANKSET                               
063379,000056:    5667           54060                           TS       BANKALRM                              
063380,000057: 
063381,000058:    5670           10375        CHKFAIL1           CCS      FAILREG                               #  IS ANYTHING IN FAILREG
063382,000059:    5671           15674                           TCF      CHKFAIL2                              #  YES TRY NEXT REG
063383,000060:    5672           22375                           LXCH     FAILREG                               
063384,000061:    5673           15706                           TCF      PROGLARM                              #  TURN ALARM LIGHT ON FOR FIRST ALARM
063385,000062: 
063386,000063:    5674           10376        CHKFAIL2           CCS      FAILREG    +1                         
063387,000064:    5675           15700                           TCF      FAIL3                                 
063388,000065:    5676           22376                           LXCH     FAILREG    +1                         
063389,000066:    5677           15711                           TCF      MULTEXIT                              
063390,000067: 
063391,000068:    5700           30377        FAIL3              CA       FAILREG    +2                         

Page 1494

063393,000070:    5701           74777                           MASK     POSMAX                                
063394,000071:    5702           10000                           CCS      A                                     
063395,000072:    5703           15715                           TCF      MULTFAIL                              
063396,000073:    5704           22377                           LXCH     FAILREG    +2                         
063397,000074:    5705           15711                           TCF      MULTEXIT                              
063398,000075: 
063399,000076:    5706           41036        PROGLARM           CS       DSPTAB     +11D                       
063400,000077:    5707           77765                           MASK     OCT40400                              
063401,000078:    5710           27036                           ADS      DSPTAB     +11D                       
063402,000079: 
063403,000080:    5711           56061        MULTEXIT           XCH      ITEMP1                                #  OBTAIN RETURN ADDRESS IN A
063404,000081:    5712           00003                           RELINT                                         
063405,000082:    5713           50000                           INDEX    A                                     
063406,000083:    5714           00001                           TC       1                                     
063407,000084: 
063408,000085:    5715           30001        MULTFAIL           CA       L                                     
063409,000086:    5716           65001                           AD       BIT15                                 
063410,000087:    5717           54377                           TS       FAILREG    +2                         
063411,000088: 
063412,000089:    5720           15711                           TCF      MULTEXIT                              
063413,000090: 
063414,000091:                                                                                                  #  PRIOLARM DISPLAYS V05N09 VIA PRIODSPR WITH 3 RETURNS TO THE USER FROM THE ASTRONAUT AT CALL LOC +1,+2,+3 AND
063415,000092:                                                                                                  #  AN IMMEDIATE RETURN TO THE USER AT CALL LOC +4.  EXAMPLE FOLLOWS,
063416,000093:                                                                                                  #                CAF     OCTXX           ALARM CODE
063417,000094:                                                                                                  #                TC      BANKCALL
063418,000095:                                                                                                  #                CADR    PRIOLARM
063419,000096: 
063420,000097:                                                                                                  #                ...     ...
063421,000098:                                                                                                  #                ...     ...
063422,000099:                                                                                                  #                ...     ...             ASTRONAUT RETURN
063423,000100:                                                                                                  #                TC      PHASCHNG        IMMEDIATE RETURN TO USER.  RESTART
063424,000101:                                                                                                  #                OCT     X.1             PHASE CHANGE FOR PRIO DISPLAY
063425,000102: 
063426,000103: 10,3766                                           BANK     10                                    
063427,000104: 10,2000                                           SETLOC   DISPLAYS                              
063428,000105: 10,2000                                           BANK                                           
063429,000106: 
063430,000107: 10,3766                                           COUNT    10/DSPLA                              
063431,000108: 10,3766           00004        PRIOLARM           INHINT                                         #  * * * KEEP IN DISPLAY ROUTINES BANK
063432,000109: 10,3767           54001                           TS       L                                     #  SAVE ALARM CODE
063433,000110: 
063434,000111: 10,3770           30133                           CA       BUF2                                  #  2 CADR OF PRIOLARM USER
063435,000112: 10,3771           55363                           TS       ALMCADR                               
063436,000113: 10,3772           30134                           CA       BUF2       +1                         
063437,000114: 10,3773           05657                           TC       PRIOENT    +1                         #  * LEAVE L ALONE
063438,000115: 10,3774           77467        -2SEC              DEC      -200       B-14                       #  *** DONT MOVE
063439,000116: 10,3775           35050                           CAF      V05N09                                
063440,000117: 10,3776           12726                           TCF      PRIODSPR                              
063441,000118: 

Page 1495

063443,000120: 
063444,000121:    5721                                           BLOCK    02                                    
063445,000122:    6000                                           SETLOC   FFTAG13                               
063446,000123:    6000                                           BANK                                           
063447,000124: 
063448,000125:    7755                                           COUNT    02/ALARM                              
063449,000126: 
063450,000127:    7755           00004        BAILOUT            INHINT                                         
063451,000128:    7756           30002                           CA       Q                                     
063452,000129:    7757           55363                           TS       ALMCADR                               
063453,000130: 
063454,000131:    7760           04662                           TC       BANKCALL                              
063455,000132:    7761           40000                           CADR     VAC5STOR                              
063456,000133: 
063457,000134:    7762           51363                           INDEX    ALMCADR                               
063458,000135:    7763           30000                           CAF      0                                     
063459,000136:    7764           05655                           TC       BORTENT                               
063460,000137:    7765           40400        OCT40400           OCT      40400                                 
063461,000138: 
063462,000139:    7766           00004                           INHINT                                         
063463,000140:    7767           35016        WHIMPER            CA       TWO                                   
063464,000141:    7770           60005                           AD       Z                                     
063465,000142:    7771           54017                           TS       BRUPT                                 
063466,000143:    7772           50017                           RESUME                                         
063467,000144:    7773           04701                           TC       POSTJUMP                              #  RESUME SENDS CONTROL HERE
063468,000145:    7774           12651                           CADR     ENEMA                                 
063469,000146: 
063470,000147:    4000                                           SETLOC   FFTAG7                                
063471,000148:    4000                                           BANK                                           
063472,000149: 
063473,000150:    5721           00004        POODOO             INHINT                                         
063474,000151:    5722           30002                           CA       Q                                     
063475,000152:    5723           55363                           TS       ALMCADR                               
063476,000153: 
063477,000154:    5724           04662                           TC       BANKCALL                              
063478,000155:    5725           40000                           CADR     VAC5STOR                              #  STORE ERASABLES FOR DEBUGGING PURPOSES.
063479,000156: 
063480,000157:    5726           51363                           INDEX    ALMCADR                               
063481,000158:    5727           30000                           CAF      0                                     
063482,000159:    5730           05655        ABORT2             TC       BORTENT                               
063483,000160:    5731           77770        OCT77770           OCT      77770                                 #  DONT MOVE
063484,000161:    5732           35012                           CA       V37FLBIT                              #  IS AVERAGE G ON
063485,000162:    5733           70103                           MASK     FLAGWRD7                              
063486,000163:    5734           10000                           CCS      A                                     
063487,000164:    5735           07766                           TC       WHIMPER    -1                         #  YES.  DONT DO POODOO.  DO BAILOUT.
063488,000165: 

Page 1496

063490,000167:    5736           04662                           TC       BANKCALL                              
063491,000168:    5737           12501                           CADR     MR.KLEAN                              
063492,000169:    5740           07767                           TC       WHIMPER                               
063493,000170: 
063494,000171:    5741           00004        CCSHOLE            INHINT                                         
063495,000172:    5742           30002                           CA       Q                                     
063496,000173:    5743           55363                           TS       ALMCADR                               
063497,000174:    5744           04662                           TC       BANKCALL                              
063498,000175:    5745           40000                           CADR     VAC5STOR                              
063499,000176:    5746           35750                           CA       OCT1103                               
063500,000177:    5747           05730                           TC       ABORT2                                
063501,000178:    5750           01103        OCT1103            OCT      1103                                  
063502,000179:    5751           00004        CURTAINS           INHINT                                         
063503,000180:    5752           30002                           CA       Q                                     
063504,000181:    5753           05652                           TC       ALARM2                                
063505,000182:    5754           00217        OCT217             OCT      00217                                 
063506,000183:    5755           01363                           TC       ALMCADR                               #  RETURN TO USER
063507,000184: 
063508,000185:    5756     5217               DOALARM            EQUALS   ENDOFJOB                              
063509,000186: 
063510,000187:                                                                                                  #  CALLING SEQUENCE FOR VARALARM
063511,000188: 
063512,000189:                                                                                                  #                CAF     (ALARM)
063513,000190:                                                                                                  #                TC      VARALARM
063514,000191: 
063515,000192:                                                                                                  #  VARALARM TURNS ON PROGRAM ALARM LIGHT BUT DOES NOT DISPLAY
063516,000193: 
063517,000194:    5756           00004        VARALARM           INHINT                                         
063518,000195: 
063519,000196:    5757           54001                           TS       L                                     #  SAVE USERS ALARM CODE
063520,000197: 
063521,000198:    5760           30002                           CA       Q                                     #  SAVE USERS Q
063522,000199:    5761           55363                           TS       ALMCADR                               
063523,000200: 
063524,000201:    5762           05656                           TC       PRIOENT                               
063525,000202:    5763           00014        OCT14              OCT      14                                    #  DONT MOVE
063526,000203: 
063527,000204:    5764           01363                           TC       ALMCADR                               #  RETURN TO USER
063528,000205: 
063529,000206:    5765     7755               ABORT              EQUALS   BAILOUT                               #  *** TEMPORARY UNTIL ABORT CALLS OUT

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