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 Luminary 131 (Apollo 13) 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 001 OF AGC PROGRAM LMY99 BY NASA 2021112-061
	16:27 JULY 14,1969
Note that the date is the date of the printout, not the date of the program revision.

043541,000002:                                                                                                  ## Copyright:   Public domain.
043542,000003:                                                                                                  ## Filename:    INTER-BANK_COMMUNICATION.agc
043543,000004:                                                                                                  ## Purpose:     Part of the source code for Luminary 1A build 099.
043544,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
043545,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for Apollo 11.
043546,000007:                                                                                                  ## Assembler:   yaYUL
043547,000008:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
043548,000009:                                                                                                  ## Website:     www.ibiblio.org/apollo.
043549,000010:                                                                                                  ## Pages:       998-1001
043550,000011:                                                                                                  ## Mod history: 2009-05-24 RSB  Adapted from the corresponding 
043551,000012:                                                                                                  ##                              Luminary131 file, using page 
043552,000013:                                                                                                  ##                              images from Luminary 1A.
043553,000014:                                                                                                  ##              2011-05-08 JL   Removed workaround.
043554,000015:                                                                                                  ##              2016-12-17 RSB  Proofed text comments with octopus/ProoferComments
043555,000016:                                                                                                  ##                              and corrected the errors found.
043556,000017:                                                                                                  ##              2017-03-13 RSB  Comment-text fixes noted in proofing Luminary 116.
043557,000018:                                                                                                  ##              2017-03-17 RSB  Comment-text fixes identified in diff'ing
043558,000019:                                                                                                  ##                              Luminary 99 vs Comanche 55.
043559,000020:                                                                                                  ##              2021-05-30 ABS  ISWCALLL -> ISWCALL
043560,000021: 
043561,000022:                                                                                                  ## This source code has been transcribed or otherwise adapted from
043562,000023:                                                                                                  ## digitized images of a hardcopy from the MIT Museum.  The digitization
043563,000024:                                                                                                  ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
043564,000025:                                                                                                  ## the Museum.  Many thanks to both.  The images (with suitable reduction
043565,000026:                                                                                                  ## in storage size and consequent reduction in image quality as well) are
043566,000027:                                                                                                  ## available online at www.ibiblio.org/apollo.  If for some reason you
043567,000028:                                                                                                  ## find that the images are illegible, contact me at info@sandroid.org
043568,000029:                                                                                                  ## about getting access to the (much) higher-quality images which Paul
043569,000030:                                                                                                  ## actually created.
043570,000031:                                                                                                  ##
043571,000032:                                                                                                  ## Notations on the hardcopy document read, in part:
043572,000033:                                                                                                  ##
043573,000034:                                                                                                  ##      Assemble revision 001 of AGC program LMY99 by NASA 2021112-61
043574,000035:                                                                                                  ##      16:27 JULY 14, 1969 
043575,000036: 

Page 998

