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 GROUP
Note that the date is the date of the printout, not the date of the program revision.

040272,000002:                                                                                                  ## Copyright:   Public domain.
040273,000003:                                                                                                  ## Filename:    INTER-BANK_COMMUNICATION.agc
040274,000004:                                                                                                  ## Purpose:     A section of Sunburst revision 37, or Shepatin revision 0.
040275,000005:                                                                                                  ##              It is part of an early development version of the software
040276,000006:                                                                                                  ##              for Apollo Guidance Computer (AGC) on the unmanned Lunar
040277,000007:                                                                                                  ##              Module (LM) flight Apollo 5. Sunburst 37 was the program
040278,000008:                                                                                                  ##              upon which Don Eyles's offline development program Shepatin
040279,000009:                                                                                                  ##              was based; the listing herein transcribed was actually for
040280,000010:                                                                                                  ##              the equivalent revision 0 of Shepatin.
040281,000011:                                                                                                  ##              This file is intended to be a faithful transcription, except
040282,000012:                                                                                                  ##              that the code format has been changed to conform to the
040283,000013:                                                                                                  ##              requirements of the yaYUL assembler rather than the
040284,000014:                                                                                                  ##              original YUL assembler.
040285,000015:                                                                                                  ## Reference:   pp. 888-892
040286,000016:                                                                                                  ## Assembler:   yaYUL
040287,000017:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
040288,000018:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
040289,000019:                                                                                                  ## Mod history: 2017-05-24 MAS  Created from Sunburst 120.
040290,000020:                                                                                                  ##              2017-06-03 TVB  Transcribed.
040291,000021:                                                                                                  ##              2017-06-14 HG   Fix opcode CA -> DCA
040292,000022:                                                                                                  ##                              Add missing EXTEND
040293,000023:                                                                                                  ##              2017-06-23 RSB  Proofed comment text with
040294,000024:                                                                                                  ##                              octopus/ProoferComments.
040295,000025: 

Page 888

040297,000027:                                                                                                  #           THE FOLLOWING ROUTINE CAN BE USED TO CALL A SUBROUTINE IN ANOTHER BANK. IN THE BANKCALL VERSION, THE
040298,000028:                                                                                                  #  CADR OF THE SUBROUTINE IMMEDIATELY FOLLOWS THE  TC BANKCALL  INSTRUCTION, WITH C(A) AND C(L) PRESERVED.
040299,000029: 
040300,000030:    5224                                           BLOCK    02                                    
040301,000031:    5224           52124        BANKCALL           DXCH     BUF2                                  #  SAVE INCOMING A,L.
040302,000032:    5225           50002                           INDEX    Q                                     #  PICK UP CADR.
040303,000033:    5226           30000        BNKCAL+2           CA       0                                     
040304,000034:    5227           24002                           INCR     Q                                     #  SO WE RETURN TO THE LOC. AFTER THE CADR.
040305,000035: 
040306,000036:                                                                                                  #  SWCALL IS  IDENTICAL TO BANKCALL, EXCEPT THAT THE CADR ARRIVES IN A.
040307,000037: 
040308,000038:    5230           54001        SWCALL             TS       L                                     
040309,000039:    5231           22004                           LXCH     FBANK                                 #  SWITCH BANKS, SAVING RETURN.
040310,000040:    5232           75356                           MASK     LOW10                                 #  GET SUB-ADDRESS OF CADR.
040311,000041:    5233           56002                           XCH      Q                                     #  A,L NOW CONTAINS DP RETURN.
040312,000042:    5234           52124                           DXCH     BUF2                                  #  RESTORING INPUTS IF THIS IS A BANKCALL.
040313,000043:    5235           50002                           INDEX    Q                                     
040314,000044:    5236           02000                           TC       10000                                 #  SETTING Q TO SWRETURN.
040315,000045: 
040316,000046:    5237           56124        SWRETURN           XCH      BUF2       +1                         #  COMES HERE TO RETURN TO CALLER. C(A,L)
040317,000047:    5240           56004                           XCH      FBANK                                 #  ARE PRESERVED FOR RETURN.
040318,000048:    5241           56124                           XCH      BUF2       +1                         
040319,000049:    5242           00123                           TC       BUF2                                  
040320,000050: 
040321,000051:                                                                                                  #           THE FOLLOWING ROUTINE CAN BE USED AS A UNILATERAL JUMP WITH C(A,L) PRESERVED AND THE CADR IMMEDIATELY
040322,000052:                                                                                                  #  FOLLOWING THE TC POSTJUMP INSTRUCTION.
040323,000053: 
040324,000054:    5243           56002        POSTJUMP           XCH      Q                                     #  SAVE INCOMING C(A).
040325,000055:    5244           50000                           INDEX    A                                     #  GET CADR.
040326,000056:    5245           30000                           CA       0                                     
040327,000057: 
040328,000058:                                                                                                  #           BANKJUMP IS THE SAME AS POSTJUMP, EXCEPT THAT THE CADR ARRIVES IN A.
040329,000059: 
040330,000060:    5246           54004        BANKJUMP           TS       FBANK                                 
040331,000061:    5247           75356                           MASK     LOW10                                 
040332,000062:    5250           56002                           XCH      Q                                     #  RESTORING INPUT C(A) IF THIS WAS A
040333,000063:    5251           50002        Q+10000            INDEX    Q                                     #  POSTJUMP.
040334,000064:    5252           12000        BNKJUP+4           TCF      10000                                 
040335,000065: 

