Source Code

These source-code files were from the printout at the MIT Museum, with many thanks to Deborah Douglas, the Museum's Curator of Science and Technology, for releasing it to us. The printout was digitally photographed by Paul Fjeld. A team of volunteers transcribed the source code manually from these images or, where appropriate, modified already-transcribed but similar source Colossus 249 (Apollo 9) source code to agree with the images from the printout. Note that the page images presented online are of reduced quality, and that higher-quality images are available. Report any conversion errors or legibility problems in page images to info@sandroid.org. Notations on the program listing read, in part:

	GAP:  ASSEMBLE REVISION 055 OF AGC PROGRAM COMANCHE BY NASA 2021113-051
	10:28 APR.  1,1969
Note that the date is the date of the printout, not the date of the program revision.

064960,000002:                                                                                                  ## Copyright:    Public domain.
064961,000003:                                                                                                  ## Filename:     ALARM_AND_ABORT.agc
064962,000004:                                                                                                  ## Purpose:      Part of the source code for Comanche, build 055. It
064963,000005:                                                                                                  ##               is part of the source code for the Command Module's
064964,000006:                                                                                                  ##               (CM) Apollo Guidance Computer (AGC), Apollo 11.
064965,000007:                                                                                                  ## Assembler:    yaYUL
064966,000008:                                                                                                  ## Reference:    pp. 1493-1496
064967,000009:                                                                                                  ## Contact:      Ron Burkey <info@sandroid.org>
064968,000010:                                                                                                  ## Website:      http://www.ibiblio.org/apollo.
064969,000011:                                                                                                  ## Mod history:  2009-05-07 RSB Adapted from Colossus249 file of the same
064970,000012:                                                                                                  ##                              name, and page images. Corrected various 
064971,000013:                                                                                                  ##                              typos in the transcription of program 
064972,000014:                                                                                                  ##                              comments, and these should be back-ported  
064973,000015:                                                                                                  ##                              to Colossus249.
064974,000016:                                                                                                  ##              2010-08-24 JL   Fixed page numbers and some indents.
064975,000017:                                                                                                  ##              2016-12-22 RSB  Proofed comment text using octopus/ProoferComments
064976,000018:                                                                                                  ##                              and corrected the errors found.
064977,000019:                                                                                                  ##
064978,000020:                                                                                                  ## The contents of the "Comanche055" files, in general, are transcribed 
064979,000021:                                                                                                  ## from scanned documents. 
064980,000022:                                                                                                  ##
064981,000023:                                                                                                  ##       Assemble revision 055 of AGC program Comanche by NASA
064982,000024:                                                                                                  ##       2021113-051.  April 1, 1969.  
064983,000025:                                                                                                  ##
064984,000026:                                                                                                  ##       This AGC program shall also be referred to as Colossus 2A
064985,000027:                                                                                                  ##
064986,000028:                                                                                                  ##       Prepared by
064987,000029:                                                                                                  ##                       Massachusetts Institute of Technology
064988,000030:                                                                                                  ##                       75 Cambridge Parkway
064989,000031:                                                                                                  ##                       Cambridge, Massachusetts
064990,000032:                                                                                                  ##
064991,000033:                                                                                                  ##       under NASA contract NAS 9-4065.
064992,000034:                                                                                                  ##
064993,000035:                                                                                                  ## Refer directly to the online document mentioned above for further
064994,000036:                                                                                                  ## information.  Please report any errors to info@sandroid.org.
064995,000037: 

Page 1493

