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.

049012,000002:                                                                                                  ## Copyright:   Public domain.
049013,000003:                                                                                                  ## Filename:    INTER-BANK_COMMUNICATION.agc
049014,000004:                                                                                                  ## Purpose:     Part of the source code for Comanche, build 055. It
049015,000005:                                                                                                  ##              is part of the source code for the Command Module's
049016,000006:                                                                                                  ##              (CM) Apollo Guidance Computer (AGC), Apollo 11.
049017,000007:                                                                                                  ## Assembler:   yaYUL
049018,000008:                                                                                                  ## Reference:   pp. 1103-1106
049019,000009:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>
049020,000010:                                                                                                  ## Website:     http://www.ibiblio.org/apollo.
049021,000011:                                                                                                  ## Mod history: 2009-05-08 RSB  Adapted from Colossus249/ file of same name
049022,000012:                                                                                                  ##                              and page images. Corrected various typos
049023,000013:                                                                                                  ##                              in the transcription of program comments,
049024,000014:                                                                                                  ##                              and these should be back-ported to 
049025,000015:                                                                                                  ##                              Colossus249.
049026,000016:                                                                                                  ##              2011-05-08 JL   Removed workaround.
049027,000017:                                                                                                  ##              2016-12-21 RSB  Proofed comment text using octopus/ProoferComments
049028,000018:                                                                                                  ##                              and corrected the errors found.
049029,000019:                                                                                                  ##              2017-01-14 RSB  Corrected comment-text errors located while diff'ing
049030,000020:                                                                                                  ##                              against Colossus 249.
049031,000021: 
049032,000022:                                                                                                  ## The contents of the "Comanche055" files, in general, are transcribed 
049033,000023:                                                                                                  ## from scanned documents. 
049034,000024:                                                                                                  ##
049035,000025:                                                                                                  ##       Assemble revision 055 of AGC program Comanche by NASA
049036,000026:                                                                                                  ##       2021113-051.  April 1, 1969.  
049037,000027:                                                                                                  ##
049038,000028:                                                                                                  ##       This AGC program shall also be referred to as Colossus 2A
049039,000029:                                                                                                  ##
049040,000030:                                                                                                  ##       Prepared by
049041,000031:                                                                                                  ##                       Massachusetts Institute of Technology
049042,000032:                                                                                                  ##                       75 Cambridge Parkway
049043,000033:                                                                                                  ##                       Cambridge, Massachusetts
049044,000034:                                                                                                  ##
049045,000035:                                                                                                  ##       under NASA contract NAS 9-4065.
049046,000036:                                                                                                  ##
049047,000037:                                                                                                  ## Refer directly to the online document mentioned above for further
049048,000038:                                                                                                  ## information.  Please report any errors to info@sandroid.org.
049049,000039: 

Page 1103

