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
	20'35 OCT. 28,1968
Note that the date is the date of the printout, not the date of the program revision.

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

Page 998

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

Page 999

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

Page 1000

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

Page 1001

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

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