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.

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

Page 1449

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

Page 1450

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

Page 1451

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

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