Source Code

This is the source-code for the Apollo 9 Command Module's Guidance Computer. These files were derived originally from the scan from MIT's Dibner Institute's now-discontinued website titled "History of Recent Science and Technology", which in turn was originally created by Gary Neff, though his high-quality scans were unfortunately reduced in legibility when presented online. The markings on the front of the printout imply that it was the original AGC developer Norm Brodeur's copy. A scan by Ron Burkey has superceded it, made from a more-legible copy from the collection of original AGC developer Fred Martin. The source code was transcribed from those images by Ron Burkey. 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:

	ASSEMBLE REVISION 249 OF AGC PROGRAM COLOSSUS BY NASA 2021111-041
	20'35 OCT. 28,1968
Note that the date is the date of the printout, not the date of the program revision.

063872,000002:                                                                                                  ## Copyright:   Public domain.
063873,000003:                                                                                                  ## Filename:    ALARM_AND_ABORT.agc
063874,000004:                                                                                                  ## Purpose:     Part of the source code for Colossus, build 249.
063875,000005:                                                                                                  ##              It is part of the source code for the Command Module's (CM)
063876,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for Apollo 9.
063877,000007:                                                                                                  ## Assembler:   yaYUL
063878,000008:                                                                                                  ## Reference:   Starts on p. 1461
063879,000009:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
063880,000010:                                                                                                  ## Website:     www.ibiblio.org/apollo.
063881,000011:                                                                                                  ## Mod history: 08/30/04   RSB  Adapted from corresponding Luminary131 file.
063882,000012:                                                                                                  ##              2010-10-24 JL   Indentation fixes.
063883,000013:                                                                                                  ##              2011-05-07 JL   Removed workarounds.
063884,000014:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
063885,000015:                                                                                                  ##                              original harcopy, as opposed to the PDF page
063886,000016:                                                                                                  ##                              numbers in 1701.pdf.
063887,000017:                                                                                                  ##              2017-01-07 RSB  Cross-diff'd comment text (not whitespace)
063888,000018:                                                                                                  ##                              vs the already-proofed corresponding Colossus
063889,000019:                                                                                                  ##                              237 and Comanche 55 source-code files
063890,000020:                                                                                                  ##                              and corrected errors found.
063891,000021:                                                                                                  ##
063892,000022:                                                                                                  ## The contents of the "Colossus249" files, in general, are transcribed 
063893,000023:                                                                                                  ## from a scanned copy of the program listing.  Notations on this
063894,000024:                                                                                                  ## document read, in part:
063895,000025:                                                                                                  ##
063896,000026:                                                                                                  ##      Assemble revision 249 of AGC program Colossus by NASA
063897,000027:                                                                                                  ##      2021111-041.  October 28, 1968.  
063898,000028:                                                                                                  ##
063899,000029:                                                                                                  ##      This AGC program shall also be referred to as
063900,000030:                                                                                                  ##                              Colossus 1A
063901,000031:                                                                                                  ##
063902,000032:                                                                                                  ##      Prepared by
063903,000033:                                                                                                  ##                      Massachusetts Institute of Technology
063904,000034:                                                                                                  ##                      75 Cambridge Parkway
063905,000035:                                                                                                  ##                      Cambridge, Massachusetts
063906,000036:                                                                                                  ##      under NASA contract NAS 9-4065.
063907,000037:                                                                                                  ##
063908,000038:                                                                                                  ## Refer directly to the online document mentioned above for further information.
063909,000039:                                                                                                  ## Please report any errors (relative to the scanned pages) to info@sandroid.org.
063910,000040:                                                                                                  ##
063911,000041:                                                                                                  ## In some cases, where the source code for Luminary 131 overlaps that of 
063912,000042:                                                                                                  ## Colossus 249, this code is instead copied from the corresponding Luminary 131
063913,000043:                                                                                                  ## source file, and then is proofed to incorporate any changes.
063914,000044: 

Page 1461

