Source Code

These source-code files were transcribed from scans made from Don Eyles's personal copy of BURST120 (SUNBURST 120). They were scanned at archive.org's Boston facility, and the scanning was sponsored by Mike Stewart. The code was transcribed from these scans by a team of volunteers who are referenced in the program comments. Comments from the original source code are in ALL-CAPS, whereas comments added later in transcription are in Mixed-Case. In some cases, where similar code blocks exist in previously-transcribed AGC programs (primarily Luminary 99, from Apollo 11) those code blocks were used as a starting point and then corrected to agree with the BURST120 scans. The full scans are available at the Virtual AGC project's collection at archive.org, while more-convenient reduced-size (but reduced-quality) images are available at the main Virtual AGC website. Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository. Notations on the program listing read, in part:

	YUL SYSTEM FOR AGC: REVISION 0 OF PROGRAM BURST120 
	BY NASA 2021106-031 DEC 7, 1967

	THIS LISTING IS A COPY OF A VERSION OF THE PROGRAM INTENDED 
	FOR USE IN THE ON-BOARD PRIMARY GUIDANCE COMPUTER IN THE 
	UNMANNED FLIGHT OF APOLLO LUNAR MODULE 1 --- THE AS206 MISSION.
Note that the date is the date of the printout, not the date of the program revision.

040698,000002:                                                                                                  ## Copyright:   Public domain.
040699,000003:                                                                                                  ## Filename:    INTER-BANK_COMMUNICATION.agc
040700,000004:                                                                                                  ## Purpose:     A module for revision 0 of BURST120 (Sunburst). It 
040701,000005:                                                                                                  ##              is part of the source code for the Lunar Module's
040702,000006:                                                                                                  ##              (LM) Apollo Guidance Computer (AGC) for Apollo 5.
040703,000007:                                                                                                  ## Assembler:   yaYUL
040704,000008:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
040705,000009:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
040706,000010:                                                                                                  ## Mod history: 2016-09-30 RSB  Created draft version.
040707,000011:                                                                                                  ##              2016-10-19 RSB  Transcribed, largely from Aurora 12 version of the file.
040708,000012:                                                                                                  ##              2016-10-31 RSB  Typos.
040709,000013:                                                                                                  ##              2016-11-01 RSB  More typos.
040710,000014:                                                                                                  ##              2016-12-06 RSB  Comments proofed using octopus/ProoferComments,
040711,000015:                                                                                                  ##                              changes made.
040712,000016:                                                                                                  ##              2017-03-17 RSB  Comment-text fixes identified in diff'ing
040713,000017:                                                                                                  ##                              Luminary 99 vs Comanche 55.
040714,000018:                                                                                                  ##              2021-05-30 ABS  ISWCALLL -> ISWCALL
040715,000019: 

Page 948

