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, 1968Note that the date is the date of the printout, not the date of the program revision. |
046383,000002: ## Copyright: Public domain.
046384,000003: ## Filename: INTER-BANK_COMMUNICATION.agc
046385,000004: ## Purpose: Part of the source code for Colossus build 237.
046386,000005: ## This is for the Command Module's (CM) Apollo Guidance
046387,000006: ## Computer (AGC), for Apollo 8.
046388,000007: ## Assembler: yaYUL
046389,000008: ## Contact: Onno Hommes <ohommes@alumni.cmu.edu>
046390,000009: ## Website: www.ibiblio.org/apollo/index.html
046391,000010: ## Page Scans: www.ibiblio.org/apollo/ScansForConversion/Colossus237/
046392,000011: ## Mod history: 2010-05-22 OH Adapted from corresponding Colossus 249 file.
046393,000012: ## 2010-12-04 JL Remove Colossus 249 header comments. Change to double-has page numbers.
046394,000013: ## 2011-02-07 JL Minor fixes.
046395,000014: ## 2017-01-01 RSB Proofed comment text using octopus/ProoferComments,
046396,000015: ## but no found.
046397,000016:
Page 1070 |
046399,000018: # THE FOLLOWING ROUTINE CAN BE USED TO CALL A SUBROUTINE IN ANOTHER BANK. IN THE BANKCALL VERSION, THE
046400,000019: # CADR OF THE SUBROUTINE IMMEDIATELY FOLLOWS THE TC BANKCALL INSTRUCTION, WITH C(A) AND C(L) PRESERVED.
046401,000020:
046402,000021: 4555 BLOCK 02
046403,000022: 4555 COUNT 02/BANK
046404,000023:
046405,000024: 4555 52134 BANKCALL DXCH BUF2 # SAVE INCOMING A,L.
046406,000025: 4556 50002 INDEX Q # PICK UP CADR.
046407,000026: 4557 30000 CA 0
046408,000027: 4560 24002 INCR Q # SO WE RETURN TO THE LOC. AFTER THE CADR.
046409,000028:
046410,000029: # SWCALL IS IDENTICAL TO BANKCALL, EXCEPT THAT THE CADR ARRIVES IN A.
046411,000030:
046412,000031: 4561 54001 SWCALL TS L
046413,000032: 4562 22004 LXCH FBANK # SWITCH BANKS, SAVING RETURN.
046414,000033: 4563 74747 MASK LOW10 # GET SUB-ADDRESS OF CADR.
046415,000034: 4564 56002 XCH Q # A,L NOW CONTAINS DP RETURN.
046416,000035: 4565 52134 DXCH BUF2 # RESTORING INPUTS IF THIS IS A BANKCALL.
046417,000036: 4566 50002 INDEX Q
046418,000037: 4567 02000 TC 10000 # SETTING Q TO SWRETURN.
046419,000038:
046420,000039: 4570 56134 SWRETURN XCH BUF2 +1 # COMES HERE TO RETURN TO CALLER. C(A,L)
046421,000040: 4571 56004 XCH FBANK # ARE PRESERVED FOR RETURN.
046422,000041: 4572 56134 XCH BUF2 +1
046423,000042: 4573 00133 TC BUF2
046424,000043:
046425,000044:
046426,000045: # THE FOLLOWING ROUTINE CAN BE USED AS A UNILATERAL JUMP WITH C(A,L) PRESERVED AND THE CADR IMMEDIATELY
046427,000046: # FOLLOWING THE TC POSTJUMP INSTRUCTION.
046428,000047:
046429,000048: 4574 56002 POSTJUMP XCH Q # SAVE INCOMING C(A).
046430,000049: 4575 50000 INDEX A # GET CADR.
046431,000050: 4576 30000 CA 0
046432,000051:
046433,000052: # BANKJUMP IS THE SAME AS POSTJUMP, EXCEPT THAT THE CADR ARRIVES IN A.
046434,000053:
046435,000054: 4577 54004 BANKJUMP TS FBANK
046436,000055: 4600 74747 MASK LOW10
046437,000056: 4601 56002 XCH Q # RESTORING INPUT C(A) IF THIS WAS A
046438,000057: 4602 50002 Q+10000 INDEX Q # POSTJUMP.
046439,000058: 4603 12000 PRIO12 TCF 10000 # PRIO12 = TCF 10000 = 12000
046440,000059:
Page 1071 |
046442,000061: # THE FOLLOWING ROUTINE GETS THE RETURN CADR SAVED BY SWCALL OR BANKCALL AND LEAVES IT IN A.
046443,000062:
046444,000063: 4604 34747 MAKECADR CAF LOW10
046445,000064: 4605 70133 MASK BUF2
046446,000065: 4606 60134 AD BUF2 +1
046447,000066: 4607 00002 TC Q
046448,000067:
046449,000068:
046450,000069: 4610 54135 SUPDACAL TS MPTEMP
046451,000070: 4611 56004 XCH FBANK # SET FBANK FOR DATA.
046452,000071: 4612 00006 EXTEND
046453,000072: 4613 04007 ROR SUPERBNK # SAVE FBANK IN BITS 15-11, AND
046454,000073: 4614 56135 XCH MPTEMP # SUPERBANK IN BITS 7-5.
046455,000074: 4615 74747 MASK LOW10
046456,000075: 4616 56001 XCH L # SAVE REL. ADR. IN BANK, FETCH SUPERBITS.
046457,000076: 4617 00004 INHINT # BECAUSE RUPT DOES NOT SAVE SUPERBANK.
046458,000077: 4620 00006 EXTEND
046459,000078: 4621 01007 WRITE SUPERBNK # SET SUPERBANK FOR DATA.
046460,000079: 4622 50001 INDEX L
046461,000080: 4623 32000 CA 10000 # PINBALL (FIX MEM DISP) PREVENTS DCA HERE
046462,000081: 4624 56135 XCH MPTEMP # SAVE 1ST WD, FETCH OLD FBANK AND SBANK.
046463,000082: 4625 00006 EXTEND
046464,000083: 4626 01007 WRITE SUPERBNK # RESTORE SUPERBANK.
046465,000084: 4627 00003 RELINT
046466,000085: 4630 54004 TS FBANK # RESTORE FBANK.
046467,000086: 4631 30135 CA MPTEMP # RECOVER FIRST WORD OF DATA.
046468,000087: 4632 00002 RETURN # 24 WDS. DATACALL 516 MU, SUPDACAL 432 MU
046469,000088:
Page 1072 |
046471,000090: # THE FOLLOWING ROUTINES ARE IDENTICAL TO BANKCALL AND SWCALL EXCEPT THAT THEY ARE USED IN INTERRUPT.
046472,000091:
046473,000092: 4633 52073 IBNKCALL DXCH RUPTREG3 # USES RUPTREG3,4 FOR DP RETURN ADDRESS.
046474,000093: 4634 50002 INDEX Q
046475,000094: 4635 30000 CAF 0
046476,000095: 4636 24002 INCR Q
046477,000096:
046478,000097: 4637 54001 ISWCALL TS L
046479,000098: 4640 22004 LXCH FBANK
046480,000099: 4641 74747 MASK LOW10
046481,000100: 4642 56002 XCH Q
046482,000101: 4643 52073 DXCH RUPTREG3
046483,000102: 4644 50002 INDEX Q
046484,000103: 4645 02000 TC 10000
046485,000104:
046486,000105: 4646 56073 ISWRETRN XCH RUPTREG4
046487,000106: 4647 56004 XCH FBANK
046488,000107: 4650 56073 XCH RUPTREG4
046489,000108: 4651 00072 TC RUPTREG3
046490,000109:
046491,000110: # 2. USPRCADR ACCESSES INTERPRETIVE CODING IN OTHER THAN THE USER'S FBANK. THE CALLING SEQUENCE IS AS FOLLOWS:
046492,000111:
046493,000112: # L TC USPRCADR
046494,000113: # L+1 CADR INTPRETX INTPRETX IS THE INTERPRETIVE CODING
046495,000114: # RETURN IS TO L+2
046496,000115:
046497,000116: 4652 54164 USPRCADR TS LOC # SAVE A
046498,000117: 4653 34703 CA BIT8
046499,000118: 4654 54023 TS EDOP # EXIT INSTRUCTION TO EDOP
046500,000119: 4655 30006 CA BBANK
046501,000120: 4656 54165 TS BANKSET # USER'S BBANK TO BANKSET
046502,000121: 4657 50002 INDEX Q
046503,000122: 4660 30000 CA 0
046504,000123: 4661 54004 TS FBANK # INTERPRETIVE BANK TO FBANK
046505,000124: 4662 74747 MASK LOW10 # YIELDS INTERPRETIVE RELATIVE ADDRESS
046506,000125: 4663 56002 XCH Q # INTERPRETIVE ADDRESS TO Q, FETCHING L+1
046507,000126: 4664 56164 XCH LOC # L+1 TO LOC, RETRIEVING ORIGINAL A
046508,000127: 4665 14602 TCF Q+10000
046509,000128:
Page 1073 |
046511,000130: # THERE ARE FOUR POSSIBLE SETTINGS FOR CHANNEL 07. (CHANNEL 07 CONTAINS THE SUPERBANK SETTING.)
046512,000131: # PSEUDO-FIXED OCTAL PSEUDO
046513,000132: # SUPERBANK SETTING S-REG. VALUE BANK NUMBERS ADDRESSES
046514,000133: # ---------- ------- ------------ ------------ ------------
046515,000134:
046516,000135: # SUPERBANK 3 0XX 2000 - 3777 30 - 37 70000 - 107777 (WHERE XX CAN BE ANYTHING AND
046517,000136: # WILL USUALLY BE SEEN AS 11)
046518,000137: # SUPERBANK 4 100 2000 - 3777 40 - 47 110000 - 127777 (AS FAR AS IT CAN BE SEEN,
046519,000138: # ONLY BANKS 40-43 WILL EVER BE
046520,000139: # AND ARE PRESENTLY AVAILABLE)
046521,000140: # SUPERBANK 5 101 2000 - 3777 50 - 57 130000 - 147777 (PRESENTLY NOT AVAILABLE TO
046522,000141: # THE USER)
046523,000142: # SUPERBANK 6 110 2000 - 3777 60 - 67 150000 - 167777 (PRESENTLY NOT AVAILABLE TO
046524,000143: # THE USER)
046525,000144: # *** THIS ROUTINE MAYBE CALLED BY ANY PROGRAM LOCATED IN BANKS 00 - 27. I.E., NO PROGRAM LIVING IN ANY
046526,000145: # SUPERBANK SHOULD USE SUPERSW. ***
046527,000146:
046528,000147: # SUPERSW MAYBE CALLED IN THIS FASHION:
046529,000148:
046530,000149: # CAF ABBCON WHERE -- ABBCON BBCON SOMETHIN --
046531,000150: # TCR SUPERSW (THE SUPERBNK BITS ARE IN THE BBCON)
046532,000151: # ... ...
046533,000152: # . .
046534,000153: # . .
046535,000154:
046536,000155: # OR IN THIS FASHION :
046537,000156:
046538,000157: # CAF SUPERSET WHERE SUPERSET IS ONE OF THE FOUR AVAILABLE
046539,000158: # TCR SUPERSW SUPERBANK BIT CONSTANTS:
046540,000159: # ... ... SUPER011 OCTAL 60
046541,000160: # . . SUPER100 OCTAL 100
046542,000161: # . . SUPER101 OCTAL 120
046543,000162: # SUPER110 OCTAL 140
046544,000163:
046545,000164: 4666 00006 SUPERSW EXTEND
046546,000165: 4667 01007 WRITE SUPERBNK # WRITE BITS 7-6-5 OF THE ACCUMULATOR INTO
046547,000166: # CHANNEL 07
046548,000167: 4670 00002 TC Q # TC TO INSTRUCTION FOLLOWING
046549,000168: # TC SUPERSW
End of include-file INTER-BANK_COMMUNICATION.agc. Parent file is MAIN.agc