Page 889

040337,000067:                                                                                                  #           THE FOLLOWING ROUTINE GETS THE RETURN CADR SAVED BY SWCALL OR BANKCALL AND LEAVES IT IN A.
040338,000068: 
040339,000069:    5253           35356        MAKECADR           CAF      LOW10                                 
040340,000070:    5254           70123                           MASK     BUF2                                  
040341,000071:    5255           60124                           AD       BUF2       +1                         
040342,000072:    5256           00002                           TC       Q                                     
040343,000073: 
040344,000074: 
040345,000075:                                                                                                  #           THE FOLLOWING ROUTINE OBTAINS THE TWO WORDS BEGINNING AT THE ADDRESS ARRIVING IN A, AND LEAVES THEM IN
040346,000076:                                                                                                  #  A,L.  ENTER WITH A CADR IN A, AT DATACALL WITH JUNK IN L IF NOT SWITCHING SUPERBANKS, OTHERWISE AT SUPDACAL WITH
040347,000077:                                                                                                  #  SUPERBANK BITS IN BITS 7-5 IN L (BITS 15-8 AND 4-1 MAY BE JUNK).  DEBRIS = MPTEMP.  INHINTS FOR 180 MUSEC.
040348,000078: 
040349,000079:    5257           54001        DATACALL           TS       L                                     #  SAVE CADR (SOLE INPUT HERE).
040350,000080:    5260           00006                           EXTEND                                         
040351,000081:    5261           00007                           READ     SUPERBNK                              #  THIS PROLOGUE MAKES SUPERSWITCH VACUOUS.
040352,000082:    5262           56001                           XCH      L                                     #  CADR IN A, SUPERBITS IN L.
040353,000083: 
040354,000084:    5263           54125        SUPDACAL           TS       MPTEMP                                
040355,000085:    5264           56004                           XCH      FBANK                                 #  SET FBANK FOR DATA.
040356,000086:    5265           00006                           EXTEND                                         
040357,000087:    5266           04007                           ROR      SUPERBNK                              #  SAVE FBANK IN BITS 15-11, AND
040358,000088:    5267           56125                           XCH      MPTEMP                                #   SUPERBANK IN BITS  7-5.
040359,000089:    5270           75356                           MASK     LOW10                                 
040360,000090:    5271           56001                           XCH      L                                     #  SAVE REL. ADR. IN BANK, FETCH SUPERBITS.
040361,000091:    5272           00004                           INHINT                                         #  BECAUSE RUPT DOES NOT SAVE SUPERBANK.
040362,000092:    5273           00006                           EXTEND                                         
040363,000093:    5274           01007                           WRITE    SUPERBNK                              #  SET SUPERBANK FOR DATA.
040364,000094:    5275           00006                           EXTEND                                         
040365,000095:    5276           50001                           INDEX    L                                     
040366,000096:    5277           32001                           DCA      10000                                 #  THIS IS SAFE EVEN IF CADR WAS END BANK.
040367,000097: 
040368,000098:    5300           56125                           XCH      MPTEMP                                #  SAVE 1ST WD, FETCH OLD FBANK AND SBANK.
040369,000099:    5301           00006                           EXTEND                                         
040370,000100:    5302           01007                           WRITE    SUPERBNK                              #  RESTORE SUPERBANK.
040371,000101:    5303           00003                           RELINT                                         
040372,000102:    5304           54004                           TS       FBANK                                 #  RESTORE FBANK.
040373,000103:    5305           30125                           CA       MPTEMP                                #  RECOVER FIRST WORD OF DATA.
040374,000104:    5306           00002                           RETURN                                         #  24 WDS. DATACALL 516 MU, SUPDACAL 432 MU
040375,000105: 

Page 890