043577,000038:                                                                                                  #  THE FOLLOWING ROUTINE CAN BE USED TO CALL A SUBROUTINE IN ANOTHER BANK. IN THE BANKCALL VERSION, THE
043578,000039:                                                                                                  #  CADR OF THE SUBROUTINE IMMEDIATELY FOLLOWS THE TC BANKCALL INSTRUCTION, WITH C(A) AND C(L) PRESERVED.
043579,000040: 
043580,000041:    4616                                           BLOCK    02                                    
043581,000042:    4616                                           COUNT*   $$/BANK                               
043582,000043:    4616           52134        BANKCALL           DXCH     BUF2                                  #  SAVE INCOMING A,L.
043583,000044:    4617           50002                           INDEX    Q                                     #  PICK UP CADR.
043584,000045:    4620           30000                           CA       0                                     
043585,000046:    4621           24002                           INCR     Q                                     #  SO WE RETURN TO THE LOC. AFTER THE CADR.
043586,000047: 
043587,000048:                                                                                                  #  SWCALL IS  IDENTICAL TO BANKCALL, EXCEPT THAT THE CADR ARRIVES IN A.
043588,000049: 
043589,000050:    4622           54001        SWCALL             TS       L                                     
043590,000051:    4623           22004                           LXCH     FBANK                                 #  SWITCH BANKS, SAVING RETURN.
043591,000052:    4624           75012                           MASK     LOW10                                 #  GET SUB-ADDRESS OF CADR.
043592,000053:    4625           56002                           XCH      Q                                     #  A,L NOW CONTAINS DP RETURN.
043593,000054:    4626           52134                           DXCH     BUF2                                  #  RESTORING INPUTS IF THIS IS A BANKCALL.
043594,000055:    4627           50002                           INDEX    Q                                     
043595,000056:    4630           02000                           TC       10000                                 #  SETTING Q TO SWRETURN.
043596,000057: 
043597,000058:    4631           56134        SWRETURN           XCH      BUF2       +1                         #  COMES HERE TO RETURN TO CALLER. C(A,L)
043598,000059:    4632           56004                           XCH      FBANK                                 #  ARE PRESERVED FOR RETURN.
043599,000060:    4633           56134                           XCH      BUF2       +1                         
043600,000061:    4634           00133                           TC       BUF2                                  
043601,000062: 
043602,000063:                                                                                                  #  THE FOLLOWING ROUTINE CAN BE USED AS A UNILATERAL JUMP WITH C(A,L) PRESERVED AND THE CADR IMMEDIATELY
043603,000064:                                                                                                  #  FOLLOWING THE TC POSTJUMP INSTRUCTION.
043604,000065: 
043605,000066:    4635           56002        POSTJUMP           XCH      Q                                     #  SAVE INCOMING C(A).
043606,000067:    4636           50000                           INDEX    A                                     #  GET CADR.
043607,000068:    4637           30000                           CA       0                                     
043608,000069: 
043609,000070:                                                                                                  #  BANKJUMP IS THE SAME AS POSTJUMP, EXCEPT THAT THE CADR ARRIVES IN A.
043610,000071: 
043611,000072:    4640           54004        BANKJUMP           TS       FBANK                                 
043612,000073:    4641           75012                           MASK     LOW10                                 
043613,000074:    4642           56002                           XCH      Q                                     #  RESTORING INPUT C(A) IF THIS WAS A
043614,000075:    4643           50002        Q+10000            INDEX    Q                                     #  POSTJUMP.
043615,000076:    4644           12000        PRIO12             TCF      10000                                 #  PRIO12 = TCF  10000 = 12000
043616,000077: 

Page 999

043618,000079:                                                                                                  #  THE FOLLOWING ROUTINE GETS THE RETURN CADR SAVED BY SWCALL OR BANKCALL AND LEAVES IT IN A.
043619,000080: 
043620,000081:    4645           35012        MAKECADR           CAF      LOW10                                 
043621,000082:    4646           70133                           MASK     BUF2                                  
043622,000083:    4647           60134                           AD       BUF2       +1                         
043623,000084:    4650           00002                           TC       Q                                     
043624,000085: 
043625,000086:    4651           54135        SUPDACAL           TS       MPTEMP                                
043626,000087:    4652           56004                           XCH      FBANK                                 #  SET FBANK FOR DATA.
043627,000088:    4653           00006                           EXTEND                                         
043628,000089:    4654           04007                           ROR      SUPERBNK                              #  SAVE FBANK IN BITS 15-11, AND
043629,000090:    4655           56135                           XCH      MPTEMP                                #  SUPERBANK IN BITS 7-5.
043630,000091:    4656           75012                           MASK     LOW10                                 
043631,000092:    4657           56001                           XCH      L                                     #  SAVE REL. ADR. IN BANK, FETCH SUPERBITS.
043632,000093:    4660           00004                           INHINT                                         #  BECAUSE RUPT DOES NOT SAVE SUPERBANK.
043633,000094:    4661           00006                           EXTEND                                         
043634,000095:    4662           01007                           WRITE    SUPERBNK                              #  SET SUPERBANK FOR DATA.
043635,000096:    4663           50001                           INDEX    L                                     
043636,000097:    4664           32000                           CA       10000                                 #  PINBALL (FIX MEM DISP) PREVENTS DCA HERE
043637,000098:    4665           56135                           XCH      MPTEMP                                #  SAVE 1ST WD, FETCH OLD FBANK AND SBANK.
043638,000099:    4666           00006                           EXTEND                                         
043639,000100:    4667           01007                           WRITE    SUPERBNK                              #  RESTORE SUPERBANK.
043640,000101:    4670           00003                           RELINT                                         
043641,000102:    4671           54004                           TS       FBANK                                 #  RESTORE FBANK.
043642,000103:    4672           30135                           CA       MPTEMP                                #  RECOVER FIRST WORD OF DATA.
043643,000104:    4673           00002                           RETURN                                         #  24 WDS. DATACALL 516 MU, SUPDACAL 432 MU
043644,000105: 

