Source Code
These source-code files were transcribed from a printout in Don Eyles's personal
collection, scanned by archive.org, and financially sponsored by Peter McDermott.
A team of volunteers performed the transcription and proof-reading. The scanned
page images are available at
the Virtual AGC Project website, as well as higher-quality (but much larger)
images at
the Virtual AGC Project's collection in the Internet Archive. Report any problems by creating
"issues" at
the Virtual AGC Project's GitHub Repository. Notations on the program listing read, in part: YUL SYSTEM FOR AGC: NEW PROGRAM SHEPATIN BY EYLES DEC 13, 1966 THIS PROGRAM WAS ASSEMBLED AS A VERSION OF REVISION 37 OF PROGRAM SUNBURST BY LEM GROUPNote that the date is the date of the printout, not the date of the program revision. |
040280,000002: ## Copyright: Public domain.
040281,000003: ## Filename: INTER-BANK_COMMUNICATION.agc
040282,000004: ## Purpose: A section of Sunburst revision 37, or Shepatin revision 0.
040283,000005: ## It is part of an early development version of the software
040284,000006: ## for Apollo Guidance Computer (AGC) on the unmanned Lunar
040285,000007: ## Module (LM) flight Apollo 5. Sunburst 37 was the program
040286,000008: ## upon which Don Eyles's offline development program Shepatin
040287,000009: ## was based; the listing herein transcribed was actually for
040288,000010: ## the equivalent revision 0 of Shepatin.
040289,000011: ## This file is intended to be a faithful transcription, except
040290,000012: ## that the code format has been changed to conform to the
040291,000013: ## requirements of the yaYUL assembler rather than the
040292,000014: ## original YUL assembler.
040293,000015: ## Reference: pp. 888-892
040294,000016: ## Assembler: yaYUL
040295,000017: ## Contact: Ron Burkey <info@sandroid.org>.
040296,000018: ## Website: www.ibiblio.org/apollo/index.html
040297,000019: ## Mod history: 2017-05-24 MAS Created from Sunburst 120.
040298,000020: ## 2017-06-03 TVB Transcribed.
040299,000021: ## 2017-06-14 HG Fix opcode CA -> DCA
040300,000022: ## Add missing EXTEND
040301,000023: ## 2017-06-23 RSB Proofed comment text with
040302,000024: ## octopus/ProoferComments.
040303,000025: ## 2021-05-30 ABS ISWCALLL -> ISWCALL
040304,000026:
Page 888 |
040306,000028: # THE FOLLOWING ROUTINE CAN BE USED TO CALL A SUBROUTINE IN ANOTHER BANK. IN THE BANKCALL VERSION, THE
040307,000029: # CADR OF THE SUBROUTINE IMMEDIATELY FOLLOWS THE TC BANKCALL INSTRUCTION, WITH C(A) AND C(L) PRESERVED.
040308,000030:
040309,000031: 5224 BLOCK 02
040310,000032: 5224 52124 BANKCALL DXCH BUF2 # SAVE INCOMING A,L.
040311,000033: 5225 50002 INDEX Q # PICK UP CADR.
040312,000034: 5226 30000 BNKCAL+2 CA 0
040313,000035: 5227 24002 INCR Q # SO WE RETURN TO THE LOC. AFTER THE CADR.
040314,000036:
040315,000037: # SWCALL IS IDENTICAL TO BANKCALL, EXCEPT THAT THE CADR ARRIVES IN A.
040316,000038:
040317,000039: 5230 54001 SWCALL TS L
040318,000040: 5231 22004 LXCH FBANK # SWITCH BANKS, SAVING RETURN.
040319,000041: 5232 75356 MASK LOW10 # GET SUB-ADDRESS OF CADR.
040320,000042: 5233 56002 XCH Q # A,L NOW CONTAINS DP RETURN.
040321,000043: 5234 52124 DXCH BUF2 # RESTORING INPUTS IF THIS IS A BANKCALL.
040322,000044: 5235 50002 INDEX Q
040323,000045: 5236 02000 TC 10000 # SETTING Q TO SWRETURN.
040324,000046:
040325,000047: 5237 56124 SWRETURN XCH BUF2 +1 # COMES HERE TO RETURN TO CALLER. C(A,L)
040326,000048: 5240 56004 XCH FBANK # ARE PRESERVED FOR RETURN.
040327,000049: 5241 56124 XCH BUF2 +1
040328,000050: 5242 00123 TC BUF2
040329,000051:
040330,000052: # THE FOLLOWING ROUTINE CAN BE USED AS A UNILATERAL JUMP WITH C(A,L) PRESERVED AND THE CADR IMMEDIATELY
040331,000053: # FOLLOWING THE TC POSTJUMP INSTRUCTION.
040332,000054:
040333,000055: 5243 56002 POSTJUMP XCH Q # SAVE INCOMING C(A).
040334,000056: 5244 50000 INDEX A # GET CADR.
040335,000057: 5245 30000 CA 0
040336,000058:
040337,000059: # BANKJUMP IS THE SAME AS POSTJUMP, EXCEPT THAT THE CADR ARRIVES IN A.
040338,000060:
040339,000061: 5246 54004 BANKJUMP TS FBANK
040340,000062: 5247 75356 MASK LOW10
040341,000063: 5250 56002 XCH Q # RESTORING INPUT C(A) IF THIS WAS A
040342,000064: 5251 50002 Q+10000 INDEX Q # POSTJUMP.
040343,000065: 5252 12000 BNKJUP+4 TCF 10000
040344,000066:
Page 889 |
040346,000068: # THE FOLLOWING ROUTINE GETS THE RETURN CADR SAVED BY SWCALL OR BANKCALL AND LEAVES IT IN A.
040347,000069:
040348,000070: 5253 35356 MAKECADR CAF LOW10
040349,000071: 5254 70123 MASK BUF2
040350,000072: 5255 60124 AD BUF2 +1
040351,000073: 5256 00002 TC Q
040352,000074:
040353,000075:
040354,000076: # THE FOLLOWING ROUTINE OBTAINS THE TWO WORDS BEGINNING AT THE ADDRESS ARRIVING IN A, AND LEAVES THEM IN
040355,000077: # A,L. ENTER WITH A CADR IN A, AT DATACALL WITH JUNK IN L IF NOT SWITCHING SUPERBANKS, OTHERWISE AT SUPDACAL WITH
040356,000078: # SUPERBANK BITS IN BITS 7-5 IN L (BITS 15-8 AND 4-1 MAY BE JUNK). DEBRIS = MPTEMP. INHINTS FOR 180 MUSEC.
040357,000079:
040358,000080: 5257 54001 DATACALL TS L # SAVE CADR (SOLE INPUT HERE).
040359,000081: 5260 00006 EXTEND
040360,000082: 5261 00007 READ SUPERBNK # THIS PROLOGUE MAKES SUPERSWITCH VACUOUS.
040361,000083: 5262 56001 XCH L # CADR IN A, SUPERBITS IN L.
040362,000084:
040363,000085: 5263 54125 SUPDACAL TS MPTEMP
040364,000086: 5264 56004 XCH FBANK # SET FBANK FOR DATA.
040365,000087: 5265 00006 EXTEND
040366,000088: 5266 04007 ROR SUPERBNK # SAVE FBANK IN BITS 15-11, AND
040367,000089: 5267 56125 XCH MPTEMP # SUPERBANK IN BITS 7-5.
040368,000090: 5270 75356 MASK LOW10
040369,000091: 5271 56001 XCH L # SAVE REL. ADR. IN BANK, FETCH SUPERBITS.
040370,000092: 5272 00004 INHINT # BECAUSE RUPT DOES NOT SAVE SUPERBANK.
040371,000093: 5273 00006 EXTEND
040372,000094: 5274 01007 WRITE SUPERBNK # SET SUPERBANK FOR DATA.
040373,000095: 5275 00006 EXTEND
040374,000096: 5276 50001 INDEX L
040375,000097: 5277 32001 DCA 10000 # THIS IS SAFE EVEN IF CADR WAS END BANK.
040376,000098:
040377,000099: 5300 56125 XCH MPTEMP # SAVE 1ST WD, FETCH OLD FBANK AND SBANK.
040378,000100: 5301 00006 EXTEND
040379,000101: 5302 01007 WRITE SUPERBNK # RESTORE SUPERBANK.
040380,000102: 5303 00003 RELINT
040381,000103: 5304 54004 TS FBANK # RESTORE FBANK.
040382,000104: 5305 30125 CA MPTEMP # RECOVER FIRST WORD OF DATA.
040383,000105: 5306 00002 RETURN # 24 WDS. DATACALL 516 MU, SUPDACAL 432 MU
040384,000106:
Page 890 |
040386,000108: # THE FOLLOWING ROUTINES ARE IDENTICAL TO BANKCALL AND SWCALL EXCEPT THAT THEY ARE USED IN INTERRUPT.
040387,000109:
040388,000110: 5307 52073 IBNKCALL DXCH RUPTREG3 # USES RUPTREG3,4 FOR DP RETURN ADDRESS.
040389,000111: 5310 50002 INDEX Q
040390,000112: 5311 30000 CAF 0
040391,000113: 5312 24002 INCR Q
040392,000114:
040393,000115: 5313 54001 ISWCALL TS L
040394,000116: 5314 22004 LXCH FBANK
040395,000117: 5315 75356 MASK LOW10
040396,000118: 5316 56002 XCH Q
040397,000119: 5317 52073 DXCH RUPTREG3
040398,000120: 5320 50002 INDEX Q
040399,000121: 5321 02000 TC 10000
040400,000122:
040401,000123: 5322 56073 ISWRETRN XCH RUPTREG4
040402,000124: 5323 56004 XCH FBANK
040403,000125: 5324 56073 XCH RUPTREG4
040404,000126: 5325 00072 TC RUPTREG3
040405,000127:
Page 891 |
040407,000129: # THE FOLLOWING SUBROUTINES PROVIDE TO THE BASIC PROGRAMMER ENTRY INTO AND RETURN FROM ANY INTERPRETIVE
040408,000130: # CODING WHICH DOES NOT USE THE ENTERING CONTENTS OF Q AND WHICH RETURNS VIA DANZIG. C(A) AND C(L) ARE SAVED.
040409,000131:
040410,000132: # USER'S RESPONSIBILITY TO FILL IN ADVANCE THE APPROPRIATE OPERAND AND ADDRESS REGISTERS USED BY THE
040411,000133: # INTERPRETIVE CODING SUCH AS MPAC, BUF, ADDRWD, ETC.; AND TO CONFIRM THAT THE INTERPRETIVE CODING MEETS THE
040412,000134: # ABOVE RESTRICTIONS WITH RESPECT TO Q AND DANZIG.
040413,000135:
040414,000136: # USEPRET AND USPRCADR MUST NOT BE USED IN INTERRUPT.
040415,000137:
040416,000138: # 1. USEPRET ACCESSES INTERPRETIVE CODING WHICH CAN BE ENTERED WITHOUT CHANGING FBANK.
040417,000139: # THE CALLING SEQUENCE IS AS FOLLOWS:
040418,000140:
040419,000141: # L TC USEPRET
040420,000142: # L+1 TC,TCF INTPRETX TC,TCF MEANS TC OR TCF
040421,000143: # INTPRETX IS THE INTERPRETIVE CODING
040422,000144: # RETURN IS TO L+2
040423,000145:
040424,000146: # 2. USPRCADR ACCESSES INTERPRETIVE CODING IN OTHER THAN THE USER'S FBANK. THE CALLING SEQUENCE IS AS FOLLOWS:
040425,000147:
040426,000148: # L TC USPRCADR
040427,000149: # L+1 CADR INTPRETX INTPRETX IS THE INTERPRETIVE CODING
040428,000150: # RETURN IS TO L+2
040429,000151:
040430,000152: 5326 56002 USEPRET XCH Q # FETCH Q, SAVING A
040431,000153: 5327 54154 TS LOC # L+1 TO LOC
040432,000154: 5330 30006 CA BBANK
040433,000155: 5331 54155 TS BANKSET # USER'S BBANK TO BANKSET
040434,000156: 5332 37746 CA BIT8
040435,000157: 5333 54023 TS EDOP # EXIT INSTRUCTION TO EDOP
040436,000158: 5334 30002 CA Q # RETRIEVE ORIGINAL A
040437,000159: 5335 00154 TC LOC
040438,000160:
040439,000161: 5336 54154 USPRCADR TS LOC # SAVE A
040440,000162: 5337 37746 CA BIT8
040441,000163: 5340 54023 TS EDOP # EXIT INSTRUCTION TO EDOP
040442,000164: 5341 30006 CA BBANK
040443,000165: 5342 54155 TS BANKSET # USER'S BBANK TO BANKSET
040444,000166: 5343 50002 INDEX Q
040445,000167: 5344 30000 CA 0
040446,000168: 5345 54004 TS FBANK # INTERPRETIVE BANK TO FBANK
040447,000169: 5346 75356 MASK LOW10 # YIELDS INTERPRETIVE RELATIVE ADDRESS
040448,000170: 5347 56002 XCH Q # INTERPRETIVE ADDRESS TO Q, FETCHING L+1
040449,000171: 5350 56154 XCH LOC # L+1 TO LOC, RETRIEVING ORIGINAL A
040450,000172: 5351 15251 TCF Q+10000
040451,000173:
Page 892 |
040453,000175: # THERE ARE FOUR POSSIBLE SETTINGS FOR CHANNEL 07. (CHANNEL 07 CONTAINS THE SUPERBANK SETTING.)
040454,000176: # PSEUDO-FIXED OCTAL PSEUDO
040455,000177: # SUPERBANK SETTING S-REG. VALUE BANK NUMBERS ADDRESSES
040456,000178: # --------- ------- ------------ ------------ ------------
040457,000179:
040458,000180: # SUPERBANK 3 0XX 2000 - 3777 30 - 37 70000 - 107777 (WHERE XX CAN BE ANYTHING AND
040459,000181: # WILL USUALLY BE SEEN AS 11)
040460,000182: # SUPERBANK 4 100 2000 - 3777 40 - 47 110000 - 127777 (AS FAR AS IT CAN BE SEEN,
040461,000183: # ONLY BANKS 40-43 WILL EVER BE
040462,000184: # AND ARE PRESENTLY AVAILABLE)
040463,000185: # SUPERBANK 5 101 2000 - 3777 50 - 57 130000 - 147777 (PRESENTLY NOT AVAILABLE TO
040464,000186: # THE USER)
040465,000187: # SUPERBANK 6 110 2000 - 3777 60 - 67 150000 - 167777 (PRESENTLY NOT AVAILABLE TO
040466,000188: # THE USER)
040467,000189: # *** THIS ROUTINE MAYBE CALLED BY ANY PROGRAM LOCATED IN BANKS 00 - 27. I.E., NO PROGRAM LIVING IN ANY
040468,000190: # SUPERBANK SHOULD USE SUPERSW. ***
040469,000191:
040470,000192: # SUPERSW MAY BE CALLED IN THIS FASHION:
040471,000193:
040472,000194: # CAF ABBCON WHERE -- ABBCON BBCON SOMETHIN --
040473,000195: # TCR SUPERSW (THE SUPERBNK BITS ARE IN THE BBCON)
040474,000196: # ... ...
040475,000197: # . .
040476,000198: # . .
040477,000199:
040478,000200: # OR IN THIS FASHION:
040479,000201:
040480,000202: # CAF SUPERSET WHERE SUPERSET IS ONE OF THE FOUR AVAILABLE
040481,000203: # TCR SUPERSW SUPERBANK BIT CONSTANTS:
040482,000204: # ... ... SUPER011 OCTAL 60
040483,000205: # . . SUPER100 OCTAL 100
040484,000206: # . . SUPER101 OCTAL 120
040485,000207: # SUPER110 OCTAL 140
040486,000208:
040487,000209: 5352 00006 SUPERSW EXTEND
040488,000210: 5353 01007 WRITE SUPERBNK # WRITE BITS 7-6-5 OF THE ACCUMULATOR INTO
040489,000211: # CHANNEL 07
040490,000212: 5354 00002 TC Q # TC TO INSTRUCTION FOLLOWING
040491,000213: # TC SUPERSW
End of include-file INTER-BANK_COMMUNICATION.agc. Parent file is MAIN.agc