Source Code

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

The starting point was the source code of Comanche 45 (itself previously accurately reconstructed). Comanche 45 source code was then modified by incorporating changes known from contemporary documentation to have been made between revisions 45 and 45/2. The now-reconstructed Comanche 45/2 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:
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.

063263,000002:                                                                                                  ## Copyright:   Public domain.
063264,000003:                                                                                                  ## Filename:    ALARM_AND_ABORT.agc
063265,000004:                                                                                                  ## Purpose:     A section of Manche45 revision 2.
063266,000005:                                                                                                  ##              It is part of the reconstructed source code for the
063267,000006:                                                                                                  ##              final, flown release of the flight software for the Command
063268,000007:                                                                                                  ##              Module's (CM) Apollo Guidance Computer (AGC) for Apollo 10.
063269,000008:                                                                                                  ##              The code has been recreated from a copy of Comanche 055. It
063270,000009:                                                                                                  ##              has been adapted such that the resulting bugger words
063271,000010:                                                                                                  ##              exactly match those specified for Manche 45/2 in NASA drawing
063272,000011:                                                                                                  ##              2021153D, which gives relatively high confidence that the
063273,000012:                                                                                                  ##              reconstruction is correct.
063274,000013:                                                                                                  ## Assembler:   yaYUL
063275,000014:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
063276,000015:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
063277,000016:                                                                                                  ## Mod history: 2020-12-24 MAS  Created from Comanche 45.
063278,000017: 

Page 1493

063280,000019:                                                                                                  #  THE FOLLOWING SUBROUTINE MAY BE CALLED TO DISPLAY A NON-ABORTIVE ALARM CONDITION.  IT MAY BE CALLED
063281,000020:                                                                                                  #  EITHER IN INTERRUPT OR UNDER EXECUTIVE CONTROL.
063282,000021: 
063283,000022:                                                                                                  #  CALLING SEQUENCE IS AS FOLLOWS:
063284,000023:                                                                                                  #                TC      ALARM
063285,000024:                                                                                                  #                OCT     NNNNN
063286,000025:                                                                                                  #                                        (RETURNS HERE)
063287,000026: 
063288,000027:    5650                                           BLOCK    02                                    
063289,000028:    4000                                           SETLOC   FFTAG7                                
063290,000029:    4000                                           BANK                                           
063291,000030: 
063292,000031:    5650     0375                                  EBANK=   FAILREG                               
063293,000032: 
063294,000033:    5650                                           COUNT    02/ALARM                              
063295,000034: 
063296,000035:                                                                                                  #  ALARM TURNS ON THE PROGRAM ALARM LIGHT, BUT DOES NOT DISPLAY.
063297,000036: 
063298,000037:    5650           00004        ALARM              INHINT                                         
063299,000038: 
063300,000039:    5651           30002                           CA       Q                                     
063301,000040:    5652           55363        ALARM2             TS       ALMCADR                               
063302,000041:    5653           50002                           INDEX    Q                                     
063303,000042:    5654           30000                           CA       0                                     
063304,000043:    5655           54001        BORTENT            TS       L                                     
063305,000044: 
063306,000045:    5656           30006        PRIOENT            CA       BBANK                                 
063307,000046:    5657           00006                 +1        EXTEND                                         
063308,000047:    5660           04007                           ROR      SUPERBNK                              #  ADD SUPER BITS.
063309,000048:    5661           55364                           TS       ALMCADR    +1                         
063310,000049: 
063311,000050:    5662           30002        LARMENT            CA       Q                                     #  STORE RETURN FOR ALARM
063312,000051:    5663           54061                           TS       ITEMP1                                
063313,000052: 
063314,000053:    5664           30164                           CA       LOC                                   
063315,000054:    5665           54057                           TS       LOCALARM                              
063316,000055:    5666           30165                           CA       BANKSET                               
063317,000056:    5667           54060                           TS       BANKALRM                              
063318,000057: 
063319,000058:    5670           10375        CHKFAIL1           CCS      FAILREG                               #  IS ANYTHING IN FAILREG
063320,000059:    5671           15674                           TCF      CHKFAIL2                              #  YES TRY NEXT REG
063321,000060:    5672           22375                           LXCH     FAILREG                               
063322,000061:    5673           15706                           TCF      PROGLARM                              #  TURN ALARM LIGHT ON FOR FIRST ALARM
063323,000062: 
063324,000063:    5674           10376        CHKFAIL2           CCS      FAILREG    +1                         
063325,000064:    5675           15700                           TCF      FAIL3                                 
063326,000065:    5676           22376                           LXCH     FAILREG    +1                         
063327,000066:    5677           15711                           TCF      MULTEXIT                              
063328,000067: 
063329,000068:    5700           30377        FAIL3              CA       FAILREG    +2                         

