Source Code

These source-code files were derived from scans of the Colossus 237 (Apollo 8 Command Module) program listing from the private collection of original AGC developer Fred Martin. Scanning was by Ron Burkey. Pre-existing Colossus 249 (Apollo 9 CM) source files were used as a template, and changes between Colossus 249 and Colossus 237 were manually transcribed by a team of volunteers. Note that the page images presented online are of reduced quality, and that additional 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 237 OF AGC PROGRAM COLOSSUS 
	BY NASA 2021111-031  1:17 AUG. 24, 1968
Note that the date is the date of the printout, not the date of the program revision.

046375,000002:                                                                                                  ## Copyright:   Public domain.
046376,000003:                                                                                                  ## Filename:    INTER-BANK_COMMUNICATION.agc
046377,000004:                                                                                                  ## Purpose:     Part of the source code for Colossus build 237.  
046378,000005:                                                                                                  ##              This is for the Command Module's (CM) Apollo Guidance
046379,000006:                                                                                                  ##              Computer (AGC), for Apollo 8.
046380,000007:                                                                                                  ## Assembler:   yaYUL
046381,000008:                                                                                                  ## Contact:     Onno Hommes <ohommes@alumni.cmu.edu>
046382,000009:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
046383,000010:                                                                                                  ## Page Scans:  www.ibiblio.org/apollo/ScansForConversion/Colossus237/
046384,000011:                                                                                                  ## Mod history: 2010-05-22 OH   Adapted from corresponding Colossus 249 file.
046385,000012:                                                                                                  ##              2010-12-04 JL   Remove Colossus 249 header comments. Change to double-has page numbers.
046386,000013:                                                                                                  ##              2011-02-07 JL   Minor fixes.
046387,000014:                                                                                                  ##              2017-01-01 RSB  Proofed comment text using octopus/ProoferComments,
046388,000015:                                                                                                  ##                              but no found.
046389,000016: 

Page 1070

046391,000018:                                                                                                  #           THE FOLLOWING ROUTINE CAN BE USED TO CALL A SUBROUTINE IN ANOTHER BANK. IN THE BANKCALL VERSION, THE
046392,000019:                                                                                                  #  CADR OF THE SUBROUTINE IMMEDIATELY FOLLOWS THE  TC BANKCALL  INSTRUCTION, WITH C(A) AND C(L) PRESERVED.
046393,000020: 
046394,000021:    4555                                           BLOCK    02                                    
046395,000022:    4555                                           COUNT    02/BANK                               
046396,000023: 
046397,000024:    4555           52134        BANKCALL           DXCH     BUF2                                  #  SAVE INCOMING A,L.
046398,000025:    4556           50002                           INDEX    Q                                     #  PICK UP CADR.
046399,000026:    4557           30000                           CA       0                                     
046400,000027:    4560           24002                           INCR     Q                                     #  SO WE RETURN TO THE LOC. AFTER THE CADR.
046401,000028: 
046402,000029:                                                                                                  #           SWCALL IS IDENTICAL TO BANKCALL, EXCEPT THAT THE CADR ARRIVES IN A.
046403,000030: 
046404,000031:    4561           54001        SWCALL             TS       L                                     
046405,000032:    4562           22004                           LXCH     FBANK                                 #  SWITCH BANKS, SAVING RETURN.
046406,000033:    4563           74747                           MASK     LOW10                                 #  GET SUB-ADDRESS OF CADR.
046407,000034:    4564           56002                           XCH      Q                                     #  A,L NOW CONTAINS DP RETURN.
046408,000035:    4565           52134                           DXCH     BUF2                                  #  RESTORING INPUTS IF THIS IS A BANKCALL.
046409,000036:    4566           50002                           INDEX    Q                                     
046410,000037:    4567           02000                           TC       10000                                 #  SETTING Q TO SWRETURN.
046411,000038: 
046412,000039:    4570           56134        SWRETURN           XCH      BUF2       +1                         #  COMES HERE TO RETURN TO CALLER. C(A,L)
046413,000040:    4571           56004                           XCH      FBANK                                 #  ARE PRESERVED FOR RETURN.
046414,000041:    4572           56134                           XCH      BUF2       +1                         
046415,000042:    4573           00133                           TC       BUF2                                  
046416,000043: 
046417,000044: 
046418,000045:                                                                                                  #           THE FOLLOWING ROUTINE CAN BE USED AS A UNILATERAL JUMP WITH C(A,L) PRESERVED AND THE CADR IMMEDIATELY
046419,000046:                                                                                                  #  FOLLOWING THE TC POSTJUMP INSTRUCTION.
046420,000047: 
046421,000048:    4574           56002        POSTJUMP           XCH      Q                                     #  SAVE INCOMING C(A).
046422,000049:    4575           50000                           INDEX    A                                     #  GET CADR.
046423,000050:    4576           30000                           CA       0                                     
046424,000051: 
046425,000052:                                                                                                  #           BANKJUMP IS THE SAME AS POSTJUMP, EXCEPT THAT THE CADR ARRIVES IN A.
046426,000053: 
046427,000054:    4577           54004        BANKJUMP           TS       FBANK                                 
046428,000055:    4600           74747                           MASK     LOW10                                 
046429,000056:    4601           56002                           XCH      Q                                     #  RESTORING INPUT C(A) IF THIS WAS A
046430,000057:    4602           50002        Q+10000            INDEX    Q                                     #  POSTJUMP.
046431,000058:    4603           12000        PRIO12             TCF      10000                                 #  PRIO12 = TCF   10000 = 12000
046432,000059: 