040717,000021:                                                                                                  #           THE FOLLOWING ROUTINE CAN BE USED TO CALL A SUBROUTINE IN ANOTHER BANK. IN THE BANKCALL VERSION, THE
040718,000022:                                                                                                  #  CADR OF THE SUBROUTINE IMMEDIATELY FOLLOWS THE  TC BANKCALL  INSTRUCTION, WITH C(A) AND C(L) PRESERVED.
040719,000023: 
040720,000024:    5206                                           BLOCK    02                                    
040721,000025:    5206           52124        BANKCALL           DXCH     BUF2                                  #  SAVE INCOMING A,L.
040722,000026:    5207           50002                           INDEX    Q                                     #  PICK UP CADR.
040723,000027:    5210           30000        BNKCAL+2           CA       0                                     
040724,000028:    5211           24002                           INCR     Q                                     #  SO WE RETURN TO THE LOC. AFTER THE CADR.
040725,000029: 
040726,000030:                                                                                                  #  SWCALL IS  IDENTICAL TO BANKCALL, EXCEPT THAT THE CADR ARRIVES IN A.
040727,000031: 
040728,000032:    5212           54001        SWCALL             TS       L                                     
040729,000033:    5213           22004                           LXCH     FBANK                                 #  SWITCH BANKS, SAVING RETURN.
040730,000034:    5214           75337                           MASK     LOW10                                 #  GET SUB-ADDRESS OF CADR.
040731,000035:    5215           56002                           XCH      Q                                     #  A,L NOW CONTAINS DP RETURN.
040732,000036:    5216           52124                           DXCH     BUF2                                  #  RESTORING INPUTS IF THIS IS A BANKCALL.
040733,000037:    5217           50002                           INDEX    Q                                     
040734,000038:    5220           02000                           TC       10000                                 #  SETTING Q TO SWRETURN.
040735,000039: 
040736,000040:    5221           56124        SWRETURN           XCH      BUF2       +1                         #  COMES HERE TO RETURN TO CALLER. C(A,L)
040737,000041:    5222           56004                           XCH      FBANK                                 #  ARE PRESERVED FOR RETURN.
040738,000042:    5223           56124                           XCH      BUF2       +1                         
040739,000043:    5224           00123                           TC       BUF2                                  
040740,000044: 
040741,000045:                                                                                                  #           THE FOLLOWING ROUTINE CAN BE USED AS A UNILATERAL JUMP WITH C(A,L) PRESERVED AND THE CADR IMMEDIATELY
040742,000046:                                                                                                  #  FOLLOWING THE TC POSTJUMP INSTRUCTION.
040743,000047: 
040744,000048:    5225           56002        POSTJUMP           XCH      Q                                     #  SAVE INCOMING C(A).
040745,000049:    5226           50000                           INDEX    A                                     #  GET CADR.
040746,000050:    5227           30000                           CA       0                                     
040747,000051: 
040748,000052:                                                                                                  #           BANKJUMP IS THE SAME AS POSTJUMP, EXCEPT THAT THE CADR ARRIVES IN A.
040749,000053: 
040750,000054:    5230           54004        BANKJUMP           TS       FBANK                                 
040751,000055:    5231           75337                           MASK     LOW10                                 
040752,000056:    5232           56002                           XCH      Q                                     #  RESTORING INPUT C(A) IF THIS WAS A
040753,000057:    5233           50002        Q+10000            INDEX    Q                                     #  POSTJUMP.
040754,000058:    5234           12000        BNKJUP+4           TCF      10000                                 
040755,000059: 

Page 949

