Source Code

These source-code files are part of a reconstructed copy of Luminary 98, a development version of the Apollo 11 Lunar Module (LM) Apollo Guidance Computer (AGC) software.

The reconstruction began with source code of Luminary 99 revision 1 previously transcribed from a digitized copy of that program. The code was then updated by undoing changes described in original Luminary memo 85, using asterisks indicating changed lines in the listing as a guide. While no listing of this version is known to exist, nor are the memory-bank checksums available, the reconstruction is believed to be correct because it was an an intermediate step in reconstructing Luminary 97 whose reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152G. Note that page numbers in the reconstructed code match those on the Luminary 099 revision 001 printout, although the added code would likely have changed page numbers for a real Luminary 98 listing.

Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository.

042510,000002:                                                                                                  ## Copyright:   Public domain.
042511,000003:                                                                                                  ## Filename:    INTER-BANK_COMMUNICATION.agc
042512,000004:                                                                                                  ## Purpose:     A section of Luminary revision 98.
042513,000005:                                                                                                  ##              It is part of the reconstructed source code for the a
042514,000006:                                                                                                  ##              development version of the flight software for the Lunar 
042515,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 11.
042516,000008:                                                                                                  ##              The code has been recreated from a copy of Luminary 99
042517,000009:                                                                                                  ##              revision 001, using asterisks indicating changed lines in
042518,000010:                                                                                                  ##              the listing and Luminary Memo #85, which lists changes between
042519,000011:                                                                                                  ##              Luminary 98 and 99.
042520,000012:                                                                                                  ## Reference:   pp. 998-1001
042521,000013:                                                                                                  ## Assembler:   yaYUL
042522,000014:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
042523,000015:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
042524,000016:                                                                                                  ## Mod history: 2019-07-28 MAS  Created from Luminary 99.
042525,000017:                                                                                                  ##              2021-05-30 ABS  ISWCALLL -> ISWCALL
042526,000018: 

Page 998

042528,000020:                                                                                                  #  THE FOLLOWING ROUTINE CAN BE USED TO CALL A SUBROUTINE IN ANOTHER BANK. IN THE BANKCALL VERSION, THE
042529,000021:                                                                                                  #  CADR OF THE SUBROUTINE IMMEDIATELY FOLLOWS THE TC BANKCALL INSTRUCTION, WITH C(A) AND C(L) PRESERVED.
042530,000022: 
042531,000023:    4616                                           BLOCK    02                                    
042532,000024:    4616                                           COUNT*   $$/BANK                               
042533,000025:    4616           52134        BANKCALL           DXCH     BUF2                                  #  SAVE INCOMING A,L.
042534,000026:    4617           50002                           INDEX    Q                                     #  PICK UP CADR.
042535,000027:    4620           30000                           CA       0                                     
042536,000028:    4621           24002                           INCR     Q                                     #  SO WE RETURN TO THE LOC. AFTER THE CADR.
042537,000029: 
042538,000030:                                                                                                  #  SWCALL IS  IDENTICAL TO BANKCALL, EXCEPT THAT THE CADR ARRIVES IN A.
042539,000031: 
042540,000032:    4622           54001        SWCALL             TS       L                                     
042541,000033:    4623           22004                           LXCH     FBANK                                 #  SWITCH BANKS, SAVING RETURN.
042542,000034:    4624           75012                           MASK     LOW10                                 #  GET SUB-ADDRESS OF CADR.
042543,000035:    4625           56002                           XCH      Q                                     #  A,L NOW CONTAINS DP RETURN.
042544,000036:    4626           52134                           DXCH     BUF2                                  #  RESTORING INPUTS IF THIS IS A BANKCALL.
042545,000037:    4627           50002                           INDEX    Q                                     
042546,000038:    4630           02000                           TC       10000                                 #  SETTING Q TO SWRETURN.
042547,000039: 
042548,000040:    4631           56134        SWRETURN           XCH      BUF2       +1                         #  COMES HERE TO RETURN TO CALLER. C(A,L)
042549,000041:    4632           56004                           XCH      FBANK                                 #  ARE PRESERVED FOR RETURN.
042550,000042:    4633           56134                           XCH      BUF2       +1                         
042551,000043:    4634           00133                           TC       BUF2                                  
042552,000044: 
042553,000045:                                                                                                  #  THE FOLLOWING ROUTINE CAN BE USED AS A UNILATERAL JUMP WITH C(A,L) PRESERVED AND THE CADR IMMEDIATELY
042554,000046:                                                                                                  #  FOLLOWING THE TC POSTJUMP INSTRUCTION.
042555,000047: 
042556,000048:    4635           56002        POSTJUMP           XCH      Q                                     #  SAVE INCOMING C(A).
042557,000049:    4636           50000                           INDEX    A                                     #  GET CADR.
042558,000050:    4637           30000                           CA       0                                     
042559,000051: 
042560,000052:                                                                                                  #  BANKJUMP IS THE SAME AS POSTJUMP, EXCEPT THAT THE CADR ARRIVES IN A.
042561,000053: 
042562,000054:    4640           54004        BANKJUMP           TS       FBANK                                 
042563,000055:    4641           75012                           MASK     LOW10                                 
042564,000056:    4642           56002                           XCH      Q                                     #  RESTORING INPUT C(A) IF THIS WAS A
042565,000057:    4643           50002        Q+10000            INDEX    Q                                     #  POSTJUMP.
042566,000058:    4644           12000        PRIO12             TCF      10000                                 #  PRIO12 = TCF  10000 = 12000
042567,000059: 

