Source Code

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

They have been adapted from sources files for Comanche 55, and updated via disassembly of binary dumps of original core rope memory modules, part numbers 2003972-1081, 2003972-1091, 2003972-1111, 2003972-1121, 2003972-1131, and 2003972-1141.

Since only binary dumps (rather than listings) of Comanche 67 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.

061748,000002:                                                                                                  ## Copyright:   Public domain.
061749,000003:                                                                                                  ## Filename:    ALARM_AND_ABORT.agc
061750,000004:                                                                                                  ## Purpose:     A section of Comanche revision 067.
061751,000005:                                                                                                  ##              It is part of the reconstructed source code for the flight
061752,000006:                                                                                                  ##              software for the Command Module's (CM) Apollo Guidance Computer
061753,000007:                                                                                                  ##              (AGC) for Apollo 12. No original listings of this program are
061754,000008:                                                                                                  ##              available; instead, this file was created via dissassembly of
061755,000009:                                                                                                  ##              dumps of Comanche 067 core rope modules and comparison with
061756,000010:                                                                                                  ##              other AGC programs.
061757,000011:                                                                                                  ## Assembler:   yaYUL
061758,000012:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
061759,000013:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
061760,000014:                                                                                                  ## Mod history: 2023-08-16 MAS  Created from Comanche 055.
061761,000015:                                                                                                  ##              2024-05-13 MAS  Updated for Comanche 067.
061762,000016: 
061763,000017:                                                                                                  #  THE FOLLOWING SUBROUTINE MAY BE CALLED TO DISPLAY A NON-ABORTIVE ALARM CONDITION.  IT MAY BE CALLED
061764,000018:                                                                                                  #  EITHER IN INTERRUPT OR UNDER EXECUTIVE CONTROL.
061765,000019: 
061766,000020:                                                                                                  #  CALLING SEQUENCE IS AS FOLLOWS:
061767,000021:                                                                                                  #                TC      ALARM
061768,000022:                                                                                                  #                OCT     NNNNN
061769,000023:                                                                                                  #                                        (RETURNS HERE)
061770,000024: 
061771,000025:    5664                                           BLOCK    02                                    
061772,000026:    4000                                           SETLOC   FFTAG7                                
061773,000027:    4000                                           BANK                                           
061774,000028: 
061775,000029:    5664     0374                                  EBANK=   FAILREG                               
061776,000030: 
061777,000031:    5664                                           COUNT    02/ALARM                              
061778,000032: 
061779,000033:                                                                                                  #  ALARM TURNS ON THE PROGRAM ALARM LIGHT, BUT DOES NOT DISPLAY.
061780,000034: 
061781,000035:    5664           00004        ALARM              INHINT                                         
061782,000036: 
061783,000037:    5665           30002                           CA       Q                                     
061784,000038:    5666           55363        ALARM2             TS       ALMCADR                               
061785,000039:    5667           50002                           INDEX    Q                                     
061786,000040:    5670           30000                           CA       0                                     
061787,000041:    5671           54001        BORTENT            TS       L                                     
061788,000042: 
061789,000043:    5672           30006        PRIOENT            CA       BBANK                                 
061790,000044:    5673           00006                 +1        EXTEND                                         
061791,000045:    5674           04007                           ROR      SUPERBNK                              #  ADD SUPER BITS.
061792,000046:    5675           55364                           TS       ALMCADR    +1                         
061793,000047: 
061794,000048:    5676           30002        LARMENT            CA       Q                                     #  STORE RETURN FOR ALARM
061795,000049:    5677           54061                           TS       ITEMP1                                
061796,000050: 
061797,000051:    5700           30164                           CA       LOC                                   
061798,000052:    5701           54057                           TS       LOCALARM                              
061799,000053:    5702           30165                           CA       BANKSET                               
061800,000054:    5703           54060                           TS       BANKALRM                              
061801,000055: 
061802,000056:    5704           10374        CHKFAIL1           CCS      FAILREG                               #  IS ANYTHING IN FAILREG
061803,000057:    5705           15711                           TCF      CHKFAIL2                              #  YES TRY NEXT REG
061804,000058:    5706           30001                           CA       L                                     
061805,000059:    5707           54374                           TS       FAILREG                               
061806,000060:    5710           15715                           TCF      PROGLARM                              #  TURN ALARM LIGHT ON FOR FIRST ALARM
061807,000061: 
061808,000062:    5711           10375        CHKFAIL2           CCS      FAILREG    +1                         
061809,000063:    5712           15715                           TCF      PROGLARM                              
061810,000064:    5713           30001                           CA       L                                     
061811,000065:    5714           54375                           TS       FAILREG    +1                         
061812,000066: 
061813,000067:    5715           22376        PROGLARM           LXCH     FAILREG    +2                         #  STORE AS "MOST RECENT" ALARM CODE
061814,000068: 
061815,000069:    5716           41036                           CS       DSPTAB     +11D                       #  TURN ON PROGRAM ALARM IF OFF
061816,000070:    5717           77765                           MASK     OCT40400                              
061817,000071:    5720           27036                           ADS      DSPTAB     +11D                       
061818,000072: 
061819,000073:    5721           56061        MULTEXIT           XCH      ITEMP1                                #  OBTAIN RETURN ADDRESS IN A
061820,000074:    5722           00003                           RELINT                                         
061821,000075:    5723           50000                           INDEX    A                                     
061822,000076:    5724           00001                           TC       1                                     
061823,000077: 
061824,000078:                                                                                                  #  PRIOLARM DISPLAYS V05N09 VIA PRIODSPR WITH 3 RETURNS TO THE USER FROM THE ASTRONAUT AT CALL LOC +1,+2,+3 AND
061825,000079:                                                                                                  #  AN IMMEDIATE RETURN TO THE USER AT CALL LOC +4.  EXAMPLE FOLLOWS,
061826,000080:                                                                                                  #                CAF     OCTXX           ALARM CODE
061827,000081:                                                                                                  #                TC      BANKCALL
061828,000082:                                                                                                  #                CADR    PRIOLARM
061829,000083: 
061830,000084:                                                                                                  #                ...     ...
061831,000085:                                                                                                  #                ...     ...
061832,000086:                                                                                                  #                ...     ...             ASTRONAUT RETURN
061833,000087:                                                                                                  #                TC      PHASCHNG        IMMEDIATE RETURN TO USER.  RESTART
061834,000088:                                                                                                  #                OCT     X.1             PHASE CHANGE FOR PRIO DISPLAY
061835,000089: 
061836,000090: 10,3766                                           BANK     10                                    
061837,000091: 10,2000                                           SETLOC   DISPLAYS                              
061838,000092: 10,2000                                           BANK                                           
061839,000093: 
061840,000094: 10,3766                                           COUNT    10/DSPLA                              
061841,000095: 10,3766           00004        PRIOLARM           INHINT                                         #  * * * KEEP IN DISPLAY ROUTINES BANK
061842,000096: 10,3767           54001                           TS       L                                     #  SAVE ALARM CODE
061843,000097: 
061844,000098: 10,3770           30133                           CA       BUF2                                  #  2 CADR OF PRIOLARM USER
061845,000099: 10,3771           55363                           TS       ALMCADR                               
061846,000100: 10,3772           30134                           CA       BUF2       +1                         
061847,000101: 10,3773           05673                           TC       PRIOENT    +1                         #  * LEAVE L ALONE
061848,000102: 10,3774           77467        -2SEC              DEC      -200       B-14                       #  *** DONT MOVE
061849,000103: 10,3775           35064                           CAF      V05N09                                
061850,000104: 10,3776           12726                           TCF      PRIODSPR                              
061851,000105: 
061852,000106: 
061853,000107:    5725                                           BLOCK    02                                    
061854,000108:    6000                                           SETLOC   FFTAG13                               
061855,000109:    6000                                           BANK                                           
061856,000110: 
061857,000111:    7755                                           COUNT    02/ALARM                              
061858,000112: 
061859,000113:    7755           00004        BAILOUT            INHINT                                         
061860,000114:    7756           30002                           CA       Q                                     
061861,000115:    7757           55363                           TS       ALMCADR                               
061862,000116: 
061863,000117:    7760           04676                           TC       BANKCALL                              
061864,000118:    7761           40000                           CADR     VAC5STOR                              
061865,000119: 
061866,000120:    7762           51363                           INDEX    ALMCADR                               
061867,000121:    7763           30000                           CAF      0                                     
061868,000122:    7764           05671                           TC       BORTENT                               
061869,000123:    7765           40400        OCT40400           OCT      40400                                 
061870,000124: 
061871,000125:    7766           00004                           INHINT                                         
061872,000126:    7767           35032        WHIMPER            CA       TWO                                   
061873,000127:    7770           60005                           AD       Z                                     
061874,000128:    7771           54017                           TS       BRUPT                                 
061875,000129:    7772           50017                           RESUME                                         
061876,000130:    7773           04715                           TC       POSTJUMP                              #  RESUME SENDS CONTROL HERE
061877,000131:    7774           12651                           CADR     ENEMA                                 
061878,000132: 
061879,000133:    4000                                           SETLOC   FFTAG7                                
061880,000134:    4000                                           BANK                                           
061881,000135: 
061882,000136:    5725           00004        POODOO             INHINT                                         
061883,000137:    5726           30002                           CA       Q                                     
061884,000138:    5727           55363                           TS       ALMCADR                               
061885,000139: 
061886,000140:    5730           04676                           TC       BANKCALL                              
061887,000141:    5731           40000                           CADR     VAC5STOR                              #  STORE ERASABLES FOR DEBUGGING PURPOSES.
061888,000142: 
061889,000143:    5732           51363                           INDEX    ALMCADR                               
061890,000144:    5733           30000                           CAF      0                                     
061891,000145:    5734           05671        ABORT2             TC       BORTENT                               
061892,000146:    5735           77770        OCT77770           OCT      77770                                 #  DONT MOVE
061893,000147:    5736           35026                           CA       V37FLBIT                              #  IS AVERAGE G ON
061894,000148:    5737           70103                           MASK     FLAGWRD7                              
061895,000149:    5740           10000                           CCS      A                                     
061896,000150:    5741           07766                           TC       WHIMPER    -1                         #  YES.  DONT DO POODOO.  DO BAILOUT.
061897,000151: 
061898,000152:    5742           05574                           TC       DOWNFLAG                              
061899,000153:    5743           00067                           ADRES    STATEFLG                              
061900,000154: 
061901,000155:    5744           05574                           TC       DOWNFLAG                              
061902,000156: 
061903,000157:    5745           00236                           ADRES    REINTFLG                              
061904,000158: 
061905,000159:    5746           05574                           TC       DOWNFLAG                              
061906,000160:    5747           00054                           ADRES    NODOFLAG                              
061907,000161: 
061908,000162:    5750           04676                           TC       BANKCALL                              
061909,000163:    5751           12501                           CADR     MR.KLEAN                              
061910,000164:    5752           07767                           TC       WHIMPER                               
061911,000165: 
061912,000166:    5753           00004        CCSHOLE            INHINT                                         
061913,000167:    5754           30002                           CA       Q                                     
061914,000168:    5755           55363                           TS       ALMCADR                               
061915,000169:    5756           04676                           TC       BANKCALL                              
061916,000170:    5757           40000                           CADR     VAC5STOR                              
061917,000171:    5760           35762                           CA       OCT21103                              
061918,000172:    5761           05734                           TC       ABORT2                                
061919,000173:    5762           21103        OCT21103           OCT      21103                                 
061920,000174:    5763           00004        CURTAINS           INHINT                                         
061921,000175:    5764           30002                           CA       Q                                     
061922,000176:    5765           05666                           TC       ALARM2                                
061923,000177:    5766           00217        OCT217             OCT      00217                                 
061924,000178:    5767           01363                           TC       ALMCADR                               #  RETURN TO USER
061925,000179: 
061926,000180:    5770     5233               DOALARM            EQUALS   ENDOFJOB                              
061927,000181: 
061928,000182:                                                                                                  #  CALLING SEQUENCE FOR VARALARM
061929,000183: 
061930,000184:                                                                                                  #                CAF     (ALARM)
061931,000185:                                                                                                  #                TC      VARALARM
061932,000186: 
061933,000187:                                                                                                  #  VARALARM TURNS ON PROGRAM ALARM LIGHT BUT DOES NOT DISPLAY
061934,000188: 
061935,000189:    5770           00004        VARALARM           INHINT                                         
061936,000190: 
061937,000191:    5771           54001                           TS       L                                     #  SAVE USERS ALARM CODE
061938,000192: 
061939,000193:    5772           30002                           CA       Q                                     #  SAVE USERS Q
061940,000194:    5773           55363                           TS       ALMCADR                               
061941,000195: 
061942,000196:    5774           05672                           TC       PRIOENT                               
061943,000197:    5775           00014        OCT14              OCT      14                                    #  DONT MOVE
061944,000198: 
061945,000199:    5776           01363                           TC       ALMCADR                               #  RETURN TO USER
061946,000200: 
061947,000201:    5777     7755               ABORT              EQUALS   BAILOUT                               #  *** TEMPORARY UNTIL ABORT CALLS OUT

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