Source Code

These source-code files are part of a reconstructed copy of Comanche 72, the first release of the Apollo Guidance Computer (AGC) Command Module (CM) software for Apollo 13.

They have been adapted from sources files created from a listing of Comanche 55. These source files were updated to match binary dumps of a set of Comanche 67 rope modules. They were then further modified by applying known changes between Comanche 67 and Comanche 72. A binary dump of module B2 of Comanche 72, part number 2010802-021, was also used to validate changes made to banks 05-13. The resulting code assembles to have identical memory-bank checksums as those specified in NASA drawing 2021153G; this gives reasonably high confidence that the changes that have been made are correct. In places where ambiguity exists, this ambiguity is discussed in "## Reconstruction:" comments.

Since no contemporary listings of Comanche 72 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.

062238,000002:                                                                                                  ## Copyright:   Public domain.
062239,000003:                                                                                                  ## Filename:    ALARM_AND_ABORT.agc
062240,000004:                                                                                                  ## Purpose:     A section of Comanche revision 072.
062241,000005:                                                                                                  ##              It is part of the reconstructed source code for the first
062242,000006:                                                                                                  ##              release of the software for the Command Module's (CM) Apollo
062243,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 13. No original listings
062244,000008:                                                                                                  ##              of this program are available; instead, this file was recreated
062245,000009:                                                                                                  ##              from a printout of Comanche 055, binary dumps of a set of
062246,000010:                                                                                                  ##              Comanche 067 rope modules, and changelogs between Comanche 067
062247,000011:                                                                                                  ##              and 072. It has been adapted such that the resulting bugger words
062248,000012:                                                                                                  ##              exactly match those specified for Comanche 072 in NASA drawing
062249,000013:                                                                                                  ##              2021153G, which gives relatively high confidence that the
062250,000014:                                                                                                  ##              reconstruction is correct.
062251,000015:                                                                                                  ## Assembler:   yaYUL
062252,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
062253,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
062254,000018:                                                                                                  ## Mod history: 2024-05-13 MAS  Created from Comanche 067.
062255,000019: 
062256,000020:                                                                                                  #  THE FOLLOWING SUBROUTINE MAY BE CALLED TO DISPLAY A NON-ABORTIVE ALARM CONDITION.  IT MAY BE CALLED
062257,000021:                                                                                                  #  EITHER IN INTERRUPT OR UNDER EXECUTIVE CONTROL.
062258,000022: 
062259,000023:                                                                                                  #  CALLING SEQUENCE IS AS FOLLOWS:
062260,000024:                                                                                                  #                TC      ALARM
062261,000025:                                                                                                  #                OCT     NNNNN
062262,000026:                                                                                                  #                                        (RETURNS HERE)
062263,000027: 
062264,000028:    5664                                           BLOCK    02                                    
062265,000029:    4000                                           SETLOC   FFTAG7                                
062266,000030:    4000                                           BANK                                           
062267,000031: 
062268,000032:    5664     0374                                  EBANK=   FAILREG                               
062269,000033: 
062270,000034:    5664                                           COUNT    02/ALARM                              
062271,000035: 
062272,000036:                                                                                                  #  ALARM TURNS ON THE PROGRAM ALARM LIGHT, BUT DOES NOT DISPLAY.
062273,000037: 
062274,000038:    5664           00004        ALARM              INHINT                                         
062275,000039: 
062276,000040:    5665           30002                           CA       Q                                     
062277,000041:    5666           55363        ALARM2             TS       ALMCADR                               
062278,000042:    5667           50002                           INDEX    Q                                     
062279,000043:    5670           30000                           CA       0                                     
062280,000044:    5671           54001        BORTENT            TS       L                                     
062281,000045: 
062282,000046:    5672           30006        PRIOENT            CA       BBANK                                 
062283,000047:    5673           00006                 +1        EXTEND                                         
062284,000048:    5674           04007                           ROR      SUPERBNK                              #  ADD SUPER BITS.
062285,000049:    5675           55364                           TS       ALMCADR    +1                         
062286,000050: 
062287,000051:    5676           30002        LARMENT            CA       Q                                     #  STORE RETURN FOR ALARM
062288,000052:    5677           54061                           TS       ITEMP1                                
062289,000053: 
062290,000054:    5700           30164                           CA       LOC                                   
062291,000055:    5701           54057                           TS       LOCALARM                              
062292,000056:    5702           30165                           CA       BANKSET                               
062293,000057:    5703           54060                           TS       BANKALRM                              
062294,000058: 
062295,000059:    5704           10374        CHKFAIL1           CCS      FAILREG                               #  IS ANYTHING IN FAILREG
062296,000060:    5705           15711                           TCF      CHKFAIL2                              #  YES TRY NEXT REG
062297,000061:    5706           30001                           CA       L                                     
062298,000062:    5707           54374                           TS       FAILREG                               
062299,000063:    5710           15715                           TCF      PROGLARM                              #  TURN ALARM LIGHT ON FOR FIRST ALARM
062300,000064: 
062301,000065:    5711           10375        CHKFAIL2           CCS      FAILREG    +1                         
062302,000066:    5712           15715                           TCF      PROGLARM                              
062303,000067:    5713           30001                           CA       L                                     
062304,000068:    5714           54375                           TS       FAILREG    +1                         
062305,000069: 
062306,000070:    5715           22376        PROGLARM           LXCH     FAILREG    +2                         #  STORE AS "MOST RECENT" ALARM CODE
062307,000071: 
062308,000072:    5716           41036                           CS       DSPTAB     +11D                       #  TURN ON PROGRAM ALARM IF OFF
062309,000073:    5717           77765                           MASK     OCT40400                              
062310,000074:    5720           27036                           ADS      DSPTAB     +11D                       
062311,000075: 
062312,000076:    5721           56061        MULTEXIT           XCH      ITEMP1                                #  OBTAIN RETURN ADDRESS IN A
062313,000077:    5722           00003                           RELINT                                         
062314,000078:    5723           50000                           INDEX    A                                     
062315,000079:    5724           00001                           TC       1                                     
062316,000080: 
062317,000081:                                                                                                  #  PRIOLARM DISPLAYS V05N09 VIA PRIODSPR WITH 3 RETURNS TO THE USER FROM THE ASTRONAUT AT CALL LOC +1,+2,+3 AND
062318,000082:                                                                                                  #  AN IMMEDIATE RETURN TO THE USER AT CALL LOC +4.  EXAMPLE FOLLOWS,
062319,000083:                                                                                                  #                CAF     OCTXX           ALARM CODE
062320,000084:                                                                                                  #                TC      BANKCALL
062321,000085:                                                                                                  #                CADR    PRIOLARM
062322,000086: 
062323,000087:                                                                                                  #                ...     ...
062324,000088:                                                                                                  #                ...     ...
062325,000089:                                                                                                  #                ...     ...             ASTRONAUT RETURN
062326,000090:                                                                                                  #                TC      PHASCHNG        IMMEDIATE RETURN TO USER.  RESTART
062327,000091:                                                                                                  #                OCT     X.1             PHASE CHANGE FOR PRIO DISPLAY
062328,000092: 
062329,000093: 10,3766                                           BANK     10                                    
062330,000094: 10,2000                                           SETLOC   DISPLAYS                              
062331,000095: 10,2000                                           BANK                                           
062332,000096: 
062333,000097: 10,3766                                           COUNT    10/DSPLA                              
062334,000098: 10,3766           00004        PRIOLARM           INHINT                                         #  * * * KEEP IN DISPLAY ROUTINES BANK
062335,000099: 10,3767           54001                           TS       L                                     #  SAVE ALARM CODE
062336,000100: 
062337,000101: 10,3770           30133                           CA       BUF2                                  #  2 CADR OF PRIOLARM USER
062338,000102: 10,3771           55363                           TS       ALMCADR                               
062339,000103: 10,3772           30134                           CA       BUF2       +1                         
062340,000104: 10,3773           05673                           TC       PRIOENT    +1                         #  * LEAVE L ALONE
062341,000105: 10,3774           77467        -2SEC              DEC      -200       B-14                       #  *** DONT MOVE
062342,000106: 10,3775           35064                           CAF      V05N09                                
062343,000107: 10,3776           12726                           TCF      PRIODSPR                              
062344,000108: 
062345,000109: 
062346,000110:    5725                                           BLOCK    02                                    
062347,000111:    6000                                           SETLOC   FFTAG13                               
062348,000112:    6000                                           BANK                                           
062349,000113: 
062350,000114:    7755                                           COUNT    02/ALARM                              
062351,000115: 
062352,000116:    7755           00004        BAILOUT            INHINT                                         
062353,000117:    7756           30002                           CA       Q                                     
062354,000118:    7757           55363                           TS       ALMCADR                               
062355,000119: 
062356,000120:    7760           04676                           TC       BANKCALL                              
062357,000121:    7761           40000                           CADR     VAC5STOR                              
062358,000122: 
062359,000123:    7762           51363                           INDEX    ALMCADR                               
062360,000124:    7763           30000                           CAF      0                                     
062361,000125:    7764           05671                           TC       BORTENT                               
062362,000126:    7765           40400        OCT40400           OCT      40400                                 
062363,000127: 
062364,000128:    7766           00004                           INHINT                                         
062365,000129:    7767           35032        WHIMPER            CA       TWO                                   
062366,000130:    7770           60005                           AD       Z                                     
062367,000131:    7771           54017                           TS       BRUPT                                 
062368,000132:    7772           50017                           RESUME                                         
062369,000133:    7773           04715                           TC       POSTJUMP                              #  RESUME SENDS CONTROL HERE
062370,000134:    7774           12651                           CADR     ENEMA                                 
062371,000135: 
062372,000136:    4000                                           SETLOC   FFTAG7                                
062373,000137:    4000                                           BANK                                           
062374,000138: 
062375,000139:    5725           00004        POODOO             INHINT                                         
062376,000140:    5726           30002                           CA       Q                                     
062377,000141:    5727           55363                           TS       ALMCADR                               
062378,000142: 
062379,000143:    5730           04676                           TC       BANKCALL                              
062380,000144:    5731           40000                           CADR     VAC5STOR                              #  STORE ERASABLES FOR DEBUGGING PURPOSES.
062381,000145: 
062382,000146:    5732           51363                           INDEX    ALMCADR                               
062383,000147:    5733           30000                           CAF      0                                     
062384,000148:    5734           05671        ABORT2             TC       BORTENT                               
062385,000149:    5735           77770        OCT77770           OCT      77770                                 #  DONT MOVE
062386,000150:    5736           35026                           CA       V37FLBIT                              #  IS AVERAGE G ON
062387,000151:    5737           70103                           MASK     FLAGWRD7                              
062388,000152:    5740           10000                           CCS      A                                     
062389,000153:    5741           07766                           TC       WHIMPER    -1                         #  YES.  DONT DO POODOO.  DO BAILOUT.
062390,000154: 
062391,000155:    5742           05574                           TC       DOWNFLAG                              
062392,000156:    5743           00067                           ADRES    STATEFLG                              
062393,000157: 
062394,000158:    5744           05574                           TC       DOWNFLAG                              
062395,000159: 
062396,000160:    5745           00236                           ADRES    REINTFLG                              
062397,000161: 
062398,000162:    5746           05574                           TC       DOWNFLAG                              
062399,000163:    5747           00054                           ADRES    NODOFLAG                              
062400,000164: 
062401,000165:    5750           04676                           TC       BANKCALL                              
062402,000166:    5751           12501                           CADR     MR.KLEAN                              
062403,000167:    5752           07767                           TC       WHIMPER                               
062404,000168: 
062405,000169:    5753           00004        CCSHOLE            INHINT                                         
062406,000170:    5754           30002                           CA       Q                                     
062407,000171:    5755           55363                           TS       ALMCADR                               
062408,000172:    5756           04676                           TC       BANKCALL                              
062409,000173:    5757           40000                           CADR     VAC5STOR                              
062410,000174:    5760           35762                           CA       OCT21103                              
062411,000175:    5761           05734                           TC       ABORT2                                
062412,000176:    5762           21103        OCT21103           OCT      21103                                 
062413,000177:    5763           00004        CURTAINS           INHINT                                         
062414,000178:    5764           30002                           CA       Q                                     
062415,000179:    5765           05666                           TC       ALARM2                                
062416,000180:    5766           00217        OCT217             OCT      00217                                 
062417,000181:    5767           01363                           TC       ALMCADR                               #  RETURN TO USER
062418,000182: 
062419,000183:    5770     5233               DOALARM            EQUALS   ENDOFJOB                              
062420,000184: 
062421,000185:                                                                                                  #  CALLING SEQUENCE FOR VARALARM
062422,000186: 
062423,000187:                                                                                                  #                CAF     (ALARM)
062424,000188:                                                                                                  #                TC      VARALARM
062425,000189: 
062426,000190:                                                                                                  #  VARALARM TURNS ON PROGRAM ALARM LIGHT BUT DOES NOT DISPLAY
062427,000191: 
062428,000192:    5770           00004        VARALARM           INHINT                                         
062429,000193: 
062430,000194:    5771           54001                           TS       L                                     #  SAVE USERS ALARM CODE
062431,000195: 
062432,000196:    5772           30002                           CA       Q                                     #  SAVE USERS Q
062433,000197:    5773           55363                           TS       ALMCADR                               
062434,000198: 
062435,000199:    5774           05672                           TC       PRIOENT                               
062436,000200:    5775           00014        OCT14              OCT      14                                    #  DONT MOVE
062437,000201: 
062438,000202:    5776           01363                           TC       ALMCADR                               #  RETURN TO USER
062439,000203: 
062440,000204:    5777     7755               ABORT              EQUALS   BAILOUT                               #  *** TEMPORARY UNTIL ABORT CALLS OUT

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