064997,000039:                                                                                                  #  THE FOLLOWING SUBROUTINE MAY BE CALLED TO DISPLAY A NON-ABORTIVE ALARM CONDITION.  IT MAY BE CALLED
064998,000040:                                                                                                  #  EITHER IN INTERRUPT OR UNDER EXECUTIVE CONTROL.
064999,000041: 
065000,000042:                                                                                                  #  CALLING SEQUENCE IS AS FOLLOWS:
065001,000043:                                                                                                  #                TC      ALARM
065002,000044:                                                                                                  #                OCT     NNNNN
065003,000045:                                                                                                  #                                        (RETURNS HERE)
065004,000046: 
065005,000047:    5650                                           BLOCK    02                                    
065006,000048:    4000                                           SETLOC   FFTAG7                                
065007,000049:    4000                                           BANK                                           
065008,000050: 
065009,000051:    5650     0375                                  EBANK=   FAILREG                               
065010,000052: 
065011,000053:    5650                                           COUNT    02/ALARM                              
065012,000054: 
065013,000055:                                                                                                  #  ALARM TURNS ON THE PROGRAM ALARM LIGHT, BUT DOES NOT DISPLAY.
065014,000056: 
065015,000057:    5650           00004        ALARM              INHINT                                         
065016,000058: 
065017,000059:    5651           30002                           CA       Q                                     
065018,000060:    5652           55363        ALARM2             TS       ALMCADR                               
065019,000061:    5653           50002                           INDEX    Q                                     
065020,000062:    5654           30000                           CA       0                                     
065021,000063:    5655           54001        BORTENT            TS       L                                     
065022,000064: 
065023,000065:    5656           30006        PRIOENT            CA       BBANK                                 
065024,000066:    5657           00006                 +1        EXTEND                                         
065025,000067:    5660           04007                           ROR      SUPERBNK                              #  ADD SUPER BITS.
065026,000068:    5661           55364                           TS       ALMCADR    +1                         
065027,000069: 
065028,000070:    5662           30002        LARMENT            CA       Q                                     #  STORE RETURN FOR ALARM
065029,000071:    5663           54061                           TS       ITEMP1                                
065030,000072: 
065031,000073:    5664           30164                           CA       LOC                                   
065032,000074:    5665           54057                           TS       LOCALARM                              
065033,000075:    5666           30165                           CA       BANKSET                               
065034,000076:    5667           54060                           TS       BANKALRM                              
065035,000077: 
065036,000078:    5670           10375        CHKFAIL1           CCS      FAILREG                               #  IS ANYTHING IN FAILREG
065037,000079:    5671           15674                           TCF      CHKFAIL2                              #  YES TRY NEXT REG
065038,000080:    5672           22375                           LXCH     FAILREG                               
065039,000081:    5673           15706                           TCF      PROGLARM                              #  TURN ALARM LIGHT ON FOR FIRST ALARM
065040,000082: 
065041,000083:    5674           10376        CHKFAIL2           CCS      FAILREG    +1                         
065042,000084:    5675           15700                           TCF      FAIL3                                 
065043,000085:    5676           22376                           LXCH     FAILREG    +1                         
065044,000086:    5677           15711                           TCF      MULTEXIT                              
065045,000087: 
065046,000088:    5700           30377        FAIL3              CA       FAILREG    +2                         

Page 1494