040757,000061:                                                                                                  #           THE FOLLOWING ROUTINE GETS THE RETURN CADR SAVED BY SWCALL OR BANKCALL AND LEAVES IT IN A.
040758,000062: 
040759,000063:    5235           35337        MAKECADR           CAF      LOW10                                 
040760,000064:    5236           70123                           MASK     BUF2                                  
040761,000065:    5237           60124                           AD       BUF2       +1                         
040762,000066:    5240           00002                           TC       Q                                     
040763,000067: 
040764,000068: 
040765,000069:                                                                                                  #           THE FOLLOWING ROUTINE OBTAINS THE ONE WORD AT THE ADDRESS ARRIVING IN A, AND LEAVES IT IN A.  ENTER
040766,000070:                                                                                                  #  WITH THE CADR IN A, AT DATACALL WITH JUNK IN L IF NOT SWITCHING SUPERBANKS, OTHERWISE AT SUPDACAL WITH SUPERBANK
040767,000071:                                                                                                  #  BITS IN BITS 7-5 IN L (BITS 15-8 AND 4-1 MAY BE JUNK).  DEBRIS = MTEMP.  INHINTS FOR ABOUT 165 MUSEC.
040768,000072: 
040769,000073:    5241           54001        DATACALL           TS       L                                     #  SAVE CADR (SOLE INPUT HERE).
040770,000074:    5242           00006                           EXTEND                                         
040771,000075:    5243           00007                           READ     SUPERBNK                              #  THIS PROLOGUE MAKES SUPERSWITCH VACUOUS.
040772,000076:    5244           56001                           XCH      L                                     #  CADR IN A, SUPERBITS IN L.
040773,000077: 
040774,000078:    5245           54125        SUPDACAL           TS       MPTEMP                                
040775,000079:    5246           56004                           XCH      FBANK                                 #  SET FBANK FOR DATA.
040776,000080:    5247           00006                           EXTEND                                         
040777,000081:    5250           04007                           ROR      SUPERBNK                              #  SAVE FBANK IN BITS 15-11, AND
040778,000082:    5251           56125                           XCH      MPTEMP                                #   SUPERBANK IN BITS  7-5.
040779,000083:    5252           75337                           MASK     LOW10                                 
040780,000084:    5253           56001                           XCH      L                                     #  SAVE REL. ADR. IN BANK, FETCH SUPERBITS.
040781,000085:    5254           00004                           INHINT                                         #  BECAUSE RUPT DOES NOT SAVE SUPERBANK.
040782,000086:    5255           00006                           EXTEND                                         
040783,000087:    5256           01007                           WRITE    SUPERBNK                              #  SET SUPERBANK FOR DATA.
040784,000088:    5257           50001                           INDEX    L                                     
040785,000089:    5260           32000                           CA       10000                                 
040786,000090: 
040787,000091:    5261           56125                           XCH      MPTEMP                                #  SAVE 1ST WD, FETCH OLD FBANK AND SBANK.
040788,000092:    5262           00006                           EXTEND                                         
040789,000093:    5263           01007                           WRITE    SUPERBNK                              #  RESTORE SUPERBANK.
040790,000094:    5264           00003                           RELINT                                         
040791,000095:    5265           54004                           TS       FBANK                                 #  RESTORE FBANK.
040792,000096:    5266           30125                           CA       MPTEMP                                #  RECOVER FIRST WORD OF DATA.
040793,000097:    5267           00002                           RETURN                                         #  24 WDS. DATACALL 516 MU, SUPDACAL 432 MU
040794,000098: 

Page 950

040796,000100:                                                                                                  #           THE FOLLOWING ROUTINES ARE IDENTICAL TO BANKCALL AND SWCALL EXCEPT THAT THEY ARE USED IN INTERRUPT.
040797,000101: 
040798,000102:    5270           52073        IBNKCALL           DXCH     RUPTREG3                              #  USES RUPTREG3,4 FOR DP RETURN ADDRESS.
040799,000103:    5271           50002                           INDEX    Q                                     
040800,000104:    5272           30000                           CAF      0                                     
040801,000105:    5273           24002                           INCR     Q                                     
040802,000106: 
040803,000107:    5274           54001        ISWCALL            TS       L                                     
040804,000108:    5275           22004                           LXCH     FBANK                                 
040805,000109:    5276           75337                           MASK     LOW10                                 
040806,000110:    5277           56002                           XCH      Q                                     
040807,000111:    5300           52073                           DXCH     RUPTREG3                              
040808,000112:    5301           50002                           INDEX    Q                                     
040809,000113:    5302           02000                           TC       10000                                 
040810,000114: 
040811,000115:    5303           56073        ISWRETRN           XCH      RUPTREG4                              
040812,000116:    5304           56004                           XCH      FBANK                                 
040813,000117:    5305           56073                           XCH      RUPTREG4                              
040814,000118:    5306           00072                           TC       RUPTREG3                              
040815,000119: 

Page 951

