Source Code

These source-code files are part of a reconstructed copy of Luminary 97, the second release of the Apollo 11 Lunar Module (LM) Apollo Guidance Computer (AGC) software. It was created to fix two incorrect ephemeris constants in Luminary 96, as described by anomaly report LNY-59.

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 memos 83 and 85, using asterisks indicating changed lines in the listing as a guide. The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152D. 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 97 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.

042825,000002:                                                                                                  ## Copyright:   Public domain.
042826,000003:                                                                                                  ## Filename:    INTER-BANK_COMMUNICATION.agc
042827,000004:                                                                                                  ## Purpose:     A section of Luminary revision 97.
042828,000005:                                                                                                  ##              It is part of the reconstructed source code for the
042829,000006:                                                                                                  ##              second release of the flight software for the Lunar 
042830,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 11.
042831,000008:                                                                                                  ##              It was created to fix two incorrect ephemeris constants in
042832,000009:                                                                                                  ##              Luminary 96, as described by anomaly report LNY-59.
042833,000010:                                                                                                  ##              The code has been recreated from a copy of Luminary 99
042834,000011:                                                                                                  ##              revision 001, using asterisks indicating changed lines in
042835,000012:                                                                                                  ##              the listing and Luminary Memos #83 and #85, which list 
042836,000013:                                                                                                  ##              changes between Luminary 97 and 98, and 98 and 99. The
042837,000014:                                                                                                  ##              code has been adapted such that the resulting bugger words
042838,000015:                                                                                                  ##              exactly match those specified for Luminary 97 in NASA drawing
042839,000016:                                                                                                  ##              2021152D, which gives relatively high confidence that the
042840,000017:                                                                                                  ##              reconstruction is correct.
042841,000018:                                                                                                  ## Reference:   pp. 998-1001
042842,000019:                                                                                                  ## Assembler:   yaYUL
042843,000020:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
042844,000021:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
042845,000022:                                                                                                  ## Mod history: 2019-07-28 MAS  Created from Luminary 99.
042846,000023:                                                                                                  ##              2021-05-30 ABS  ISWCALLL -> ISWCALL
042847,000024: 

Page 998

042849,000026:                                                                                                  #  THE FOLLOWING ROUTINE CAN BE USED TO CALL A SUBROUTINE IN ANOTHER BANK. IN THE BANKCALL VERSION, THE
042850,000027:                                                                                                  #  CADR OF THE SUBROUTINE IMMEDIATELY FOLLOWS THE TC BANKCALL INSTRUCTION, WITH C(A) AND C(L) PRESERVED.
042851,000028: 
042852,000029:    4616                                           BLOCK    02                                    
042853,000030:    4616                                           COUNT*   $$/BANK                               
042854,000031:    4616           52134        BANKCALL           DXCH     BUF2                                  #  SAVE INCOMING A,L.
042855,000032:    4617           50002                           INDEX    Q                                     #  PICK UP CADR.
042856,000033:    4620           30000                           CA       0                                     
042857,000034:    4621           24002                           INCR     Q                                     #  SO WE RETURN TO THE LOC. AFTER THE CADR.
042858,000035: 
042859,000036:                                                                                                  #  SWCALL IS  IDENTICAL TO BANKCALL, EXCEPT THAT THE CADR ARRIVES IN A.
042860,000037: 
042861,000038:    4622           54001        SWCALL             TS       L                                     
042862,000039:    4623           22004                           LXCH     FBANK                                 #  SWITCH BANKS, SAVING RETURN.
042863,000040:    4624           75012                           MASK     LOW10                                 #  GET SUB-ADDRESS OF CADR.
042864,000041:    4625           56002                           XCH      Q                                     #  A,L NOW CONTAINS DP RETURN.
042865,000042:    4626           52134                           DXCH     BUF2                                  #  RESTORING INPUTS IF THIS IS A BANKCALL.
042866,000043:    4627           50002                           INDEX    Q                                     
042867,000044:    4630           02000                           TC       10000                                 #  SETTING Q TO SWRETURN.
042868,000045: 
042869,000046:    4631           56134        SWRETURN           XCH      BUF2       +1                         #  COMES HERE TO RETURN TO CALLER. C(A,L)
042870,000047:    4632           56004                           XCH      FBANK                                 #  ARE PRESERVED FOR RETURN.
042871,000048:    4633           56134                           XCH      BUF2       +1                         
042872,000049:    4634           00133                           TC       BUF2                                  
042873,000050: 
042874,000051:                                                                                                  #  THE FOLLOWING ROUTINE CAN BE USED AS A UNILATERAL JUMP WITH C(A,L) PRESERVED AND THE CADR IMMEDIATELY
042875,000052:                                                                                                  #  FOLLOWING THE TC POSTJUMP INSTRUCTION.
042876,000053: 
042877,000054:    4635           56002        POSTJUMP           XCH      Q                                     #  SAVE INCOMING C(A).
042878,000055:    4636           50000                           INDEX    A                                     #  GET CADR.
042879,000056:    4637           30000                           CA       0                                     
042880,000057: 
042881,000058:                                                                                                  #  BANKJUMP IS THE SAME AS POSTJUMP, EXCEPT THAT THE CADR ARRIVES IN A.
042882,000059: 
042883,000060:    4640           54004        BANKJUMP           TS       FBANK                                 
042884,000061:    4641           75012                           MASK     LOW10                                 
042885,000062:    4642           56002                           XCH      Q                                     #  RESTORING INPUT C(A) IF THIS WAS A
042886,000063:    4643           50002        Q+10000            INDEX    Q                                     #  POSTJUMP.
042887,000064:    4644           12000        PRIO12             TCF      10000                                 #  PRIO12 = TCF  10000 = 12000
042888,000065: 

