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.

063023,000002:                                                                                                  ## Copyright:    Public domain.
063024,000003:                                                                                                  ## Filename:     KEYRUPT_UPRUPT.agc
063025,000004:                                                                                                  ## Purpose:      Part of the source code for Comanche, build 055. It
063026,000005:                                                                                                  ##               is part of the source code for the Command Module's
063027,000006:                                                                                                  ##               (CM) Apollo Guidance Computer (AGC), Apollo 11.
063028,000007:                                                                                                  ## Assembler:    yaYUL
063029,000008:                                                                                                  ## Reference:    pp. 1449-1451
063030,000009:                                                                                                  ## Contact:      Ron Burkey <info@sandroid.org>
063031,000010:                                                                                                  ## Website:      http://www.ibiblio.org/apollo.
063032,000011:                                                                                                  ## Mod history:  2009-05-07 RSB Adapted from Colossus249 file of the same
063033,000012:                                                                                                  ##                              name, and page images. Corrected various 
063034,000013:                                                                                                  ##                              typos in the transcription of program 
063035,000014:                                                                                                  ##                              comments, and these should be back-ported  
063036,000015:                                                                                                  ##                              to Colossus249.
063037,000016:                                                                                                  ##              2016-12-22 RSB  Proofed comment text using octopus/ProoferComments
063038,000017:                                                                                                  ##                              and corrected the errors found.
063039,000018:                                                                                                  ##              2017-02-05 RSB  Back-ported comment corrections 
063040,000019:                                                                                                  ##                              identified while proofing Artemis 072.
063041,000020:                                                                                                  ##
063042,000021:                                                                                                  ## The contents of the "Comanche055" files, in general, are transcribed 
063043,000022:                                                                                                  ## from scanned documents. 
063044,000023:                                                                                                  ##
063045,000024:                                                                                                  ##       Assemble revision 055 of AGC program Comanche by NASA
063046,000025:                                                                                                  ##       2021113-051.  April 1, 1969.  
063047,000026:                                                                                                  ##
063048,000027:                                                                                                  ##       This AGC program shall also be referred to as Colossus 2A
063049,000028:                                                                                                  ##
063050,000029:                                                                                                  ##       Prepared by
063051,000030:                                                                                                  ##                       Massachusetts Institute of Technology
063052,000031:                                                                                                  ##                       75 Cambridge Parkway
063053,000032:                                                                                                  ##                       Cambridge, Massachusetts
063054,000033:                                                                                                  ##
063055,000034:                                                                                                  ##       under NASA contract NAS 9-4065.
063056,000035:                                                                                                  ##
063057,000036:                                                                                                  ## Refer directly to the online document mentioned above for further
063058,000037:                                                                                                  ## information.  Please report any errors to info@sandroid.org.
063059,000038: 

Page 1449

063061,000040: 14,3761                                           BANK     14                                    
063062,000041: 07,2000                                           SETLOC   KEYRUPT                               
063063,000042: 07,2000                                           BANK                                           
063064,000043: 07,3673                                           COUNT*   $$/KEYUP                              
063065,000044: 
063066,000045: 07,3673           54016        KEYRUPT1           TS       BANKRUPT                              
063067,000046: 07,3674           56002                           XCH      Q                                     
063068,000047: 07,3675           54012                           TS       QRUPT                                 
063069,000048: 07,3676           04414                           TC       LODSAMPT                              #  TIME IS SNATCHED IN RUPT FOR NOUN 65.
063070,000049: 07,3677           34362                           CAF      LOW5                                  
063071,000050: 07,3700           00006                           EXTEND                                         
063072,000051: 07,3701           02015                           RAND     MNKEYIN                               #  CHECK IF KEYS 5M-1M ON
063073,000052: 07,3702           54073        KEYCOM             TS       RUPTREG4                              
063074,000053: 07,3703           40101                           CS       FLAGWRD5                              
063075,000054: 07,3704           75001                           MASK     BIT15                                 
063076,000055: 07,3705           26101                           ADS      FLAGWRD5                              
063077,000056: 
063078,000057: 07,3706           34371        ACCEPTUP           CAF      CHRPRIO                               #  (NOTE: RUPTREG4 = KEYTEMP1)
063079,000058: 07,3707           05134                           TC       NOVAC                                 
063080,000059: 07,3710     0777                                  EBANK=   DSPCOUNT                              
063081,000060: 07,3710           02000 60101                     2CADR    CHARIN                                
063082,000061: 
063083,000062: 07,3712           30073                           CA       RUPTREG4                              
063084,000063: 07,3713           50064                           INDEX    LOCCTR                                
063085,000064: 07,3714           54154                           TS       MPAC                                  #  LEAVE 5 BIT KEY CDE IN MPAC FOR CHARIN
063086,000065: 07,3715           05333                           TC       RESUME                                
063087,000066: 