Page 1071

046434,000061:                                                                                                  #           THE FOLLOWING ROUTINE GETS THE RETURN CADR SAVED BY SWCALL OR BANKCALL AND LEAVES IT IN A.
046435,000062: 
046436,000063:    4604           34747        MAKECADR           CAF      LOW10                                 
046437,000064:    4605           70133                           MASK     BUF2                                  
046438,000065:    4606           60134                           AD       BUF2       +1                         
046439,000066:    4607           00002                           TC       Q                                     
046440,000067: 
046441,000068: 
046442,000069:    4610           54135        SUPDACAL           TS       MPTEMP                                
046443,000070:    4611           56004                           XCH      FBANK                                 #  SET FBANK FOR DATA.
046444,000071:    4612           00006                           EXTEND                                         
046445,000072:    4613           04007                           ROR      SUPERBNK                              #  SAVE FBANK IN BITS 15-11, AND
046446,000073:    4614           56135                           XCH      MPTEMP                                #   SUPERBANK IN BITS 7-5.
046447,000074:    4615           74747                           MASK     LOW10                                 
046448,000075:    4616           56001                           XCH      L                                     #  SAVE REL. ADR. IN BANK, FETCH SUPERBITS.
046449,000076:    4617           00004                           INHINT                                         #  BECAUSE RUPT DOES NOT SAVE SUPERBANK.
046450,000077:    4620           00006                           EXTEND                                         
046451,000078:    4621           01007                           WRITE    SUPERBNK                              #  SET SUPERBANK FOR DATA.
046452,000079:    4622           50001                           INDEX    L                                     
046453,000080:    4623           32000                           CA       10000                                 #  PINBALL (FIX MEM DISP) PREVENTS DCA HERE
046454,000081:    4624           56135                           XCH      MPTEMP                                #  SAVE 1ST WD, FETCH OLD FBANK AND SBANK.
046455,000082:    4625           00006                           EXTEND                                         
046456,000083:    4626           01007                           WRITE    SUPERBNK                              #  RESTORE SUPERBANK.
046457,000084:    4627           00003                           RELINT                                         
046458,000085:    4630           54004                           TS       FBANK                                 #  RESTORE FBANK.
046459,000086:    4631           30135                           CA       MPTEMP                                #  RECOVER FIRST WORD OF DATA.
046460,000087:    4632           00002                           RETURN                                         #  24 WDS. DATACALL 516 MU, SUPDACAL 432 MU
046461,000088: 

Page 1072

046463,000090:                                                                                                  #           THE FOLLOWING ROUTINES ARE IDENTICAL TO BANKCALL AND SWCALL EXCEPT THAT THEY ARE USED IN INTERRUPT.
046464,000091: 
046465,000092:    4633           52073        IBNKCALL           DXCH     RUPTREG3                              #  USES RUPTREG3,4 FOR DP RETURN ADDRESS.
046466,000093:    4634           50002                           INDEX    Q                                     
046467,000094:    4635           30000                           CAF      0                                     
046468,000095:    4636           24002                           INCR     Q                                     
046469,000096: 
046470,000097:    4637           54001        ISWCALL            TS       L                                     
046471,000098:    4640           22004                           LXCH     FBANK                                 
046472,000099:    4641           74747                           MASK     LOW10                                 
046473,000100:    4642           56002                           XCH      Q                                     
046474,000101:    4643           52073                           DXCH     RUPTREG3                              
046475,000102:    4644           50002                           INDEX    Q                                     
046476,000103:    4645           02000                           TC       10000                                 
046477,000104: 
046478,000105:    4646           56073        ISWRETRN           XCH      RUPTREG4                              
046479,000106:    4647           56004                           XCH      FBANK                                 
046480,000107:    4650           56073                           XCH      RUPTREG4                              
046481,000108:    4651           00072                           TC       RUPTREG3                              
046482,000109: 
046483,000110:                                                                                                  #  2. USPRCADR ACCESSES INTERPRETIVE CODING IN OTHER THAN THE USER'S FBANK. THE CALLING SEQUENCE IS AS FOLLOWS:
046484,000111: 
046485,000112:                                                                                                  #                                          L        TC     USPRCADR
046486,000113:                                                                                                  #                                          L+1      CADR   INTPRETX        INTPRETX IS THE INTERPRETIVE CODING
046487,000114:                                                                                                  #                                                                          RETURN IS TO L+2
046488,000115: 
046489,000116:    4652           54164        USPRCADR           TS       LOC                                   #  SAVE A
046490,000117:    4653           34703                           CA       BIT8                                  
046491,000118:    4654           54023                           TS       EDOP                                  #  EXIT INSTRUCTION TO EDOP
046492,000119:    4655           30006                           CA       BBANK                                 
046493,000120:    4656           54165                           TS       BANKSET                               #  USER'S BBANK TO BANKSET
046494,000121:    4657           50002                           INDEX    Q                                     
046495,000122:    4660           30000                           CA       0                                     
046496,000123:    4661           54004                           TS       FBANK                                 #  INTERPRETIVE BANK TO FBANK
046497,000124:    4662           74747                           MASK     LOW10                                 #  YIELDS INTERPRETIVE RELATIVE ADDRESS
046498,000125:    4663           56002                           XCH      Q                                     #  INTERPRETIVE ADDRESS TO Q, FETCHING L+1
046499,000126:    4664           56164                           XCH      LOC                                   #  L+1 TO LOC, RETRIEVING ORIGINAL A
046500,000127:    4665           14602                           TCF      Q+10000                               
046501,000128: 

