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,1969Note that the date is the date of the printout, not the date of the program revision. |
049027,000002: ## Copyright: Public domain.
049028,000003: ## Filename: INTER-BANK_COMMUNICATION.agc
049029,000004: ## Purpose: Part of the source code for Comanche, build 055. It
049030,000005: ## is part of the source code for the Command Module's
049031,000006: ## (CM) Apollo Guidance Computer (AGC), Apollo 11.
049032,000007: ## Assembler: yaYUL
049033,000008: ## Reference: pp. 1103-1106
049034,000009: ## Contact: Ron Burkey <info@sandroid.org>
049035,000010: ## Website: http://www.ibiblio.org/apollo.
049036,000011: ## Mod history: 2009-05-08 RSB Adapted from Colossus249/ file of same name
049037,000012: ## and page images. Corrected various typos
049038,000013: ## in the transcription of program comments,
049039,000014: ## and these should be back-ported to
049040,000015: ## Colossus249.
049041,000016: ## 2011-05-08 JL Removed workaround.
049042,000017: ## 2016-12-21 RSB Proofed comment text using octopus/ProoferComments
049043,000018: ## and corrected the errors found.
049044,000019: ## 2017-01-14 RSB Corrected comment-text errors located while diff'ing
049045,000020: ## against Colossus 249.
049046,000021:
049047,000022: ## The contents of the "Comanche055" files, in general, are transcribed
049048,000023: ## from scanned documents.
049049,000024: ##
049050,000025: ## Assemble revision 055 of AGC program Comanche by NASA
049051,000026: ## 2021113-051. April 1, 1969.
049052,000027: ##
049053,000028: ## This AGC program shall also be referred to as Colossus 2A
049054,000029: ##
049055,000030: ## Prepared by
049056,000031: ## Massachusetts Institute of Technology
049057,000032: ## 75 Cambridge Parkway
049058,000033: ## Cambridge, Massachusetts
049059,000034: ##
049060,000035: ## under NASA contract NAS 9-4065.
049061,000036: ##
049062,000037: ## Refer directly to the online document mentioned above for further
049063,000038: ## information. Please report any errors to info@sandroid.org.
049064,000039:
Page 1103 |
049066,000041: # THE FOLLOWING ROUTINE CAN BE USED TO CALL A SUBROUTINE IN ANOTHER BANK. IN THE BANKCALL VERSION, THE
049067,000042: # CADR OF THE SUBROUTINE IMMEDIATELY FOLLOWS THE TC BANKCALL INSTRUCTION, WITH C(A) AND C(L) PRESERVED.
049068,000043:
049069,000044: 4662 BLOCK 02
049070,000045: 4662 COUNT 02/BANK
049071,000046:
049072,000047: 4662 52134 BANKCALL DXCH BUF2 # SAVE INCOMING A,L.
049073,000048: 4663 50002 INDEX Q # PICK UP CADR.
049074,000049: 4664 30000 CA 0
049075,000050: 4665 24002 INCR Q # SO WE RETURN TO THE LOC. AFTER THE CADR.
049076,000051:
049077,000052: # SWCALL IS IDENTICAL TO BANKCALL, EXCEPT THAT THE CADR ARRIVES IN A.
049078,000053:
049079,000054: 4666 54001 SWCALL TS L
049080,000055: 4667 22004 LXCH FBANK # SWITCH BANKS, SAVING RETURN.
049081,000056: 4670 75054 MASK LOW10 # GET SUB-ADDRESS OF CADR.
049082,000057: 4671 56002 XCH Q # A,L NOW CONTAINS DP RETURN.
049083,000058: 4672 52134 DXCH BUF2 # RESTORING INPUTS IF THIS IS A BANKCALL.
049084,000059: 4673 50002 INDEX Q
049085,000060: 4674 02000 TC 10000 # SETTING Q TO SWRETURN.
049086,000061:
049087,000062: 4675 56134 SWRETURN XCH BUF2 +1 # COMES HERE TO RETURN TO CALLER. C(A,L)
049088,000063: 4676 56004 XCH FBANK # ARE PRESERVED FOR RETURN.
049089,000064: 4677 56134 XCH BUF2 +1
049090,000065: 4700 00133 TC BUF2
049091,000066:
049092,000067: # THE FOLLOWING ROUTINE CAN BE USED AS A UNILATERAL JUMP WITH C(A,L) PRESERVED AND THE CADR IMMEDIATELY
049093,000068: # FOLLOWING THE TC POSTJUMP INSTRUCTION.
049094,000069:
049095,000070: 4701 56002 POSTJUMP XCH Q # SAVE INCOMING C(A).
049096,000071: 4702 50000 INDEX A # GET CADR.
049097,000072: 4703 30000 CA 0
049098,000073:
049099,000074: # BANKJUMP IS THE SAME AS POSTJUMP, EXCEPT THAT THE CADR ARRIVES IN A.
049100,000075:
049101,000076: 4704 54004 BANKJUMP TS FBANK
049102,000077: 4705 75054 MASK LOW10
049103,000078: 4706 56002 XCH Q # RESTORING INPUT C(A) IF THIS WAS A
049104,000079: 4707 50002 Q+10000 INDEX Q # POSTJUMP.
049105,000080: 4710 12000 PRIO12 TCF 10000 # PRIO12 = TCF 10000 = 12000
049106,000081:
Page 1104 |
049108,000083: # THE FOLLOWING ROUTINE GETS THE RETURN CADR SAVED BY SWCALL OR BANKCALL AND LEAVES IT IN A.
049109,000084:
049110,000085: 4711 35054 MAKECADR CAF LOW10
049111,000086: 4712 70133 MASK BUF2
049112,000087: 4713 60134 AD BUF2 +1
049113,000088: 4714 00002 TC Q
049114,000089:
049115,000090: 4715 54135 SUPDACAL TS MPTEMP
049116,000091: 4716 56004 XCH FBANK # SET FBANK FOR DATA.
049117,000092: 4717 00006 EXTEND
049118,000093: 4720 04007 ROR SUPERBNK # SAVE FBANK IN BITS 15-11, AND
049119,000094: 4721 56135 XCH MPTEMP # SUPERBANK IN BITS 7-5.
049120,000095: 4722 75054 MASK LOW10
049121,000096: 4723 56001 XCH L # SAVE REL. ADR. IN BANK, FETCH SUPERBITS.
049122,000097: 4724 00004 INHINT # BECAUSE RUPT DOES NOT SAVE SUPERBANK.
049123,000098: 4725 00006 EXTEND
049124,000099: 4726 01007 WRITE SUPERBNK # SET SUPERBANK FOR DATA.
049125,000100: 4727 50001 INDEX L
049126,000101: 4730 32000 CA 10000 # PINBALL (FIX MEM DISP) PREVENTS DCA HERE
049127,000102: 4731 56135 XCH MPTEMP # SAVE 1ST WD, FETCH OLD FBANK AND SBANK.
049128,000103: 4732 00006 EXTEND
049129,000104: 4733 01007 WRITE SUPERBNK # RESTORE SUPERBANK.
049130,000105: 4734 00003 RELINT
049131,000106: 4735 54004 TS FBANK # RESTORE FBANK.
049132,000107: 4736 30135 CA MPTEMP # RECOVER FIRST WORD OF DATA.
049133,000108: 4737 00002 RETURN # 24 WDS. DATACALL 516 MU, SUPDACAL 432 MU
049134,000109:
Page 1105 |
049136,000111: # THE FOLLOWING ROUTINES ARE IDENTICAL TO BANKCALL AND SWCALL EXCEPT THAT THEY ARE USED IN INTERRUPT.
049137,000112:
049138,000113: 4740 52073 IBNKCALL DXCH RUPTREG3 # USES RUPTREG3,4 FOR DP RETURN ADDRESS.
049139,000114: 4741 50002 INDEX Q
049140,000115: 4742 30000 CAF 0
049141,000116: 4743 24002 INCR Q
049142,000117:
049143,000118: 4744 54001 ISWCALL TS L
049144,000119: 4745 22004 LXCH FBANK
049145,000120: 4746 75054 MASK LOW10
049146,000121: 4747 56002 XCH Q
049147,000122: 4750 52073 DXCH RUPTREG3
049148,000123: 4751 50002 INDEX Q
049149,000124: 4752 02000 TC 10000
049150,000125:
049151,000126: 4753 56073 ISWRETRN XCH RUPTREG4
049152,000127: 4754 56004 XCH FBANK
049153,000128: 4755 56073 XCH RUPTREG4
049154,000129: 4756 00072 TC RUPTREG3
049155,000130:
049156,000131: # 2. USPRCADR ACCESSES INTERPRETIVE CODING IN OTHER THAN THE USER'S FBANK. THE CALLING SEQUENCE IS AS FOLLOWS:
049157,000132: # L TC USPRCADR
049158,000133: # L+1 CADR INTPRETX INTPRETX IS THE INTERPRETIVE CODING
049159,000134: # RETURN IS TO L+2
049160,000135:
049161,000136: 4757 54164 USPRCADR TS LOC # SAVE A
049162,000137: 4760 35010 CA BIT8
049163,000138: 4761 54023 TS EDOP # EXIT INSTRUCTION TO EDOP
049164,000139: 4762 30006 CA BBANK
049165,000140: 4763 54165 TS BANKSET # USER'S BBANK TO BANKSET
049166,000141: 4764 50002 INDEX Q
049167,000142: 4765 30000 CA 0
049168,000143: 4766 54004 TS FBANK # INTERPRETIVE BANK TO FBANK
049169,000144: 4767 75054 MASK LOW10 # YIELDS INTERPRETIVE RELATIVE ADDRESS
049170,000145: 4770 56002 XCH Q # INTERPRETIVE ADDRESS TO Q, FETCHING L+1
049171,000146: 4771 56164 XCH LOC # L+1 TO LOC, RETRIEVING ORIGINAL A
049172,000147: 4772 14707 TCF Q+10000
049173,000148:
Page 1106 |
049175,000150: # THERE ARE FOUR POSSIBLE SETTINGS FOR CHANNEL 07. (CHANNEL 07 CONTAINS THE SUPERBANK SETTING.)
049176,000151:
049177,000152: # PSEUDO-FIXED OCTAL PSEUDO
049178,000153: # SUPERBANK SETTING S-REG. VALUE BANK NUMBERS ADDRESSES
049179,000154: # ---------- ------- ------------ ------------ ------------
049180,000155: # SUPERBANK 3 0XX 2000 - 3777 30 - 37 70000 - 107777 (WHERE XX CAN BE ANYTHING AND
049181,000156: # WILL USUALLY BE SEEN AS 11)
049182,000157: # SUPERBANK 4 100 2000 - 3777 40 - 47 110000 - 127777 (AS FAR AS IT CAN BE SEEN,
049183,000158: # ONLY BANKS 40-43 WILL EVER BE
049184,000159: # AND ARE PRESENTLY AVAILABLE)
049185,000160: # SUPERBANK 5 101 2000 - 3777 50 - 57 130000 - 147777 (PRESENTLY NOT AVAILABLE TO
049186,000161: # THE USER)
049187,000162: # SUPERBANK 6 110 2000 - 3777 60 - 67 150000 - 167777 (PRESENTLY NOT AVAILABLE TO
049188,000163: # THE USER)
049189,000164: # *** THIS ROUTINE MAY BE CALLED BY ANY PROGRAM LOCATED IN BANKS 00 - 27. I.E., NO PROGRAM LIVING IN ANY
049190,000165: # SUPERBANK SHOULD USE SUPERSW. ***
049191,000166:
049192,000167: # SUPERSW MAY BE CALLED IN THIS FASHION:
049193,000168: # CAF ABBCON WHERE -- ABBCON BBCON SOMETHIN --
049194,000169: # TCR SUPERSW (THE SUPERBNK BITS ARE IN THE BBCON)
049195,000170: # ... ...
049196,000171: # . .
049197,000172: # . .
049198,000173: # OR IN THIS FASHION:
049199,000174: # CAF SUPERSET WHERE SUPERSET IS ONE OF THE FOUR AVAILABLE
049200,000175: # TCR SUPERSW SUPERBANK BIT CONSTANTS:
049201,000176: # ... ... SUPER011 OCTAL 60
049202,000177: # . . SUPER100 OCTAL 100
049203,000178: # . . SUPER101 OCTAL 120
049204,000179: # SUPER110 OCTAL 140
049205,000180:
049206,000181: 4773 00006 SUPERSW EXTEND
049207,000182: 4774 01007 WRITE SUPERBNK # WRITE BITS 7-6-5 OF THE ACCUMULATOR INTO
049208,000183: # CHANNEL 07
049209,000184: 4775 00002 TC Q # TC TO INSTRUCTION FOLLOWING
049210,000185: # TC SUPERSW
049211,000186:
049212,000187:
049213,000188:
End of include-file INTER-BANK_COMMUNICATION.agc. Parent file is MAIN.agc