049051,000041:                                                                                                  #  THE FOLLOWING ROUTINE CAN BE USED TO CALL A SUBROUTINE IN ANOTHER BANK. IN THE BANKCALL VERSION, THE
049052,000042:                                                                                                  #  CADR OF THE SUBROUTINE IMMEDIATELY FOLLOWS THE TC BANKCALL INSTRUCTION, WITH C(A) AND C(L) PRESERVED.
049053,000043: 
049054,000044:    4662                                           BLOCK    02                                    
049055,000045:    4662                                           COUNT    02/BANK                               
049056,000046: 
049057,000047:    4662           52134        BANKCALL           DXCH     BUF2                                  #  SAVE INCOMING A,L.
049058,000048:    4663           50002                           INDEX    Q                                     #  PICK UP CADR.
049059,000049:    4664           30000                           CA       0                                     
049060,000050:    4665           24002                           INCR     Q                                     #  SO WE RETURN TO THE LOC. AFTER THE CADR.
049061,000051: 
049062,000052:                                                                                                  #  SWCALL IS  IDENTICAL TO BANKCALL, EXCEPT THAT THE CADR ARRIVES IN A.
049063,000053: 
049064,000054:    4666           54001        SWCALL             TS       L                                     
049065,000055:    4667           22004                           LXCH     FBANK                                 #  SWITCH BANKS, SAVING RETURN.
049066,000056:    4670           75054                           MASK     LOW10                                 #  GET SUB-ADDRESS OF CADR.
049067,000057:    4671           56002                           XCH      Q                                     #  A,L NOW CONTAINS DP RETURN.
049068,000058:    4672           52134                           DXCH     BUF2                                  #  RESTORING INPUTS IF THIS IS A BANKCALL.
049069,000059:    4673           50002                           INDEX    Q                                     
049070,000060:    4674           02000                           TC       10000                                 #  SETTING Q TO SWRETURN.
049071,000061: 
049072,000062:    4675           56134        SWRETURN           XCH      BUF2       +1                         #  COMES HERE TO RETURN TO CALLER. C(A,L)
049073,000063:    4676           56004                           XCH      FBANK                                 #  ARE PRESERVED FOR RETURN.
049074,000064:    4677           56134                           XCH      BUF2       +1                         
049075,000065:    4700           00133                           TC       BUF2                                  
049076,000066: 
049077,000067:                                                                                                  #  THE FOLLOWING ROUTINE CAN BE USED AS A UNILATERAL JUMP WITH C(A,L) PRESERVED AND THE CADR IMMEDIATELY
049078,000068:                                                                                                  #  FOLLOWING THE TC POSTJUMP INSTRUCTION.
049079,000069: 
049080,000070:    4701           56002        POSTJUMP           XCH      Q                                     #  SAVE INCOMING C(A).
049081,000071:    4702           50000                           INDEX    A                                     #  GET CADR.
049082,000072:    4703           30000                           CA       0                                     
049083,000073: 
049084,000074:                                                                                                  #  BANKJUMP IS THE SAME AS POSTJUMP, EXCEPT THAT THE CADR ARRIVES IN A.
049085,000075: 
049086,000076:    4704           54004        BANKJUMP           TS       FBANK                                 
049087,000077:    4705           75054                           MASK     LOW10                                 
049088,000078:    4706           56002                           XCH      Q                                     #  RESTORING INPUT C(A) IF THIS WAS A
049089,000079:    4707           50002        Q+10000            INDEX    Q                                     #  POSTJUMP.
049090,000080:    4710           12000        PRIO12             TCF      10000                                 #  PRIO12 = TCF  10000 = 12000
049091,000081: 

Page 1104

049093,000083:                                                                                                  #  THE FOLLOWING ROUTINE GETS THE RETURN CADR SAVED BY SWCALL OR BANKCALL AND LEAVES IT IN A.
049094,000084: 
049095,000085:    4711           35054        MAKECADR           CAF      LOW10                                 
049096,000086:    4712           70133                           MASK     BUF2                                  
049097,000087:    4713           60134                           AD       BUF2       +1                         
049098,000088:    4714           00002                           TC       Q                                     
049099,000089: 
049100,000090:    4715           54135        SUPDACAL           TS       MPTEMP                                
049101,000091:    4716           56004                           XCH      FBANK                                 #  SET FBANK FOR DATA.
049102,000092:    4717           00006                           EXTEND                                         
049103,000093:    4720           04007                           ROR      SUPERBNK                              #  SAVE FBANK IN BITS 15-11, AND
049104,000094:    4721           56135                           XCH      MPTEMP                                #  SUPERBANK IN BITS 7-5.
049105,000095:    4722           75054                           MASK     LOW10                                 
049106,000096:    4723           56001                           XCH      L                                     #  SAVE REL. ADR. IN BANK, FETCH SUPERBITS.
049107,000097:    4724           00004                           INHINT                                         #  BECAUSE RUPT DOES NOT SAVE SUPERBANK.
049108,000098:    4725           00006                           EXTEND                                         
049109,000099:    4726           01007                           WRITE    SUPERBNK                              #  SET SUPERBANK FOR DATA.
049110,000100:    4727           50001                           INDEX    L                                     
049111,000101:    4730           32000                           CA       10000                                 #  PINBALL (FIX MEM DISP) PREVENTS DCA HERE
049112,000102:    4731           56135                           XCH      MPTEMP                                #  SAVE 1ST WD, FETCH OLD FBANK AND SBANK.
049113,000103:    4732           00006                           EXTEND                                         
049114,000104:    4733           01007                           WRITE    SUPERBNK                              #  RESTORE SUPERBANK.
049115,000105:    4734           00003                           RELINT                                         
049116,000106:    4735           54004                           TS       FBANK                                 #  RESTORE FBANK.
049117,000107:    4736           30135                           CA       MPTEMP                                #  RECOVER FIRST WORD OF DATA.
049118,000108:    4737           00002                           RETURN                                         #  24 WDS. DATACALL 516 MU, SUPDACAL 432 MU
049119,000109: 