Page 999

042569,000061:                                                                                                  #  THE FOLLOWING ROUTINE GETS THE RETURN CADR SAVED BY SWCALL OR BANKCALL AND LEAVES IT IN A.
042570,000062: 
042571,000063:    4645           35012        MAKECADR           CAF      LOW10                                 
042572,000064:    4646           70133                           MASK     BUF2                                  
042573,000065:    4647           60134                           AD       BUF2       +1                         
042574,000066:    4650           00002                           TC       Q                                     
042575,000067: 
042576,000068:    4651           54135        SUPDACAL           TS       MPTEMP                                
042577,000069:    4652           56004                           XCH      FBANK                                 #  SET FBANK FOR DATA.
042578,000070:    4653           00006                           EXTEND                                         
042579,000071:    4654           04007                           ROR      SUPERBNK                              #  SAVE FBANK IN BITS 15-11, AND
042580,000072:    4655           56135                           XCH      MPTEMP                                #  SUPERBANK IN BITS 7-5.
042581,000073:    4656           75012                           MASK     LOW10                                 
042582,000074:    4657           56001                           XCH      L                                     #  SAVE REL. ADR. IN BANK, FETCH SUPERBITS.
042583,000075:    4660           00004                           INHINT                                         #  BECAUSE RUPT DOES NOT SAVE SUPERBANK.
042584,000076:    4661           00006                           EXTEND                                         
042585,000077:    4662           01007                           WRITE    SUPERBNK                              #  SET SUPERBANK FOR DATA.
042586,000078:    4663           50001                           INDEX    L                                     
042587,000079:    4664           32000                           CA       10000                                 #  PINBALL (FIX MEM DISP) PREVENTS DCA HERE
042588,000080:    4665           56135                           XCH      MPTEMP                                #  SAVE 1ST WD, FETCH OLD FBANK AND SBANK.
042589,000081:    4666           00006                           EXTEND                                         
042590,000082:    4667           01007                           WRITE    SUPERBNK                              #  RESTORE SUPERBANK.
042591,000083:    4670           00003                           RELINT                                         
042592,000084:    4671           54004                           TS       FBANK                                 #  RESTORE FBANK.
042593,000085:    4672           30135                           CA       MPTEMP                                #  RECOVER FIRST WORD OF DATA.
042594,000086:    4673           00002                           RETURN                                         #  24 WDS. DATACALL 516 MU, SUPDACAL 432 MU
042595,000087: 

Page 1000

042597,000089:                                                                                                  #  THE FOLLOWING ROUTINES ARE IDENTICAL TO BANKCALL AND SWCALL EXCEPT THAT THEY ARE USED IN INTERRUPT.
042598,000090: 
042599,000091:    4674           52073        IBNKCALL           DXCH     RUPTREG3                              #  USES RUPTREG3,4 FOR DP RETURN ADDRESS.
042600,000092:    4675           50002                           INDEX    Q                                     
042601,000093:    4676           30000                           CAF      0                                     
042602,000094:    4677           24002                           INCR     Q                                     
042603,000095: 
042604,000096:    4700           54001        ISWCALL            TS       L                                     
042605,000097:    4701           22004                           LXCH     FBANK                                 
042606,000098:    4702           75012                           MASK     LOW10                                 
042607,000099:    4703           56002                           XCH      Q                                     
042608,000100:    4704           52073                           DXCH     RUPTREG3                              
042609,000101:    4705           50002                           INDEX    Q                                     
042610,000102:    4706           02000                           TC       10000                                 
042611,000103: 
042612,000104:    4707           56073        ISWRETRN           XCH      RUPTREG4                              
042613,000105:    4710           56004                           XCH      FBANK                                 
042614,000106:    4711           56073                           XCH      RUPTREG4                              
042615,000107:    4712           00072                           TC       RUPTREG3                              
042616,000108: 
042617,000109:                                                                                                  #  2. USPRCADR ACCESSES INTERPRETIVE CODING IN OTHER THAN THE USER'S FBANK.  THE CALLING SEQUENCE IS AS FOLLOWS:
042618,000110:                                                                                                  #        L       TC      USPRCADR
042619,000111:                                                                                                  #        L+1     CADR    INTPRETX        INTPRETX IS THE INTERPRETIVE CODING
042620,000112:                                                                                                  #                                        RETURN IS TO L+2
042621,000113: 
042622,000114:    4713           54164        USPRCADR           TS       LOC                                   #  SAVE A
042623,000115:    4714           34744                           CA       BIT8                                  
042624,000116:    4715           54023                           TS       EDOP                                  #  EXIT INSTRUCTION TO EDOP
042625,000117:    4716           30006                           CA       BBANK                                 
042626,000118:    4717           54165                           TS       BANKSET                               #  USER'S BBANK TO BANKSET
042627,000119:    4720           50002                           INDEX    Q                                     
042628,000120:    4721           30000                           CA       0                                     
042629,000121:    4722           54004                           TS       FBANK                                 #  INTERPRETIVE BANK TO FBANK
042630,000122:    4723           75012                           MASK     LOW10                                 #  YIELDS INTERPRETIVE RELATIVE ADDRESS
042631,000123:    4724           56002                           XCH      Q                                     #  INTERPRETIVE ADDRESS TO Q, FETCHING L+1
042632,000124:    4725           56164                           XCH      LOC                                   #  L+1 TO LOC, RETRIEVING ORIGINAL A
042633,000125:    4726           14643                           TCF      Q+10000                               
042634,000126: 