Page 1000

043646,000107:                                                                                                  #  THE FOLLOWING ROUTINES ARE IDENTICAL TO BANKCALL AND SWCALL EXCEPT THAT THEY ARE USED IN INTERRUPT.
043647,000108: 
043648,000109:    4674           52073        IBNKCALL           DXCH     RUPTREG3                              #  USES RUPTREG3,4 FOR DP RETURN ADDRESS.
043649,000110:    4675           50002                           INDEX    Q                                     
043650,000111:    4676           30000                           CAF      0                                     
043651,000112:    4677           24002                           INCR     Q                                     
043652,000113: 
043653,000114:    4700           54001        ISWCALL            TS       L                                     
043654,000115:    4701           22004                           LXCH     FBANK                                 
043655,000116:    4702           75012                           MASK     LOW10                                 
043656,000117:    4703           56002                           XCH      Q                                     
043657,000118:    4704           52073                           DXCH     RUPTREG3                              
043658,000119:    4705           50002                           INDEX    Q                                     
043659,000120:    4706           02000                           TC       10000                                 
043660,000121: 
043661,000122:    4707           56073        ISWRETRN           XCH      RUPTREG4                              
043662,000123:    4710           56004                           XCH      FBANK                                 
043663,000124:    4711           56073                           XCH      RUPTREG4                              
043664,000125:    4712           00072                           TC       RUPTREG3                              
043665,000126: 
043666,000127:                                                                                                  #  2. USPRCADR ACCESSES INTERPRETIVE CODING IN OTHER THAN THE USER'S FBANK.  THE CALLING SEQUENCE IS AS FOLLOWS:
043667,000128:                                                                                                  #        L       TC      USPRCADR
043668,000129:                                                                                                  #        L+1     CADR    INTPRETX        INTPRETX IS THE INTERPRETIVE CODING
043669,000130:                                                                                                  #                                        RETURN IS TO L+2
043670,000131: 
043671,000132:    4713           54164        USPRCADR           TS       LOC                                   #  SAVE A
043672,000133:    4714           34744                           CA       BIT8                                  
043673,000134:    4715           54023                           TS       EDOP                                  #  EXIT INSTRUCTION TO EDOP
043674,000135:    4716           30006                           CA       BBANK                                 
043675,000136:    4717           54165                           TS       BANKSET                               #  USER'S BBANK TO BANKSET
043676,000137:    4720           50002                           INDEX    Q                                     
043677,000138:    4721           30000                           CA       0                                     
043678,000139:    4722           54004                           TS       FBANK                                 #  INTERPRETIVE BANK TO FBANK
043679,000140:    4723           75012                           MASK     LOW10                                 #  YIELDS INTERPRETIVE RELATIVE ADDRESS
043680,000141:    4724           56002                           XCH      Q                                     #  INTERPRETIVE ADDRESS TO Q, FETCHING L+1
043681,000142:    4725           56164                           XCH      LOC                                   #  L+1 TO LOC, RETRIEVING ORIGINAL A
043682,000143:    4726           14643                           TCF      Q+10000                               
043683,000144: 