063916,000046:                                                                                                  #  THE FOLLOWING SUBROUTINE MAY BE CALLED TO DISPLAY A NON-ABORTIVE ALARM CONDITION.  IT MAY BE CALLED
063917,000047:                                                                                                  #  EITHER IN INTERRUPT OR UNDER EXECUTIVE CONTROL.
063918,000048: 
063919,000049:                                                                                                  #  CALLING SEQUENCE IS AS FOLLOWS:
063920,000050:                                                                                                  #                TC      ALARM
063921,000051:                                                                                                  #                OCT     AAANN           ALARM NO. NN IN GENERAL AREA AAA.
063922,000052:                                                                                                  #                                        (RETURNS HERE)
063923,000053: 
063924,000054:    5537                                           BLOCK    02                                    
063925,000055:    4000                                           SETLOC   FFTAG7                                
063926,000056:    4000                                           BANK                                           
063927,000057: 
063928,000058:    5537     0375                                  EBANK=   FAILREG                               
063929,000059: 
063930,000060:    5537                                           COUNT    02/ALARM                              
063931,000061: 
063932,000062:                                                                                                  #  ALARM TURNS ON THE PROGRAM ALARM LIGHT, BUT DOES NOT DISPLAY.
063933,000063: 
063934,000064:    5537           00004        ALARM              INHINT                                         
063935,000065: 
063936,000066:    5540           30002                           CA       Q                                     
063937,000067:    5541           55363        ALARM2             TS       ALMCADR                               
063938,000068:    5542           50002                           INDEX    Q                                     
063939,000069:    5543           30000                           CA       0                                     
063940,000070:    5544           54001        BORTENT            TS       L                                     
063941,000071: 
063942,000072:    5545           30006        PRIOENT            CA       BBANK                                 
063943,000073:    5546           00006                 +1        EXTEND                                         
063944,000074:    5547           04007                           ROR      SUPERBNK                              #  ADD SUPER BITS.
063945,000075:    5550           55364                           TS       ALMCADR    +1                         
063946,000076: 
063947,000077:    5551           30002        LARMENT            CA       Q                                     #  STORE RETURN FOR ALARM
063948,000078:    5552           54061                           TS       ITEMP1                                
063949,000079: 
063950,000080:    5553           10375        CHKFAIL1           CCS      FAILREG                               #  IS ANYTHING IN FAILREG
063951,000081:    5554           15557                           TCF      CHKFAIL2                              #  YES TRY NEXT REG
063952,000082:    5555           22375                           LXCH     FAILREG                               
063953,000083:    5556           15571                           TCF      PROGLARM                              #  TURN ALARM LIGHT ON FOR FIRST ALARM
063954,000084: 
063955,000085:    5557           10376        CHKFAIL2           CCS      FAILREG    +1                         
063956,000086:    5560           15563                           TCF      FAIL3                                 
063957,000087:    5561           22376                           LXCH     FAILREG    +1                         
063958,000088:    5562           15574                           TCF      MULTEXIT                              
063959,000089: 
063960,000090:    5563           30377        FAIL3              CA       FAILREG    +2                         
063961,000091:    5564           74672                           MASK     POSMAX                                
063962,000092:    5565           10000                           CCS      A                                     
063963,000093:    5566           15600                           TCF      MULTFAIL                              
063964,000094:    5567           22377                           LXCH     FAILREG    +2                         

Page 1462

063966,000096:    5570           15574                           TCF      MULTEXIT                              
063967,000097: 
063968,000098:    5571           41036        PROGLARM           CS       DSPTAB     +11D                       
063969,000099:    5572           75612                           MASK     OCT40400                              
063970,000100:    5573           27036                           ADS      DSPTAB     +11D                       
063971,000101: 
063972,000102:    5574           56061        MULTEXIT           XCH      ITEMP1                                #  OBTAIN RETURN ADDRESS IN A
063973,000103:    5575           00003                           RELINT                                         
063974,000104:    5576           50000                           INDEX    A                                     
063975,000105:    5577           00001                           TC       1                                     
063976,000106: 
063977,000107:    5600           30001        MULTFAIL           CA       L                                     
063978,000108:    5601           64674                           AD       BIT15                                 
063979,000109:    5602           54377                           TS       FAILREG    +2                         
063980,000110: 
063981,000111:    5603           15574                           TCF      MULTEXIT                              
063982,000112: 
063983,000113:                                                                                                  #  PRIOLARM DISPLAYS V05N09 VIA PRIODSPR WITH 3 RETURNS TO THE USER FROM THE ASTRONAUT AT CALL LOC +1,+2,+3 AND
063984,000114:                                                                                                  #  AN IMMEDIATE RETURN TO THE USER AT CALL LOC +4.  EXAMPLE FOLLOWS,
063985,000115:                                                                                                  #                CAF     OCTXX           ALARM CODE
063986,000116:                                                                                                  #                TC      BANKCALL
063987,000117:                                                                                                  #                CADR    PRIOLARM
063988,000118:                                                                                                  #                ...     ...
063989,000119:                                                                                                  #                ...     ...
063990,000120:                                                                                                  #                ...     ...             ASTRONAUT RETURN
063991,000121:                                                                                                  #                TC      PHASCHNG        IMMEDIATE RETURN TO USER.  RESTART
063992,000122:                                                                                                  #                OCT     X.1             PHASE CHANGE FOR PRIO DISPLAY
063993,000123: 
063994,000124: 10,3671                                           BANK     10                                    
063995,000125: 10,2000                                           SETLOC   DISPLAYS                              
063996,000126: 10,2000                                           BANK                                           
063997,000127: 
063998,000128: 10,3671                                           COUNT    10/DSPLA                              
063999,000129: 10,3671           00004        PRIOLARM           INHINT                                         #  * * * KEEP IN DISPLAY ROUTINES BANK
064000,000130: 10,3672           54001                           TS       L                                     #  SAVE ALARM CODE
064001,000131: 
064002,000132: 10,3673           30133                           CA       BUF2                                  #  2 CADR OF PRIOLARM USER
064003,000133: 10,3674           55363                           TS       ALMCADR                               
064004,000134: 10,3675           30134                           CA       BUF2       +1                         
064005,000135: 10,3676           05546                           TC       PRIOENT    +1                         #  * LEAVE L ALONE
064006,000136: 10,3677           77467        -2SEC              DEC      -200       B-14                       #  *** DONT MOVE
064007,000137: 10,3700           34743                           CAF      V05N09                                
064008,000138: 10,3701           12632                           TCF      PRIODSPR                              
064009,000139: 
064010,000140:    5604                                           BLOCK    02                                    
064011,000141:    4000                                           SETLOC   FFTAG7                                
064012,000142:    4000                                           BANK                                           
064013,000143: 