Page 1105

049121,000111:                                                                                                  #  THE FOLLOWING ROUTINES ARE IDENTICAL TO BANKCALL AND SWCALL EXCEPT THAT THEY ARE USED IN INTERRUPT.
049122,000112: 
049123,000113:    4740           52073        IBNKCALL           DXCH     RUPTREG3                              #  USES RUPTREG3,4 FOR DP RETURN ADDRESS.
049124,000114:    4741           50002                           INDEX    Q                                     
049125,000115:    4742           30000                           CAF      0                                     
049126,000116:    4743           24002                           INCR     Q                                     
049127,000117: 
049128,000118:    4744           54001        ISWCALL            TS       L                                     
049129,000119:    4745           22004                           LXCH     FBANK                                 
049130,000120:    4746           75054                           MASK     LOW10                                 
049131,000121:    4747           56002                           XCH      Q                                     
049132,000122:    4750           52073                           DXCH     RUPTREG3                              
049133,000123:    4751           50002                           INDEX    Q                                     
049134,000124:    4752           02000                           TC       10000                                 
049135,000125: 
049136,000126:    4753           56073        ISWRETRN           XCH      RUPTREG4                              
049137,000127:    4754           56004                           XCH      FBANK                                 
049138,000128:    4755           56073                           XCH      RUPTREG4                              
049139,000129:    4756           00072                           TC       RUPTREG3                              
049140,000130: 
049141,000131:                                                                                                  #  2. USPRCADR ACCESSES INTERPRETIVE CODING IN OTHER THAN THE USER'S FBANK.  THE CALLING SEQUENCE IS AS FOLLOWS:
049142,000132:                                                                                                  #        L       TC      USPRCADR
049143,000133:                                                                                                  #        L+1     CADR    INTPRETX        INTPRETX IS THE INTERPRETIVE CODING
049144,000134:                                                                                                  #                                        RETURN IS TO L+2
049145,000135: 
049146,000136:    4757           54164        USPRCADR           TS       LOC                                   #  SAVE A
049147,000137:    4760           35010                           CA       BIT8                                  
049148,000138:    4761           54023                           TS       EDOP                                  #  EXIT INSTRUCTION TO EDOP
049149,000139:    4762           30006                           CA       BBANK                                 
049150,000140:    4763           54165                           TS       BANKSET                               #  USER'S BBANK TO BANKSET
049151,000141:    4764           50002                           INDEX    Q                                     
049152,000142:    4765           30000                           CA       0                                     
049153,000143:    4766           54004                           TS       FBANK                                 #  INTERPRETIVE BANK TO FBANK
049154,000144:    4767           75054                           MASK     LOW10                                 #  YIELDS INTERPRETIVE RELATIVE ADDRESS
049155,000145:    4770           56002                           XCH      Q                                     #  INTERPRETIVE ADDRESS TO Q, FETCHING L+1
049156,000146:    4771           56164                           XCH      LOC                                   #  L+1 TO LOC, RETRIEVING ORIGINAL A
049157,000147:    4772           14707                           TCF      Q+10000                               
049158,000148: 