Page 1494

063331,000070:    5701           74777                           MASK     POSMAX                                
063332,000071:    5702           10000                           CCS      A                                     
063333,000072:    5703           15715                           TCF      MULTFAIL                              
063334,000073:    5704           22377                           LXCH     FAILREG    +2                         
063335,000074:    5705           15711                           TCF      MULTEXIT                              
063336,000075: 
063337,000076:    5706           41036        PROGLARM           CS       DSPTAB     +11D                       
063338,000077:    5707           77765                           MASK     OCT40400                              
063339,000078:    5710           27036                           ADS      DSPTAB     +11D                       
063340,000079: 
063341,000080:    5711           56061        MULTEXIT           XCH      ITEMP1                                #  OBTAIN RETURN ADDRESS IN A
063342,000081:    5712           00003                           RELINT                                         
063343,000082:    5713           50000                           INDEX    A                                     
063344,000083:    5714           00001                           TC       1                                     
063345,000084: 
063346,000085:    5715           30001        MULTFAIL           CA       L                                     
063347,000086:    5716           65001                           AD       BIT15                                 
063348,000087:    5717           54377                           TS       FAILREG    +2                         
063349,000088: 
063350,000089:    5720           15711                           TCF      MULTEXIT                              
063351,000090: 
063352,000091:                                                                                                  #  PRIOLARM DISPLAYS V05N09 VIA PRIODSPR WITH 3 RETURNS TO THE USER FROM THE ASTRONAUT AT CALL LOC +1,+2,+3 AND
063353,000092:                                                                                                  #  AN IMMEDIATE RETURN TO THE USER AT CALL LOC +4.  EXAMPLE FOLLOWS,
063354,000093:                                                                                                  #                CAF     OCTXX           ALARM CODE
063355,000094:                                                                                                  #                TC      BANKCALL
063356,000095:                                                                                                  #                CADR    PRIOLARM
063357,000096: 
063358,000097:                                                                                                  #                ...     ...
063359,000098:                                                                                                  #                ...     ...
063360,000099:                                                                                                  #                ...     ...             ASTRONAUT RETURN
063361,000100:                                                                                                  #                TC      PHASCHNG        IMMEDIATE RETURN TO USER.  RESTART
063362,000101:                                                                                                  #                OCT     X.1             PHASE CHANGE FOR PRIO DISPLAY
063363,000102: 
063364,000103: 10,3766                                           BANK     10                                    
063365,000104: 10,2000                                           SETLOC   DISPLAYS                              
063366,000105: 10,2000                                           BANK                                           
063367,000106: 
063368,000107: 10,3766                                           COUNT    10/DSPLA                              
063369,000108: 10,3766           00004        PRIOLARM           INHINT                                         #  * * * KEEP IN DISPLAY ROUTINES BANK
063370,000109: 10,3767           54001                           TS       L                                     #  SAVE ALARM CODE
063371,000110: 
063372,000111: 10,3770           30133                           CA       BUF2                                  #  2 CADR OF PRIOLARM USER
063373,000112: 10,3771           55363                           TS       ALMCADR                               
063374,000113: 10,3772           30134                           CA       BUF2       +1                         
063375,000114: 10,3773           05657                           TC       PRIOENT    +1                         #  * LEAVE L ALONE
063376,000115: 10,3774           77467        -2SEC              DEC      -200       B-14                       #  *** DONT MOVE
063377,000116: 10,3775           35050                           CAF      V05N09                                
063378,000117: 10,3776           12726                           TCF      PRIODSPR                              
063379,000118: 

Page 1495