040817,000121:                                                                                                  #           THE FOLLOWING SUBROUTINES PROVIDE TO THE BASIC PROGRAMMER ENTRY INTO AND RETURN FROM ANY INTERPRETIVE
040818,000122:                                                                                                  #  CODING WHICH DOES NOT USE THE ENTERING CONTENTS OF Q AND WHICH RETURNS VIA DANZIG. C(A) AND C(L) ARE SAVED.
040819,000123: 
040820,000124:                                                                                                  #  USER'S RESPONSIBILITY TO FILL IN ADVANCE THE APPROPRIATE OPERAND AND ADDRESS REGISTERS USED BY THE
040821,000125:                                                                                                  #  INTERPRETIVE CODING SUCH AS MPAC, BUF, ADDRWD, ETC.; AND TO CONFIRM THAT THE INTERPRETIVE CODING MEETS THE
040822,000126:                                                                                                  #  ABOVE RESTRICTIONS WITH RESPECT TO Q AND DANZIG.
040823,000127: 
040824,000128:                                                                                                  #  USEPRET AND USPRCADR MUST NOT BE USED IN INTERRUPT.
040825,000129: 
040826,000130:                                                                                                  #  1. USEPRET ACCESSES INTERPRETIVE CODING WHICH CAN BE ENTERED WITHOUT CHANGING FBANK.
040827,000131:                                                                                                  #     THE CALLING SEQUENCE IS AS FOLLOWS:
040828,000132: 
040829,000133:                                                                                                  #                                          L         TC     USEPRET
040830,000134:                                                                                                  #                                          L+1       TC,TCF INTPRETX       TC,TCF MEANS TC OR TCF
040831,000135:                                                                                                  #                                                                          INTPRETX IS THE INTERPRETIVE CODING
040832,000136:                                                                                                  #                                                                          RETURN IS TO L+2
040833,000137: 
040834,000138:                                                                                                  #  2. USPRCADR ACCESSES INTERPRETIVE CODING IN OTHER THAN THE USER'S FBANK. THE CALLING SEQUENCE IS AS FOLLOWS:
040835,000139: 
040836,000140:                                                                                                  #                                          L         TC     USPRCADR
040837,000141:                                                                                                  #                                          L+1       CADR   INTPRETX       INTPRETX IS THE INTERPRETIVE CODING
040838,000142:                                                                                                  #                                                                          RETURN IS TO L+2
040839,000143: 
040840,000144:    5307           56002        USEPRET            XCH      Q                                     #  FETCH Q, SAVING A
040841,000145:    5310           54154                           TS       LOC                                   #  L+1 TO LOC
040842,000146:    5311           30006                           CA       BBANK                                 
040843,000147:    5312           54155                           TS       BANKSET                               #  USER'S BBANK TO BANKSET
040844,000148:    5313           37754                           CA       BIT8                                  
040845,000149:    5314           54023                           TS       EDOP                                  #  EXIT INSTRUCTION TO EDOP
040846,000150:    5315           30002                           CA       Q                                     #  RETRIEVE ORIGINAL A
040847,000151:    5316           00154                           TC       LOC                                   
040848,000152: 
040849,000153:    5317           54154        USPRCADR           TS       LOC                                   #  SAVE A
040850,000154:    5320           37754                           CA       BIT8                                  
040851,000155:    5321           54023                           TS       EDOP                                  #  EXIT INSTRUCTION TO EDOP
040852,000156:    5322           30006                           CA       BBANK                                 
040853,000157:    5323           54155                           TS       BANKSET                               #  USER'S BBANK TO BANKSET
040854,000158:    5324           50002                           INDEX    Q                                     
040855,000159:    5325           30000                           CA       0                                     
040856,000160:    5326           54004                           TS       FBANK                                 #  INTERPRETIVE BANK TO FBANK
040857,000161:    5327           75337                           MASK     LOW10                                 #  YIELDS INTERPRETIVE RELATIVE ADDRESS
040858,000162:    5330           56002                           XCH      Q                                     #  INTERPRETIVE ADDRESS TO Q, FETCHING L+1
040859,000163:    5331           56154                           XCH      LOC                                   #  L+1 TO LOC, RETRIEVING ORIGINAL A
040860,000164:    5332           15233                           TCF      Q+10000                               
040861,000165: 