Page 1450

063089,000068:                                                                                                  #  UPRUPT PROGRAM
063090,000069: 
063091,000070: 07,3716           54016        UPRUPT             TS       BANKRUPT                              
063092,000071: 07,3717           56002                           XCH      Q                                     
063093,000072: 07,3720           54012                           TS       QRUPT                                 
063094,000073: 07,3721           04414                           TC       LODSAMPT                              #  TIME IS SNATCHED IN RUPT FOR NOUN 65.
063095,000074: 07,3722           35021                           CAF      ZERO                                  
063096,000075: 07,3723           56045                           XCH      INLINK                                
063097,000076: 07,3724           54073                           TS       KEYTEMP1                              
063098,000077: 07,3725           35015                           CAF      BIT3                                  #  TURN ON UPACT LIGHT
063099,000078: 07,3726           00006                           EXTEND                                         #  (BIT 3 OF CHANNEL 11)
063100,000079: 07,3727           05011                           WOR      DSALMOUT                              
063101,000080: 07,3730           34362        UPRPT1             CAF      LOW5                                  #  TEST FOR TRIPLE CHAR REDUNDANCY
063102,000081: 07,3731           70073                           MASK     KEYTEMP1                              #  LOW5 OF WORD
063103,000082: 07,3732           56073                           XCH      KEYTEMP1                              #  LOW5 INTO KEYTEMP1
063104,000083: 07,3733           00006                           EXTEND                                         
063105,000084: 07,3734           75006                           MP       BIT10                                 #  SHIFT RIGHT 5
063106,000085: 07,3735           54734                           TS       KEYTEMP2                              
063107,000086: 07,3736           74362                           MASK     LOW5                                  #  MID 5
063108,000087: 07,3737           63773                           AD       HI10                                  
063109,000088: 07,3740           03770                           TC       UPTEST                                
063110,000089: 07,3741           35006                           CAF      BIT10                                 
063111,000090: 07,3742           00006                           EXTEND                                         
063112,000091: 07,3743           70734                           MP       KEYTEMP2                              #  SHIFT RIGHT 5
063113,000092: 07,3744           74362                           MASK     LOW5                                  #  HIGH 5
063114,000093: 07,3745           40000                           COM                                            
063115,000094: 07,3746           03770                           TC       UPTEST                                
063116,000095: 
063117,000096: 07,3747           43776        UPOK               CS       ELRCODE                               #  CODE IS GOOD.  IF CODE = 'ERROR RESET',
063118,000097: 07,3750           60073                           AD       KEYTEMP1                              #  CLEAR UPLOCKFL (SET BIT4 OF FLAGWRD7 = 0)
063119,000098: 07,3751           00006                           EXTEND                                         #  IF CODE DOES NOT = 'ERROR RESET', ACCEPT
063120,000099: 07,3752           13760                           BZF      CLUPLOCK                              #  CODE ONLY IF UPLOCKFL IS CLEAR (=0).
063121,000100: 
063122,000101: 07,3753           35014                           CAF      BIT4                                  #  TEST UPLOCKFL FOR 0 OR 1.
063123,000102: 07,3754           70103                           MASK     FLAGWRD7                              
063124,000103: 07,3755           10000                           CCS      A                                     
063125,000104: 07,3756           05333                           TC       RESUME                                #  UPLOCKFL = 1
063126,000105: 07,3757           03706                           TC       ACCEPTUP                              #  UPLOCKFL = 0
063127,000106: 
063128,000107: 07,3760           45014        CLUPLOCK           CS       BIT4                                  #  CLEAR UPLOCKFL (I.E., SET BIT 4 OF
063129,000108: 07,3761           70103                           MASK     FLAGWRD7                              #  FLAGWRD7 = 0)
063130,000109: 07,3762           54103                           TS       FLAGWRD7                              
063131,000110: 07,3763           03706                           TC       ACCEPTUP                              
063132,000111: 
063133,000112:                                                                                                  #  CODE IS BAD
063134,000113: 07,3764           40103        TMFAIL2            CS       FLAGWRD7                              #  LOCK OUT FURTHER UPLINK ACTIVITY
063135,000114: 07,3765           75014                           MASK     BIT4                                  #  (BY SETTING UPLOCKFL = 1) UNTIL
063136,000115: 07,3766           26103                           ADS      FLAGWRD7                              #  'ERROR RESET' IS SENT VIA UPLINK.
063137,000116: 07,3767           05333                           TC       RESUME                                
063138,000117: 07,3770           60073        UPTEST             AD       KEYTEMP1                              