Page 1001

042636,000128:                                                                                                  #  THERE ARE FOUR POSSIBLE SETTINGS FOR CHANNEL 07.  (CHANNEL 07 CONTAINS THE SUPERBANK SETTING.)
042637,000129: 
042638,000130:                                                                                                  #                                        PSEUDO-FIXED      OCTAL PSEUDO
042639,000131:                                                                                                  #  SUPERBANK     SETTING S-REG. VALUE    BANK NUMBERS      ADDRESSES
042640,000132:                                                                                                  #  ----------    ------- ------------     ------------      ------------
042641,000133:                                                                                                  #  SUPERBANK 3     0XX    2000 - 3777       30 - 37       70000 - 107777         (WHERE XX CAN BE ANYTHING AND
042642,000134:                                                                                                  #                                                                                WILL USUALLY BE SEEN AS 11)
042643,000135:                                                                                                  #  SUPERBANK 4     100    2000 - 3777       40 - 47      110000 - 127777         (AS FAR AS IT CAN BE SEEN,
042644,000136:                                                                                                  #                                                                                ONLY BANKS 40-43 WILL EVER BE
042645,000137:                                                                                                  #                                                                                AND ARE PRESENTLY AVAILABLE)
042646,000138:                                                                                                  #  SUPERBANK 5     101    2000 - 3777       50 - 57      130000 - 147777         (PRESENTLY NOT AVAILABLE TO
042647,000139:                                                                                                  #                                                                                THE USER)
042648,000140:                                                                                                  #  SUPERBANK 6     110    2000 - 3777       60 - 67      150000 - 167777         (PRESENTLY NOT AVAILABLE TO
042649,000141:                                                                                                  #                                                                                THE USER)
042650,000142:                                                                                                  #  *** THIS ROUTINE MAY BE CALLED BY ANY PROGRAM LOCATED IN BANKS 00 - 27.  I.E., NO PROGRAM LIVING IN ANY
042651,000143:                                                                                                  #  SUPERBANK SHOULD USE SUPERSW. ***
042652,000144: 
042653,000145:                                                                                                  #  SUPERSW MAY BE CALLED IN THIS FASHION:
042654,000146:                                                                                                  #        CAF     ABBCON          WHERE  --  ABBCON   BBCON  SOMETHIN -- 
042655,000147:                                                                                                  #        TCR     SUPERSW         (THE SUPERBNK BITS ARE IN THE BBCON)
042656,000148:                                                                                                  #        ...       ...
042657,000149:                                                                                                  #         .         .
042658,000150:                                                                                                  #         .         .
042659,000151:                                                                                                  #  OR IN THIS FASHION:
042660,000152:                                                                                                  #        CAF     SUPERSET        WHERE SUPERSET IS ONE OF THE FOUR AVAILABLE
042661,000153:                                                                                                  #        TCR     SUPERSW         SUPERBANK BIT CONSTANTS:
042662,000154:                                                                                                  #        ...       ...                                   SUPER011 OCTAL  60
042663,000155:                                                                                                  #         .         .                                    SUPER100 OCTAL 100
042664,000156:                                                                                                  #         .         .                                    SUPER101 OCTAL 120
042665,000157:                                                                                                  #                                                        SUPER110 OCTAL 140
042666,000158: 
042667,000159:    4727           00006        SUPERSW            EXTEND                                         
042668,000160:    4730           01007                           WRITE    SUPERBNK                              #  WRITE BITS 7-6-5 OF THE ACCUMULATOR INTO
042669,000161:                                                                                                  #  CHANNEL 07
042670,000162:    4731           00002                           TC       Q                                     #  TC TO INSTRUCTION FOLLOWING
042671,000163:                                                                                                  #        TC SUPERSW
042672,000164: 

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