065048,000090:    5701           74777                           MASK     POSMAX                                
065049,000091:    5702           10000                           CCS      A                                     
065050,000092:    5703           15715                           TCF      MULTFAIL                              
065051,000093:    5704           22377                           LXCH     FAILREG    +2                         
065052,000094:    5705           15711                           TCF      MULTEXIT                              
065053,000095: 
065054,000096:    5706           41036        PROGLARM           CS       DSPTAB     +11D                       
065055,000097:    5707           77765                           MASK     OCT40400                              
065056,000098:    5710           27036                           ADS      DSPTAB     +11D                       
065057,000099: 
065058,000100:    5711           56061        MULTEXIT           XCH      ITEMP1                                #  OBTAIN RETURN ADDRESS IN A
065059,000101:    5712           00003                           RELINT                                         
065060,000102:    5713           50000                           INDEX    A                                     
065061,000103:    5714           00001                           TC       1                                     
065062,000104: 
065063,000105:    5715           30001        MULTFAIL           CA       L                                     
065064,000106:    5716           65001                           AD       BIT15                                 
065065,000107:    5717           54377                           TS       FAILREG    +2                         
065066,000108: 
065067,000109:    5720           15711                           TCF      MULTEXIT                              
065068,000110: 
065069,000111:                                                                                                  #  PRIOLARM DISPLAYS V05N09 VIA PRIODSPR WITH 3 RETURNS TO THE USER FROM THE ASTRONAUT AT CALL LOC +1,+2,+3 AND
065070,000112:                                                                                                  #  AN IMMEDIATE RETURN TO THE USER AT CALL LOC +4.  EXAMPLE FOLLOWS,
065071,000113:                                                                                                  #                CAF     OCTXX           ALARM CODE
065072,000114:                                                                                                  #                TC      BANKCALL
065073,000115:                                                                                                  #                CADR    PRIOLARM
065074,000116: 
065075,000117:                                                                                                  #                ...     ...
065076,000118:                                                                                                  #                ...     ...
065077,000119:                                                                                                  #                ...     ...             ASTRONAUT RETURN
065078,000120:                                                                                                  #                TC      PHASCHNG        IMMEDIATE RETURN TO USER.  RESTART
065079,000121:                                                                                                  #                OCT     X.1             PHASE CHANGE FOR PRIO DISPLAY
065080,000122: 
065081,000123: 10,3766                                           BANK     10                                    
065082,000124: 10,2000                                           SETLOC   DISPLAYS                              
065083,000125: 10,2000                                           BANK                                           
065084,000126: 
065085,000127: 10,3766                                           COUNT    10/DSPLA                              
065086,000128: 10,3766           00004        PRIOLARM           INHINT                                         #  * * * KEEP IN DISPLAY ROUTINES BANK
065087,000129: 10,3767           54001                           TS       L                                     #  SAVE ALARM CODE
065088,000130: 
065089,000131: 10,3770           30133                           CA       BUF2                                  #  2 CADR OF PRIOLARM USER
065090,000132: 10,3771           55363                           TS       ALMCADR                               
065091,000133: 10,3772           30134                           CA       BUF2       +1                         
065092,000134: 10,3773           05657                           TC       PRIOENT    +1                         #  * LEAVE L ALONE
065093,000135: 10,3774           77467        -2SEC              DEC      -200       B-14                       #  *** DONT MOVE
065094,000136: 10,3775           35050                           CAF      V05N09                                
065095,000137: 10,3776           12726                           TCF      PRIODSPR                              
065096,000138: 

Page 1495

065098,000140: 
065099,000141:    5721                                           BLOCK    02                                    
065100,000142:    6000                                           SETLOC   FFTAG13                               
065101,000143:    6000                                           BANK                                           
065102,000144: 
065103,000145:    7755                                           COUNT    02/ALARM                              
065104,000146: 
065105,000147:    7755           00004        BAILOUT            INHINT                                         
065106,000148:    7756           30002                           CA       Q                                     
065107,000149:    7757           55363                           TS       ALMCADR                               
065108,000150: 
065109,000151:    7760           04662                           TC       BANKCALL                              
065110,000152:    7761           40000                           CADR     VAC5STOR                              
065111,000153: 
065112,000154:    7762           51363                           INDEX    ALMCADR                               
065113,000155:    7763           30000                           CAF      0                                     
065114,000156:    7764           05655                           TC       BORTENT                               
065115,000157:    7765           40400        OCT40400           OCT      40400                                 
065116,000158: 
065117,000159:    7766           00004                           INHINT                                         
065118,000160:    7767           35016        WHIMPER            CA       TWO                                   
065119,000161:    7770           60005                           AD       Z                                     
065120,000162:    7771           54017                           TS       BRUPT                                 
065121,000163:    7772           50017                           RESUME                                         
065122,000164:    7773           04701                           TC       POSTJUMP                              #  RESUME SENDS CONTROL HERE
065123,000165:    7774           12651                           CADR     ENEMA                                 
065124,000166: 
065125,000167:    4000                                           SETLOC   FFTAG7                                
065126,000168:    4000                                           BANK                                           
065127,000169: 
065128,000170:    5721           00004        POODOO             INHINT                                         
065129,000171:    5722           30002                           CA       Q                                     
065130,000172:    5723           55363                           TS       ALMCADR                               
065131,000173: 
065132,000174:    5724           04662                           TC       BANKCALL                              
065133,000175:    5725           40000                           CADR     VAC5STOR                              #  STORE ERASABLES FOR DEBUGGING PURPOSES.
065134,000176: 
065135,000177:    5726           51363                           INDEX    ALMCADR                               
065136,000178:    5727           30000                           CAF      0                                     
065137,000179:    5730           05655        ABORT2             TC       BORTENT                               
065138,000180:    5731           77770        OCT77770           OCT      77770                                 #  DONT MOVE
065139,000181:    5732           35012                           CA       V37FLBIT                              #  IS AVERAGE G ON
065140,000182:    5733           70103                           MASK     FLAGWRD7                              
065141,000183:    5734           10000                           CCS      A                                     
065142,000184:    5735           07766                           TC       WHIMPER    -1                         #  YES.  DONT DO POODOO.  DO BAILOUT.
065143,000185: 
065144,000186:    5736           05560                           TC       DOWNFLAG                              
065145,000187:    5737           00067                           ADRES    STATEFLG                              
065146,000188: 
065147,000189:    5740           05560                           TC       DOWNFLAG                              
065148,000190: 

