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.

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

Page 998

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

Page 999

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

Page 1000

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

Page 1001

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

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