Page 952

040863,000167:                                                                                                  #  THERE ARE FOUR POSSIBLE SETTINGS FOR CHANNEL 07. (CHANNEL 07 CONTAINS THE SUPERBANK SETTING.)
040864,000168:                                                                                                  #                                            PSEUDO-FIXED     OCTAL PSEUDO
040865,000169:                                                                                                  #  SUPERBANK     SETTING     S-REG. VALUE    BANK NUMBERS     ADDRESSES
040866,000170:                                                                                                  #  ---------     -------     ------------     ------------     ------------
040867,000171: 
040868,000172:                                                                                                  #  SUPERBANK 3     0XX       2000 - 3777        30 - 37       70000 - 107777   (WHERE XX CAN BE ANYTHING AND
040869,000173:                                                                                                  #                                                                              WILL USUALLY BE SEEN AS 11)
040870,000174:                                                                                                  #  SUPERBANK 4     100       2000 - 3777        40 - 47       110000 - 127777  (AS FAR AS IT CAN BE SEEN,
040871,000175:                                                                                                  #                                                                              ONLY BANKS 40-43 WILL EVER BE
040872,000176:                                                                                                  #                                                                              AND ARE PRESENTLY AVAILABLE)
040873,000177:                                                                                                  #  SUPERBANK 5     101       2000 - 3777        50 - 57       130000 - 147777  (PRESENTLY NOT AVAILABLE TO
040874,000178:                                                                                                  #                                                                              THE USER)
040875,000179:                                                                                                  #  SUPERBANK 6     110       2000 - 3777        60 - 67       150000 - 167777  (PRESENTLY NOT AVAILABLE TO
040876,000180:                                                                                                  #                                                                              THE USER)
040877,000181:                                                                                                  #  ***  THIS ROUTINE MAYBE CALLED BY ANY PROGRAM LOCATED IN BANKS 00 - 27.  I.E., NO PROGRAM LIVING IN ANY
040878,000182:                                                                                                  #  SUPERBANK SHOULD USE SUPERSW. ***
040879,000183: 
040880,000184:                                                                                                  #  SUPERSW MAY BE CALLED IN THIS FASHION:
040881,000185: 
040882,000186:                                                                                                  #           CAF     ABBCON          WHERE  --  ABBCON   BBCON  SOMETHIN  --
040883,000187:                                                                                                  #           TCR     SUPERSW         (THE SUPERBNK BITS ARE IN THE BBCON)
040884,000188:                                                                                                  #           ...       ...
040885,000189:                                                                                                  #            .         .
040886,000190:                                                                                                  #            .         .
040887,000191: 
040888,000192:                                                                                                  #  OR IN THIS FASHION:
040889,000193: 
040890,000194:                                                                                                  #           CAF     SUPERSET        WHERE SUPERSET IS ONE OF THE FOUR AVAILABLE
040891,000195:                                                                                                  #           TCR     SUPERSW         SUPERBANK BIT CONSTANTS:
040892,000196:                                                                                                  #           ...       ...                                   SUPER011 OCTAL  60
040893,000197:                                                                                                  #            .         .                                    SUPER100 OCTAL 100
040894,000198:                                                                                                  #            .         .                                    SUPER101 OCTAL 120
040895,000199:                                                                                                  #                                                           SUPER110 OCTAL 140
040896,000200: 
040897,000201:    5333           00006        SUPERSW            EXTEND                                         
040898,000202:    5334           01007                           WRITE    SUPERBNK                              #  WRITE BITS 7-6-5 OF THE ACCUMULATOR INTO
040899,000203:                                                                                                  #  CHANNEL 07
040900,000204:    5335           00002                           TC       Q                                     #  TC TO INSTRUCTION FOLLOWING
040901,000205:                                                                                                  #    TC  SUPERSW
040902,000206: 

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