Page 1106

049160,000150:                                                                                                  #  THERE ARE FOUR POSSIBLE SETTINGS FOR CHANNEL 07.  (CHANNEL 07 CONTAINS THE SUPERBANK SETTING.)
049161,000151: 
049162,000152:                                                                                                  #                                        PSEUDO-FIXED     OCTAL PSEUDO
049163,000153:                                                                                                  #  SUPERBANK     SETTING S-REG. VALUE    BANK NUMBERS     ADDRESSES
049164,000154:                                                                                                  #  ----------    ------- ------------     ------------     ------------
049165,000155:                                                                                                  #  SUPERBANK 3     0XX    2000 - 3777       30 - 37       70000 - 107777         (WHERE XX CAN BE ANYTHING AND
049166,000156:                                                                                                  #                                                                                WILL USUALLY BE SEEN AS 11)
049167,000157:                                                                                                  #  SUPERBANK 4     100    2000 - 3777       40 - 47      110000 - 127777         (AS FAR AS IT CAN BE SEEN,
049168,000158:                                                                                                  #                                                                                ONLY BANKS 40-43 WILL EVER BE
049169,000159:                                                                                                  #                                                                                AND ARE PRESENTLY AVAILABLE)
049170,000160:                                                                                                  #  SUPERBANK 5     101    2000 - 3777       50 - 57      130000 - 147777         (PRESENTLY NOT AVAILABLE TO
049171,000161:                                                                                                  #                                                                                THE USER)
049172,000162:                                                                                                  #  SUPERBANK 6     110    2000 - 3777       60 - 67      150000 - 167777         (PRESENTLY NOT AVAILABLE TO
049173,000163:                                                                                                  #                                                                                THE USER)
049174,000164:                                                                                                  #  *** THIS ROUTINE MAY BE CALLED BY ANY PROGRAM LOCATED IN BANKS 00 - 27.  I.E., NO PROGRAM LIVING IN ANY
049175,000165:                                                                                                  #  SUPERBANK SHOULD USE SUPERSW. ***
049176,000166: 
049177,000167:                                                                                                  #  SUPERSW MAY BE CALLED IN THIS FASHION:
049178,000168:                                                                                                  #        CAF     ABBCON          WHERE -- ABBCON  BBCON  SOMETHIN --
049179,000169:                                                                                                  #        TCR     SUPERSW         (THE SUPERBNK BITS ARE IN THE BBCON)
049180,000170:                                                                                                  #        ...       ...
049181,000171:                                                                                                  #         .         .
049182,000172:                                                                                                  #         .         .
049183,000173:                                                                                                  #  OR IN THIS FASHION:
049184,000174:                                                                                                  #        CAF     SUPERSET        WHERE SUPERSET IS ONE OF THE FOUR AVAILABLE
049185,000175:                                                                                                  #        TCR     SUPERSW         SUPERBANK BIT CONSTANTS:
049186,000176:                                                                                                  #        ...       ...                   SUPER011 OCTAL  60
049187,000177:                                                                                                  #         .         .                    SUPER100 OCTAL 100
049188,000178:                                                                                                  #         .         .                    SUPER101 OCTAL 120
049189,000179:                                                                                                  #                                        SUPER110 OCTAL 140
049190,000180: 
049191,000181:    4773           00006        SUPERSW            EXTEND                                         
049192,000182:    4774           01007                           WRITE    SUPERBNK                              #  WRITE BITS 7-6-5 OF THE ACCUMULATOR INTO
049193,000183:                                                                                                  #  CHANNEL 07
049194,000184:    4775           00002                           TC       Q                                     #  TC TO INSTRUCTION FOLLOWING
049195,000185:                                                                                                  #        TC SUPERSW
049196,000186: 
049197,000187: 
049198,000188: 

End of include-file INTER-BANK_COMMUNICATION.agc.  Parent file is MAIN.agc