Page 1496

065150,000192:    5741           00236                           ADRES    REINTFLG                              
065151,000193: 
065152,000194:    5742           05560                           TC       DOWNFLAG                              
065153,000195:    5743           00054                           ADRES    NODOFLAG                              
065154,000196: 
065155,000197:    5744           04662                           TC       BANKCALL                              
065156,000198:    5745           12501                           CADR     MR.KLEAN                              
065157,000199:    5746           07767                           TC       WHIMPER                               
065158,000200: 
065159,000201:    5747           00004        CCSHOLE            INHINT                                         
065160,000202:    5750           30002                           CA       Q                                     
065161,000203:    5751           55363                           TS       ALMCADR                               
065162,000204:    5752           04662                           TC       BANKCALL                              
065163,000205:    5753           40000                           CADR     VAC5STOR                              
065164,000206:    5754           35756                           CA       OCT1103                               
065165,000207:    5755           05730                           TC       ABORT2                                
065166,000208:    5756           01103        OCT1103            OCT      1103                                  
065167,000209:    5757           00004        CURTAINS           INHINT                                         
065168,000210:    5760           30002                           CA       Q                                     
065169,000211:    5761           05652                           TC       ALARM2                                
065170,000212:    5762           00217        OCT217             OCT      00217                                 
065171,000213:    5763           01363                           TC       ALMCADR                               #  RETURN TO USER
065172,000214: 
065173,000215:    5764     5217               DOALARM            EQUALS   ENDOFJOB                              
065174,000216: 
065175,000217:                                                                                                  #  CALLING SEQUENCE FOR VARALARM
065176,000218: 
065177,000219:                                                                                                  #                CAF     (ALARM)
065178,000220:                                                                                                  #                TC      VARALARM
065179,000221: 
065180,000222:                                                                                                  #  VARALARM TURNS ON PROGRAM ALARM LIGHT BUT DOES NOT DISPLAY
065181,000223: 
065182,000224:    5764           00004        VARALARM           INHINT                                         
065183,000225: 
065184,000226:    5765           54001                           TS       L                                     #  SAVE USERS ALARM CODE
065185,000227: 
065186,000228:    5766           30002                           CA       Q                                     #  SAVE USERS Q
065187,000229:    5767           55363                           TS       ALMCADR                               
065188,000230: 
065189,000231:    5770           05656                           TC       PRIOENT                               
065190,000232:    5771           00014        OCT14              OCT      14                                    #  DONT MOVE
065191,000233: 
065192,000234:    5772           01363                           TC       ALMCADR                               #  RETURN TO USER
065193,000235: 
065194,000236:    5773     7755               ABORT              EQUALS   BAILOUT                               #  *** TEMPORARY UNTIL ABORT CALLS OUT

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