Page 999

042890,000067:                                                                                                  #  THE FOLLOWING ROUTINE GETS THE RETURN CADR SAVED BY SWCALL OR BANKCALL AND LEAVES IT IN A.
042891,000068: 
042892,000069:    4645           35012        MAKECADR           CAF      LOW10                                 
042893,000070:    4646           70133                           MASK     BUF2                                  
042894,000071:    4647           60134                           AD       BUF2       +1                         
042895,000072:    4650           00002                           TC       Q                                     
042896,000073: 
042897,000074:    4651           54135        SUPDACAL           TS       MPTEMP                                
042898,000075:    4652           56004                           XCH      FBANK                                 #  SET FBANK FOR DATA.
042899,000076:    4653           00006                           EXTEND                                         
042900,000077:    4654           04007                           ROR      SUPERBNK                              #  SAVE FBANK IN BITS 15-11, AND
042901,000078:    4655           56135                           XCH      MPTEMP                                #  SUPERBANK IN BITS 7-5.
042902,000079:    4656           75012                           MASK     LOW10                                 
042903,000080:    4657           56001                           XCH      L                                     #  SAVE REL. ADR. IN BANK, FETCH SUPERBITS.
042904,000081:    4660           00004                           INHINT                                         #  BECAUSE RUPT DOES NOT SAVE SUPERBANK.
042905,000082:    4661           00006                           EXTEND                                         
042906,000083:    4662           01007                           WRITE    SUPERBNK                              #  SET SUPERBANK FOR DATA.
042907,000084:    4663           50001                           INDEX    L                                     
042908,000085:    4664           32000                           CA       10000                                 #  PINBALL (FIX MEM DISP) PREVENTS DCA HERE
042909,000086:    4665           56135                           XCH      MPTEMP                                #  SAVE 1ST WD, FETCH OLD FBANK AND SBANK.
042910,000087:    4666           00006                           EXTEND                                         
042911,000088:    4667           01007                           WRITE    SUPERBNK                              #  RESTORE SUPERBANK.
042912,000089:    4670           00003                           RELINT                                         
042913,000090:    4671           54004                           TS       FBANK                                 #  RESTORE FBANK.
042914,000091:    4672           30135                           CA       MPTEMP                                #  RECOVER FIRST WORD OF DATA.
042915,000092:    4673           00002                           RETURN                                         #  24 WDS. DATACALL 516 MU, SUPDACAL 432 MU
042916,000093: 

Page 1000

042918,000095:                                                                                                  #  THE FOLLOWING ROUTINES ARE IDENTICAL TO BANKCALL AND SWCALL EXCEPT THAT THEY ARE USED IN INTERRUPT.
042919,000096: 
042920,000097:    4674           52073        IBNKCALL           DXCH     RUPTREG3                              #  USES RUPTREG3,4 FOR DP RETURN ADDRESS.
042921,000098:    4675           50002                           INDEX    Q                                     
042922,000099:    4676           30000                           CAF      0                                     
042923,000100:    4677           24002                           INCR     Q                                     
042924,000101: 
042925,000102:    4700           54001        ISWCALL            TS       L                                     
042926,000103:    4701           22004                           LXCH     FBANK                                 
042927,000104:    4702           75012                           MASK     LOW10                                 
042928,000105:    4703           56002                           XCH      Q                                     
042929,000106:    4704           52073                           DXCH     RUPTREG3                              
042930,000107:    4705           50002                           INDEX    Q                                     
042931,000108:    4706           02000                           TC       10000                                 
042932,000109: 
042933,000110:    4707           56073        ISWRETRN           XCH      RUPTREG4                              
042934,000111:    4710           56004                           XCH      FBANK                                 
042935,000112:    4711           56073                           XCH      RUPTREG4                              
042936,000113:    4712           00072                           TC       RUPTREG3                              
042937,000114: 
042938,000115:                                                                                                  #  2. USPRCADR ACCESSES INTERPRETIVE CODING IN OTHER THAN THE USER'S FBANK.  THE CALLING SEQUENCE IS AS FOLLOWS:
042939,000116:                                                                                                  #        L       TC      USPRCADR
042940,000117:                                                                                                  #        L+1     CADR    INTPRETX        INTPRETX IS THE INTERPRETIVE CODING
042941,000118:                                                                                                  #                                        RETURN IS TO L+2
042942,000119: 
042943,000120:    4713           54164        USPRCADR           TS       LOC                                   #  SAVE A
042944,000121:    4714           34744                           CA       BIT8                                  
042945,000122:    4715           54023                           TS       EDOP                                  #  EXIT INSTRUCTION TO EDOP
042946,000123:    4716           30006                           CA       BBANK                                 
042947,000124:    4717           54165                           TS       BANKSET                               #  USER'S BBANK TO BANKSET
042948,000125:    4720           50002                           INDEX    Q                                     
042949,000126:    4721           30000                           CA       0                                     
042950,000127:    4722           54004                           TS       FBANK                                 #  INTERPRETIVE BANK TO FBANK
042951,000128:    4723           75012                           MASK     LOW10                                 #  YIELDS INTERPRETIVE RELATIVE ADDRESS
042952,000129:    4724           56002                           XCH      Q                                     #  INTERPRETIVE ADDRESS TO Q, FETCHING L+1
042953,000130:    4725           56164                           XCH      LOC                                   #  L+1 TO LOC, RETRIEVING ORIGINAL A
042954,000131:    4726           14643                           TCF      Q+10000                               
042955,000132: 