063381,000120: 
063382,000121:    5721                                           BLOCK    02                                    
063383,000122:    6000                                           SETLOC   FFTAG13                               
063384,000123:    6000                                           BANK                                           
063385,000124: 
063386,000125:    7755                                           COUNT    02/ALARM                              
063387,000126: 
063388,000127:    7755           00004        BAILOUT            INHINT                                         
063389,000128:    7756           30002                           CA       Q                                     
063390,000129:    7757           55363                           TS       ALMCADR                               
063391,000130: 
063392,000131:    7760           04662                           TC       BANKCALL                              
063393,000132:    7761           40000                           CADR     VAC5STOR                              
063394,000133: 
063395,000134:    7762           51363                           INDEX    ALMCADR                               
063396,000135:    7763           30000                           CAF      0                                     
063397,000136:    7764           05655                           TC       BORTENT                               
063398,000137:    7765           40400        OCT40400           OCT      40400                                 
063399,000138: 
063400,000139:    7766           00004                           INHINT                                         
063401,000140:    7767           35016        WHIMPER            CA       TWO                                   
063402,000141:    7770           60005                           AD       Z                                     
063403,000142:    7771           54017                           TS       BRUPT                                 
063404,000143:    7772           50017                           RESUME                                         
063405,000144:    7773           04701                           TC       POSTJUMP                              #  RESUME SENDS CONTROL HERE
063406,000145:    7774           12651                           CADR     ENEMA                                 
063407,000146: 
063408,000147:    4000                                           SETLOC   FFTAG7                                
063409,000148:    4000                                           BANK                                           
063410,000149: 
063411,000150:    5721           00004        POODOO             INHINT                                         
063412,000151:    5722           30002                           CA       Q                                     
063413,000152:    5723           55363                           TS       ALMCADR                               
063414,000153: 
063415,000154:    5724           04662                           TC       BANKCALL                              
063416,000155:    5725           40000                           CADR     VAC5STOR                              #  STORE ERASABLES FOR DEBUGGING PURPOSES.
063417,000156: 
063418,000157:    5726           51363                           INDEX    ALMCADR                               
063419,000158:    5727           30000                           CAF      0                                     
063420,000159:    5730           05655        ABORT2             TC       BORTENT                               
063421,000160:    5731           77770        OCT77770           OCT      77770                                 #  DONT MOVE
063422,000161:    5732           35012                           CA       V37FLBIT                              #  IS AVERAGE G ON
063423,000162:    5733           70103                           MASK     FLAGWRD7                              
063424,000163:    5734           10000                           CCS      A                                     
063425,000164:    5735           07766                           TC       WHIMPER    -1                         #  YES.  DONT DO POODOO.  DO BAILOUT.
063426,000165: 

Page 1496

063428,000167:    5736           04662                           TC       BANKCALL                              
063429,000168:    5737           12501                           CADR     MR.KLEAN                              
063430,000169:    5740           07767                           TC       WHIMPER                               
063431,000170: 
063432,000171:    5741           00004        CCSHOLE            INHINT                                         
063433,000172:    5742           30002                           CA       Q                                     
063434,000173:    5743           55363                           TS       ALMCADR                               
063435,000174:    5744           04662                           TC       BANKCALL                              
063436,000175:    5745           40000                           CADR     VAC5STOR                              
063437,000176:    5746           35750                           CA       OCT1103                               
063438,000177:    5747           05730                           TC       ABORT2                                
063439,000178:    5750           01103        OCT1103            OCT      1103                                  
063440,000179:    5751           00004        CURTAINS           INHINT                                         
063441,000180:    5752           30002                           CA       Q                                     
063442,000181:    5753           05652                           TC       ALARM2                                
063443,000182:    5754           00217        OCT217             OCT      00217                                 
063444,000183:    5755           01363                           TC       ALMCADR                               #  RETURN TO USER
063445,000184: 
063446,000185:    5756     5217               DOALARM            EQUALS   ENDOFJOB                              
063447,000186: 
063448,000187:                                                                                                  #  CALLING SEQUENCE FOR VARALARM
063449,000188: 
063450,000189:                                                                                                  #                CAF     (ALARM)
063451,000190:                                                                                                  #                TC      VARALARM
063452,000191: 
063453,000192:                                                                                                  #  VARALARM TURNS ON PROGRAM ALARM LIGHT BUT DOES NOT DISPLAY
063454,000193: 
063455,000194:    5756           00004        VARALARM           INHINT                                         
063456,000195: 
063457,000196:    5757           54001                           TS       L                                     #  SAVE USERS ALARM CODE
063458,000197: 
063459,000198:    5760           30002                           CA       Q                                     #  SAVE USERS Q
063460,000199:    5761           55363                           TS       ALMCADR                               
063461,000200: 
063462,000201:    5762           05656                           TC       PRIOENT                               
063463,000202:    5763           00014        OCT14              OCT      14                                    #  DONT MOVE
063464,000203: 
063465,000204:    5764           01363                           TC       ALMCADR                               #  RETURN TO USER
063466,000205: 
063467,000206:    5765     7755               ABORT              EQUALS   BAILOUT                               #  *** TEMPORARY UNTIL ABORT CALLS OUT

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