Page 1001

043685,000146:                                                                                                  #  THERE ARE FOUR POSSIBLE SETTINGS FOR CHANNEL 07.  (CHANNEL 07 CONTAINS THE SUPERBANK SETTING.)
043686,000147: 
043687,000148:                                                                                                  #                                        PSEUDO-FIXED      OCTAL PSEUDO
043688,000149:                                                                                                  #  SUPERBANK     SETTING S-REG. VALUE    BANK NUMBERS      ADDRESSES
043689,000150:                                                                                                  #  ----------    ------- ------------     ------------      ------------
043690,000151:                                                                                                  #  SUPERBANK 3     0XX    2000 - 3777       30 - 37       70000 - 107777         (WHERE XX CAN BE ANYTHING AND
043691,000152:                                                                                                  #                                                                                WILL USUALLY BE SEEN AS 11)
043692,000153:                                                                                                  #  SUPERBANK 4     100    2000 - 3777       40 - 47      110000 - 127777         (AS FAR AS IT CAN BE SEEN,
043693,000154:                                                                                                  #                                                                                ONLY BANKS 40-43 WILL EVER BE
043694,000155:                                                                                                  #                                                                                AND ARE PRESENTLY AVAILABLE)
043695,000156:                                                                                                  #  SUPERBANK 5     101    2000 - 3777       50 - 57      130000 - 147777         (PRESENTLY NOT AVAILABLE TO
043696,000157:                                                                                                  #                                                                                THE USER)
043697,000158:                                                                                                  #  SUPERBANK 6     110    2000 - 3777       60 - 67      150000 - 167777         (PRESENTLY NOT AVAILABLE TO
043698,000159:                                                                                                  #                                                                                THE USER)
043699,000160:                                                                                                  #  *** THIS ROUTINE MAY BE CALLED BY ANY PROGRAM LOCATED IN BANKS 00 - 27.  I.E., NO PROGRAM LIVING IN ANY
043700,000161:                                                                                                  #  SUPERBANK SHOULD USE SUPERSW. ***
043701,000162: 
043702,000163:                                                                                                  #  SUPERSW MAY BE CALLED IN THIS FASHION:
043703,000164:                                                                                                  #        CAF     ABBCON          WHERE  --  ABBCON   BBCON  SOMETHIN -- 
043704,000165:                                                                                                  #        TCR     SUPERSW         (THE SUPERBNK BITS ARE IN THE BBCON)
043705,000166:                                                                                                  #        ...       ...
043706,000167:                                                                                                  #         .         .
043707,000168:                                                                                                  #         .         .
043708,000169:                                                                                                  #  OR IN THIS FASHION:
043709,000170:                                                                                                  #        CAF     SUPERSET        WHERE SUPERSET IS ONE OF THE FOUR AVAILABLE
043710,000171:                                                                                                  #        TCR     SUPERSW         SUPERBANK BIT CONSTANTS:
043711,000172:                                                                                                  #        ...       ...                                   SUPER011 OCTAL  60
043712,000173:                                                                                                  #         .         .                                    SUPER100 OCTAL 100
043713,000174:                                                                                                  #         .         .                                    SUPER101 OCTAL 120
043714,000175:                                                                                                  #                                                        SUPER110 OCTAL 140
043715,000176: 
043716,000177:    4727           00006        SUPERSW            EXTEND                                         
043717,000178:    4730           01007                           WRITE    SUPERBNK                              #  WRITE BITS 7-6-5 OF THE ACCUMULATOR INTO
043718,000179:                                                                                                  #  CHANNEL 07
043719,000180:    4731           00002                           TC       Q                                     #  TC TO INSTRUCTION FOLLOWING
043720,000181:                                                                                                  #        TC SUPERSW
043721,000182: 

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