Page 1001

042957,000134:                                                                                                  #  THERE ARE FOUR POSSIBLE SETTINGS FOR CHANNEL 07.  (CHANNEL 07 CONTAINS THE SUPERBANK SETTING.)
042958,000135: 
042959,000136:                                                                                                  #                                        PSEUDO-FIXED      OCTAL PSEUDO
042960,000137:                                                                                                  #  SUPERBANK     SETTING S-REG. VALUE    BANK NUMBERS      ADDRESSES
042961,000138:                                                                                                  #  ----------    ------- ------------     ------------      ------------
042962,000139:                                                                                                  #  SUPERBANK 3     0XX    2000 - 3777       30 - 37       70000 - 107777         (WHERE XX CAN BE ANYTHING AND
042963,000140:                                                                                                  #                                                                                WILL USUALLY BE SEEN AS 11)
042964,000141:                                                                                                  #  SUPERBANK 4     100    2000 - 3777       40 - 47      110000 - 127777         (AS FAR AS IT CAN BE SEEN,
042965,000142:                                                                                                  #                                                                                ONLY BANKS 40-43 WILL EVER BE
042966,000143:                                                                                                  #                                                                                AND ARE PRESENTLY AVAILABLE)
042967,000144:                                                                                                  #  SUPERBANK 5     101    2000 - 3777       50 - 57      130000 - 147777         (PRESENTLY NOT AVAILABLE TO
042968,000145:                                                                                                  #                                                                                THE USER)
042969,000146:                                                                                                  #  SUPERBANK 6     110    2000 - 3777       60 - 67      150000 - 167777         (PRESENTLY NOT AVAILABLE TO
042970,000147:                                                                                                  #                                                                                THE USER)
042971,000148:                                                                                                  #  *** THIS ROUTINE MAY BE CALLED BY ANY PROGRAM LOCATED IN BANKS 00 - 27.  I.E., NO PROGRAM LIVING IN ANY
042972,000149:                                                                                                  #  SUPERBANK SHOULD USE SUPERSW. ***
042973,000150: 
042974,000151:                                                                                                  #  SUPERSW MAY BE CALLED IN THIS FASHION:
042975,000152:                                                                                                  #        CAF     ABBCON          WHERE  --  ABBCON   BBCON  SOMETHIN -- 
042976,000153:                                                                                                  #        TCR     SUPERSW         (THE SUPERBNK BITS ARE IN THE BBCON)
042977,000154:                                                                                                  #        ...       ...
042978,000155:                                                                                                  #         .         .
042979,000156:                                                                                                  #         .         .
042980,000157:                                                                                                  #  OR IN THIS FASHION:
042981,000158:                                                                                                  #        CAF     SUPERSET        WHERE SUPERSET IS ONE OF THE FOUR AVAILABLE
042982,000159:                                                                                                  #        TCR     SUPERSW         SUPERBANK BIT CONSTANTS:
042983,000160:                                                                                                  #        ...       ...                                   SUPER011 OCTAL  60
042984,000161:                                                                                                  #         .         .                                    SUPER100 OCTAL 100
042985,000162:                                                                                                  #         .         .                                    SUPER101 OCTAL 120
042986,000163:                                                                                                  #                                                        SUPER110 OCTAL 140
042987,000164: 
042988,000165:    4727           00006        SUPERSW            EXTEND                                         
042989,000166:    4730           01007                           WRITE    SUPERBNK                              #  WRITE BITS 7-6-5 OF THE ACCUMULATOR INTO
042990,000167:                                                                                                  #  CHANNEL 07
042991,000168:    4731           00002                           TC       Q                                     #  TC TO INSTRUCTION FOLLOWING
042992,000169:                                                                                                  #        TC SUPERSW
042993,000170: 

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