Page 1451

063140,000119: 07,3771           10000                           CCS      A                                     
063141,000120: 07,3772           03764                           TC       TMFAIL2                               
063142,000121: 07,3773           77740        HI10               OCT      77740                                 
063143,000122: 07,3774           03764                           TC       TMFAIL2                               
063144,000123: 07,3775           00002                           TC       Q                                     
063145,000124: 
063146,000125: 07,3776           00022        ELRCODE            OCT      22                                    
063147,000126: 
063148,000127:                                                                                                  #  'UPLINK ACTIVITY LIGHT' IS TURNED OFF BY .....
063149,000128:                                                                                                  #        1.      VBRELDSP
063150,000129:                                                                                                  #        2.      ERROR RESET
063151,000130:                                                                                                  #        3.      UPDATE PROGRAM (P27) ENTERED BY V70,V71,V72, AND V73.
063152,000131: 
063153,000132:                                                                                                  #                                     -
063154,000133:                                                                                                  #  THE RECEPTION OF A BAD CODE (I.E  CCC FAILURE) LOCKS OUT FURTHER UPLINK ACTIVITY BY SETTING BIT4 OF FLAGWRD7 = 1.
063155,000134:                                                                                                  #  THIS INDICATION WILL BE TRANSFERRED TO THE GROUND BY THE DOWNLINK WHICH DOWNLINKS ALL FLAGWORDS.
063156,000135:                                                                                                  #  WHEN UPLINK ACTIVITY IS LOCKED OUT, IT CAN BE ALLOWED WHEN THE GROUND UPLINKS AND 'ERROR RESET' CODE.
063157,000136:                                                                                                  #  (IT IS RECOMMENDED THAT THE 'ERROR LIGHT RESET' CODE IS PRECEEDED BY 16 BITS THE FIRST OF WHICH IS 1 FOLLOWED
063158,000137:                                                                                                  #  BY 15 ZEROES.  THIS WILL ELIMINATE EXTRANEOUS BITS FROM INLINK WHICH MAY HAVE BEEN LEFT OVER FROM THE ORIGINAL
063159,000138:                                                                                                  #  FAILURE)
063160,000139: 
063161,000140:                                                                                                  #  UPLINK ACTIVITY IS ALSO ALLOWED (UNLOCKED) DURING FRESH START WHEN FRESH START SETS BIT4 OF FLAGWRD7 = 0.
063162,000141: 
063163,000142: 

End of include-file KEYRUPT,_UPRUPT.agc.  Parent file is MAIN.agc