Page 1463

064015,000145:    5604                                           COUNT    02/ALARM                              
064016,000146: 
064017,000147:    5604           00004        BAILOUT            INHINT                                         
064018,000148:    5605           30002                           CA       Q                                     
064019,000149:    5606           55363                           TS       ALMCADR                               
064020,000150: 
064021,000151:    5607           50002                           INDEX    Q                                     
064022,000152:    5610           30000                           CAF      0                                     
064023,000153:    5611           05544                           TC       BORTENT                               
064024,000154:    5612           40400        OCT40400           OCT      40400                                 
064025,000155: 
064026,000156:    5613           00004                           INHINT                                         
064027,000157:    5614           34711        WHIMPER            CA       TWO                                   
064028,000158:    5615           60005                           AD       Z                                     
064029,000159:    5616           54017                           TS       BRUPT                                 
064030,000160:    5617           50017                           RESUME                                         
064031,000161:    5620           04574                           TC       POSTJUMP                              #  RESUME SENDS CONTROL HERE
064032,000162:    5621           12641                           CADR     ENEMA                                 
064033,000163:    5622           00004        POODOO             INHINT                                         
064034,000164:    5623           30002                           CA       Q                                     
064035,000165:    5624           55363        ABORT2             TS       ALMCADR                               
064036,000166:    5625           50002                           INDEX    Q                                     
064037,000167:    5626           30000                           CAF      0                                     
064038,000168:    5627           05544                           TC       BORTENT                               
064039,000169:    5630           77770        OCT77770           OCT      77770                                 #  DONT MOVE
064040,000170:    5631           34705                           CA       V37FLBIT                              #  IS AVERAGE G ON
064041,000171:    5632           70103                           MASK     FLAGWRD7                              
064042,000172:    5633           10000                           CCS      A                                     
064043,000173:    5634           05613                           TC       WHIMPER    -1                         #  YES.  DONT DO POODOO.  DO BAILOUT.
064044,000174: 
064045,000175:    5635           04555                           TC       BANKCALL                              
064046,000176:    5636           12474                           CADR     MR.KLEAN                              
064047,000177:    5637           05614                           TC       WHIMPER                               
064048,000178: 
064049,000179:    5640           00004        CCSHOLE            INHINT                                         
064050,000180:    5641           30002                           CA       Q                                     
064051,000181:    5642           05624                           TC       ABORT2                                
064052,000182:    5643           01103        OCT1103            OCT      1103                                  
064053,000183:    5644           00004        CURTAINS           INHINT                                         
064054,000184:    5645           30002                           CA       Q                                     
064055,000185:    5646           05541                           TC       ALARM2                                
064056,000186:    5647           00217        OCT217             OCT      00217                                 
064057,000187:    5650           01363                           TC       ALMCADR                               #  RETURN TO USER
064058,000188: 
064059,000189:    5651     5112               DOALARM            EQUALS   ENDOFJOB                              
064060,000190: 
064061,000191:                                                                                                  #  CALLING SEQUENCE FOR VARALARM
064062,000192:                                                                                                  #                CAF     (ALARM)
064063,000193:                                                                                                  #                TC      VARALARM

Page 1464

064065,000195: 
064066,000196:                                                                                                  #  VARALARM TURNS ON PROGRAM ALARM LIGHT BUT DOES NOT DISPLAY
064067,000197: 
064068,000198:    5651           00004        VARALARM           INHINT                                         
064069,000199: 
064070,000200:    5652           54001                           TS       L                                     #  SAVE USERS ALARM CODE
064071,000201: 
064072,000202:    5653           30002                           CA       Q                                     #  SAVE USERS Q
064073,000203:    5654           55363                           TS       ALMCADR                               
064074,000204: 
064075,000205:    5655           05545                           TC       PRIOENT                               
064076,000206:    5656           00014        OCT14              OCT      14                                    #  DONT MOVE
064077,000207: 
064078,000208:    5657           01363                           TC       ALMCADR                               #  RETURN TO USER
064079,000209: 
064080,000210:    5660     5604               ABORT              EQUALS   BAILOUT                               #  *** TEMPORARY UNTIL ABORT CALLS OUT

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