040377,000107:                                                                                                  #           THE FOLLOWING ROUTINES ARE IDENTICAL TO BANKCALL AND SWCALL EXCEPT THAT THEY ARE USED IN INTERRUPT.
040378,000108: 
040379,000109:    5307           52073        IBNKCALL           DXCH     RUPTREG3                              #  USES RUPTREG3,4 FOR DP RETURN ADDRESS.
040380,000110:    5310           50002                           INDEX    Q                                     
040381,000111:    5311           30000                           CAF      0                                     
040382,000112:    5312           24002                           INCR     Q                                     
040383,000113: 
040384,000114:    5313           54001        ISWCALLL           TS       L                                     
040385,000115:    5314           22004                           LXCH     FBANK                                 
040386,000116:    5315           75356                           MASK     LOW10                                 
040387,000117:    5316           56002                           XCH      Q                                     
040388,000118:    5317           52073                           DXCH     RUPTREG3                              
040389,000119:    5320           50002                           INDEX    Q                                     
040390,000120:    5321           02000                           TC       10000                                 
040391,000121: 
040392,000122:    5322           56073        ISWRETRN           XCH      RUPTREG4                              
040393,000123:    5323           56004                           XCH      FBANK                                 
040394,000124:    5324           56073                           XCH      RUPTREG4                              
040395,000125:    5325           00072                           TC       RUPTREG3                              
040396,000126: 

Page 891

040398,000128:                                                                                                  #           THE FOLLOWING SUBROUTINES PROVIDE TO THE BASIC PROGRAMMER ENTRY INTO AND RETURN FROM ANY INTERPRETIVE
040399,000129:                                                                                                  #  CODING WHICH DOES NOT USE THE ENTERING CONTENTS OF Q AND WHICH RETURNS VIA DANZIG. C(A) AND C(L) ARE SAVED.
040400,000130: 
040401,000131:                                                                                                  #  USER'S RESPONSIBILITY TO FILL IN ADVANCE THE APPROPRIATE OPERAND AND ADDRESS REGISTERS USED BY THE
040402,000132:                                                                                                  #  INTERPRETIVE CODING SUCH AS MPAC, BUF, ADDRWD, ETC.; AND TO CONFIRM THAT THE INTERPRETIVE CODING MEETS THE
040403,000133:                                                                                                  #  ABOVE RESTRICTIONS WITH RESPECT TO Q AND DANZIG.
040404,000134: 
040405,000135:                                                                                                  #  USEPRET AND USPRCADR MUST NOT BE USED IN INTERRUPT.
040406,000136: 
040407,000137:                                                                                                  #  1. USEPRET ACCESSES INTERPRETIVE CODING WHICH CAN BE ENTERED WITHOUT CHANGING FBANK.
040408,000138:                                                                                                  #     THE CALLING SEQUENCE IS AS FOLLOWS:
040409,000139: 
040410,000140:                                                                                                  #                                          L         TC     USEPRET
040411,000141:                                                                                                  #                                          L+1       TC,TCF INTPRETX       TC,TCF MEANS TC OR TCF
040412,000142:                                                                                                  #                                                                          INTPRETX IS THE INTERPRETIVE CODING
040413,000143:                                                                                                  #                                                                          RETURN IS TO L+2
040414,000144: 
040415,000145:                                                                                                  #  2. USPRCADR ACCESSES INTERPRETIVE CODING IN OTHER THAN THE USER'S FBANK. THE CALLING SEQUENCE IS AS FOLLOWS:
040416,000146: 
040417,000147:                                                                                                  #                                          L         TC     USPRCADR
040418,000148:                                                                                                  #                                          L+1       CADR   INTPRETX       INTPRETX IS THE INTERPRETIVE CODING
040419,000149:                                                                                                  #                                                                          RETURN IS TO L+2
040420,000150: 
040421,000151:    5326           56002        USEPRET            XCH      Q                                     #  FETCH Q, SAVING A
040422,000152:    5327           54154                           TS       LOC                                   #  L+1 TO LOC
040423,000153:    5330           30006                           CA       BBANK                                 
040424,000154:    5331           54155                           TS       BANKSET                               #  USER'S BBANK TO BANKSET
040425,000155:    5332           37746                           CA       BIT8                                  
040426,000156:    5333           54023                           TS       EDOP                                  #  EXIT INSTRUCTION TO EDOP
040427,000157:    5334           30002                           CA       Q                                     #  RETRIEVE ORIGINAL A
040428,000158:    5335           00154                           TC       LOC                                   
040429,000159: 
040430,000160:    5336           54154        USPRCADR           TS       LOC                                   #  SAVE A
040431,000161:    5337           37746                           CA       BIT8                                  
040432,000162:    5340           54023                           TS       EDOP                                  #  EXIT INSTRUCTION TO EDOP
040433,000163:    5341           30006                           CA       BBANK                                 
040434,000164:    5342           54155                           TS       BANKSET                               #  USER'S BBANK TO BANKSET
040435,000165:    5343           50002                           INDEX    Q                                     
040436,000166:    5344           30000                           CA       0                                     
040437,000167:    5345           54004                           TS       FBANK                                 #  INTERPRETIVE BANK TO FBANK
040438,000168:    5346           75356                           MASK     LOW10                                 #  YIELDS INTERPRETIVE RELATIVE ADDRESS
040439,000169:    5347           56002                           XCH      Q                                     #  INTERPRETIVE ADDRESS TO Q, FETCHING L+1
040440,000170:    5350           56154                           XCH      LOC                                   #  L+1 TO LOC, RETRIEVING ORIGINAL A
040441,000171:    5351           15251                           TCF      Q+10000                               
040442,000172: 