Page 1073

046503,000130:                                                                                                  #  THERE ARE FOUR POSSIBLE SETTINGS FOR CHANNEL 07. (CHANNEL 07 CONTAINS THE SUPERBANK SETTING.)
046504,000131:                                                                                                  #                                            PSEUDO-FIXED     OCTAL PSEUDO
046505,000132:                                                                                                  #  SUPERBANK     SETTING     S-REG. VALUE    BANK NUMBERS     ADDRESSES
046506,000133:                                                                                                  #  ----------    -------     ------------     ------------     ------------
046507,000134: 
046508,000135:                                                                                                  #  SUPERBANK 3     0XX       2000 - 3777        30 - 37       70000 - 107777   (WHERE XX CAN BE ANYTHING AND
046509,000136:                                                                                                  #                                                                              WILL USUALLY BE SEEN AS 11)
046510,000137:                                                                                                  #  SUPERBANK 4     100       2000 - 3777        40 - 47       110000 - 127777  (AS FAR AS IT CAN BE SEEN,
046511,000138:                                                                                                  #                                                                              ONLY BANKS 40-43 WILL EVER BE
046512,000139:                                                                                                  #                                                                              AND ARE PRESENTLY AVAILABLE)
046513,000140:                                                                                                  #  SUPERBANK 5     101       2000 - 3777        50 - 57       130000 - 147777  (PRESENTLY NOT AVAILABLE TO
046514,000141:                                                                                                  #                                                                              THE USER)
046515,000142:                                                                                                  #  SUPERBANK 6     110       2000 - 3777        60 - 67       150000 - 167777  (PRESENTLY NOT AVAILABLE TO
046516,000143:                                                                                                  #                                                                              THE USER)
046517,000144:                                                                                                  #  ***  THIS ROUTINE MAYBE CALLED BY ANY PROGRAM LOCATED IN BANKS 00 - 27.  I.E., NO PROGRAM LIVING IN ANY
046518,000145:                                                                                                  #  SUPERBANK SHOULD USE SUPERSW.  ***
046519,000146: 
046520,000147:                                                                                                  #  SUPERSW MAYBE CALLED IN THIS FASHION:
046521,000148: 
046522,000149:                                                                                                  #           CAF    ABBCON          WHERE  --  ABBCON   BBCON  SOMETHIN --
046523,000150:                                                                                                  #           TCR    SUPERSW         (THE SUPERBNK BITS ARE IN THE BBCON)
046524,000151:                                                                                                  #           ...      ...
046525,000152:                                                                                                  #            .        .
046526,000153:                                                                                                  #            .        .
046527,000154: 
046528,000155:                                                                                                  #  OR IN THIS FASHION :
046529,000156: 
046530,000157:                                                                                                  #           CAF    SUPERSET        WHERE SUPERSET IS ONE OF THE FOUR AVAILABLE
046531,000158:                                                                                                  #           TCR    SUPERSW         SUPERBANK BIT CONSTANTS:
046532,000159:                                                                                                  #           ...      ...                                   SUPER011 OCTAL  60
046533,000160:                                                                                                  #            .        .                                    SUPER100 OCTAL 100
046534,000161:                                                                                                  #            .        .                                    SUPER101 OCTAL 120
046535,000162:                                                                                                  #                                                          SUPER110 OCTAL 140
046536,000163: 
046537,000164:    4666           00006        SUPERSW            EXTEND                                         
046538,000165:    4667           01007                           WRITE    SUPERBNK                              #  WRITE BITS 7-6-5 OF THE ACCUMULATOR INTO
046539,000166:                                                                                                  #  CHANNEL 07
046540,000167:    4670           00002                           TC       Q                                     #  TC TO INSTRUCTION FOLLOWING
046541,000168:                                                                                                  #    TC  SUPERSW

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