Page 892

040444,000174:                                                                                                  #  THERE ARE FOUR POSSIBLE SETTINGS FOR CHANNEL 07. (CHANNEL 07 CONTAINS THE SUPERBANK SETTING.)
040445,000175:                                                                                                  #                                            PSEUDO-FIXED     OCTAL PSEUDO
040446,000176:                                                                                                  #  SUPERBANK     SETTING     S-REG. VALUE    BANK NUMBERS     ADDRESSES
040447,000177:                                                                                                  #  ---------     -------     ------------     ------------     ------------
040448,000178: 
040449,000179:                                                                                                  #  SUPERBANK 3     0XX       2000 - 3777        30 - 37       70000 - 107777   (WHERE XX CAN BE ANYTHING AND
040450,000180:                                                                                                  #                                                                              WILL USUALLY BE SEEN AS 11)
040451,000181:                                                                                                  #  SUPERBANK 4     100       2000 - 3777        40 - 47       110000 - 127777  (AS FAR AS IT CAN BE SEEN,
040452,000182:                                                                                                  #                                                                              ONLY BANKS 40-43 WILL EVER BE
040453,000183:                                                                                                  #                                                                              AND ARE PRESENTLY AVAILABLE)
040454,000184:                                                                                                  #  SUPERBANK 5     101       2000 - 3777        50 - 57       130000 - 147777  (PRESENTLY NOT AVAILABLE TO
040455,000185:                                                                                                  #                                                                              THE USER)
040456,000186:                                                                                                  #  SUPERBANK 6     110       2000 - 3777        60 - 67       150000 - 167777  (PRESENTLY NOT AVAILABLE TO
040457,000187:                                                                                                  #                                                                              THE USER)
040458,000188:                                                                                                  #  ***  THIS ROUTINE MAYBE CALLED BY ANY PROGRAM LOCATED IN BANKS 00 - 27.  I.E., NO PROGRAM LIVING IN ANY
040459,000189:                                                                                                  #  SUPERBANK SHOULD USE SUPERSW. ***
040460,000190: 
040461,000191:                                                                                                  #  SUPERSW MAY BE CALLED IN THIS FASHION:
040462,000192: 
040463,000193:                                                                                                  #           CAF     ABBCON          WHERE  --  ABBCON   BBCON  SOMETHIN  --
040464,000194:                                                                                                  #           TCR     SUPERSW         (THE SUPERBNK BITS ARE IN THE BBCON)
040465,000195:                                                                                                  #           ...       ...
040466,000196:                                                                                                  #            .         .
040467,000197:                                                                                                  #            .         .
040468,000198: 
040469,000199:                                                                                                  #  OR IN THIS FASHION:
040470,000200: 
040471,000201:                                                                                                  #           CAF     SUPERSET        WHERE SUPERSET IS ONE OF THE FOUR AVAILABLE
040472,000202:                                                                                                  #           TCR     SUPERSW         SUPERBANK BIT CONSTANTS:
040473,000203:                                                                                                  #           ...       ...                                   SUPER011 OCTAL  60
040474,000204:                                                                                                  #            .         .                                    SUPER100 OCTAL 100
040475,000205:                                                                                                  #            .         .                                    SUPER101 OCTAL 120
040476,000206:                                                                                                  #                                                           SUPER110 OCTAL 140
040477,000207: 
040478,000208:    5352           00006        SUPERSW            EXTEND                                         
040479,000209:    5353           01007                           WRITE    SUPERBNK                              #  WRITE BITS 7-6-5 OF THE ACCUMULATOR INTO
040480,000210:                                                                                                  #  CHANNEL 07
040481,000211:    5354           00002                           TC       Q                                     #  TC TO INSTRUCTION FOLLOWING
040482,000212:                                                                                                  #    TC  SUPERSW

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