Source Code

These source-code files were transcribed from scans made from Don Eyles's personal copy of Luminary 069. They were scanned at archive.org's Boston facility, and the scanning was sponsored by Onno Hommes. The code was transcribed from these scans by a team of volunteers who are referenced in the program comments. Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". In some cases, where similar code blocks exist in previously-transcribed AGC programs (primarily Luminary 99, from Apollo 11) those code blocks were used as a starting point and then corrected to agree with the Luminary 69 scans. The full scans are available at the Virtual AGC project's collection at archive.org, while more-convenient reduced-size (but reduced-quality) images are available at the main Virtual AGC website. Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository. Notations on the program listing read, in part:

	GAP:  ASSEMBLE REVISION 069 OF AGC PROGRAM LUMINARY BY NASA 2021112-011
	19:02 NOV. 25,1968
Note that the date is the date of the printout, not the date of the program revision.

043939,000002:                                                                                                  ## Copyright:   Public domain.
043940,000003:                                                                                                  ## Filename:    INTER-BANK_COMMUNICATION.agc
043941,000004:                                                                                                  ## Purpose:     The main source file for Luminary revision 069.
043942,000005:                                                                                                  ##              It is part of the source code for the original release
043943,000006:                                                                                                  ##              of the flight software for the Lunar Module's (LM) Apollo
043944,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 10. The actual flown
043945,000008:                                                                                                  ##              version was Luminary 69 revision 2, which included a
043946,000009:                                                                                                  ##              newer lunar gravity model and only affected module 2.
043947,000010:                                                                                                  ##              This file is intended to be a faithful transcription, except
043948,000011:                                                                                                  ##              that the code format has been changed to conform to the
043949,000012:                                                                                                  ##              requirements of the yaYUL assembler rather than the
043950,000013:                                                                                                  ##              original YUL assembler.
043951,000014:                                                                                                  ## Reference:   pp. 993-996
043952,000015:                                                                                                  ## Assembler:   yaYUL
043953,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
043954,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
043955,000018:                                                                                                  ## Mod history: 2016-12-13 MAS  Created from Luminary 99.
043956,000019:                                                                                                  ##              2016-12-18 MAS  Updated from comment-proofed Luminary 99 version.
043957,000020:                                                                                                  ##              2017-01-04 RRB  Updated for Luminary 69.
043958,000021:                                                                                                  ##              2017-01-28 RSB  Proofed comment text using octopus/prooferComments
043959,000022:                                                                                                  ##                              but no errors found.
043960,000023:                                                                                                  ##              2017-03-17 RSB  Comment-text fixes identified in diff'ing
043961,000024:                                                                                                  ##                              Luminary 99 vs Comanche 55.
043962,000025: 

Page 993

043964,000027:                                                                                                  #           THE FOLLOWING ROUTINE CAN BE USED TO CALL A SUBROUTINE IN ANOTHER BANK. IN THE BANKCALL VERSION, THE
043965,000028:                                                                                                  #  CADR OF THE SUBROUTINE IMMEDIATELY FOLLOWS THE TC BANKCALL INSTRUCTION, WITH C(A) AND C(L) PRESERVED.
043966,000029: 
043967,000030:    4616                                           BLOCK    02                                    
043968,000031:    4616                                           COUNT*   $$/BANK                               
043969,000032:    4616           52134        BANKCALL           DXCH     BUF2                                  #  SAVE INCOMING A,L.
043970,000033:    4617           50002                           INDEX    Q                                     #  PICK UP CADR.
043971,000034:    4620           30000                           CA       0                                     
043972,000035:    4621           24002                           INCR     Q                                     #  SO WE RETURN TO THE LOC. AFTER THE CADR.
043973,000036: 
043974,000037:                                                                                                  #            SWCALL IS IDENTICAL TO BANKCALL, EXCEPT THAT THE CADR ARRIVES IN A.
043975,000038: 
043976,000039:    4622           54001        SWCALL             TS       L                                     
043977,000040:    4623           22004                           LXCH     FBANK                                 #  SWITCH BANKS, SAVING RETURN.
043978,000041:    4624           75012                           MASK     LOW10                                 #  GET SUB-ADDRESS OF CADR.
043979,000042:    4625           56002                           XCH      Q                                     #  A,L NOW CONTAINS DP RETURN.
043980,000043:    4626           52134                           DXCH     BUF2                                  #  RESTORING INPUTS IF THIS IS A BANKCALL.
043981,000044:    4627           50002                           INDEX    Q                                     
043982,000045:    4630           02000                           TC       10000                                 #  SETTING Q TO SWRETURN.
043983,000046: 
043984,000047:    4631           56134        SWRETURN           XCH      BUF2       +1                         #  COMES HERE TO RETURN TO CALLER. C(A,L)
043985,000048:    4632           56004                           XCH      FBANK                                 #  ARE PRESERVED FOR RETURN.
043986,000049:    4633           56134                           XCH      BUF2       +1                         
043987,000050:    4634           00133                           TC       BUF2                                  
043988,000051: 
043989,000052:                                                                                                  #           THE FOLLOWING ROUTINE CAN BE USED AS A UNILATERAL JUMP WITH C(A,L) PRESERVED AND THE CADR IMMEDIATELY
043990,000053:                                                                                                  #  FOLLOWING THE TC POSTJUMP INSTRUCTION.
043991,000054: 
043992,000055:    4635           56002        POSTJUMP           XCH      Q                                     #  SAVE INCOMING C(A).
043993,000056:    4636           50000                           INDEX    A                                     #  GET CADR.
043994,000057:    4637           30000                           CA       0                                     
043995,000058: 
043996,000059:                                                                                                  #            BANKJUMP IS THE SAME AS POSTJUMP, EXCEPT THAT THE CADR ARRIVES IN A.
043997,000060: 
043998,000061:    4640           54004        BANKJUMP           TS       FBANK                                 
043999,000062:    4641           75012                           MASK     LOW10                                 
044000,000063:    4642           56002                           XCH      Q                                     #  RESTORING INPUT C(A) IF THIS WAS A
044001,000064:    4643           50002        Q+10000            INDEX    Q                                     #  POSTJUMP.
044002,000065:    4644           12000        PRIO12             TCF      10000                                 #  PRIO12 = TCF  10000 = 12000
044003,000066: 

Page 994

044005,000068:                                                                                                  #            THE FOLLOWING ROUTINE GETS THE RETURN CADR SAVED BY SWCALL OR BANKCALL AND LEAVES IT IN A.
044006,000069: 
044007,000070:    4645           35012        MAKECADR           CAF      LOW10                                 
044008,000071:    4646           70133                           MASK     BUF2                                  
044009,000072:    4647           60134                           AD       BUF2       +1                         
044010,000073:    4650           00002                           TC       Q                                     
044011,000074: 
044012,000075:    4651           54135        SUPDACAL           TS       MPTEMP                                
044013,000076:    4652           56004                           XCH      FBANK                                 #  SET FBANK FOR DATA.
044014,000077:    4653           00006                           EXTEND                                         
044015,000078:    4654           04007                           ROR      SUPERBNK                              #  SAVE FBANK IN BITS 15-11, AND
044016,000079:    4655           56135                           XCH      MPTEMP                                #   SUPERBANK IN BITS 7-5.
044017,000080:    4656           75012                           MASK     LOW10                                 
044018,000081:    4657           56001                           XCH      L                                     #  SAVE REL. ADR. IN BANK, FETCH SUPERBITS.
044019,000082:    4660           00004                           INHINT                                         #  BECAUSE RUPT DOES NOT SAVE SUPERBANK.
044020,000083:    4661           00006                           EXTEND                                         
044021,000084:    4662           01007                           WRITE    SUPERBNK                              #  SET SUPERBANK FOR DATA.
044022,000085:    4663           50001                           INDEX    L                                     
044023,000086:    4664           32000                           CA       10000                                 #  PINBALL (FIX MEM DISP) PREVENTS DCA HERE
044024,000087:    4665           56135                           XCH      MPTEMP                                #  SAVE 1ST WD, FETCH OLD FBANK AND SBANK.
044025,000088:    4666           00006                           EXTEND                                         
044026,000089:    4667           01007                           WRITE    SUPERBNK                              #  RESTORE SUPERBANK.
044027,000090:    4670           00003                           RELINT                                         
044028,000091:    4671           54004                           TS       FBANK                                 #  RESTORE FBANK.
044029,000092:    4672           30135                           CA       MPTEMP                                #  RECOVER FIRST WORD OF DATA.
044030,000093:    4673           00002                           RETURN                                         #  24 WDS. DATACALL 516 MU, SUPDACAL 432 MU
044031,000094: 

Page 995

044033,000096:                                                                                                  #           THE FOLLOWING ROUTINES ARE IDENTICAL TO BANKCALL AND SWCALL EXCEPT THAT THEY ARE USED IN INTERRUPT.
044034,000097: 
044035,000098:    4674           52073        IBNKCALL           DXCH     RUPTREG3                              #  USES RUPTREG3,4 FOR DP RETURN ADDRESS.
044036,000099:    4675           50002                           INDEX    Q                                     
044037,000100:    4676           30000                           CAF      0                                     
044038,000101:    4677           24002                           INCR     Q                                     
044039,000102: 
044040,000103:    4700           54001        ISWCALLL           TS       L                                     
044041,000104:    4701           22004                           LXCH     FBANK                                 
044042,000105:    4702           75012                           MASK     LOW10                                 
044043,000106:    4703           56002                           XCH      Q                                     
044044,000107:    4704           52073                           DXCH     RUPTREG3                              
044045,000108:    4705           50002                           INDEX    Q                                     
044046,000109:    4706           02000                           TC       10000                                 
044047,000110: 
044048,000111:    4707           56073        ISWRETRN           XCH      RUPTREG4                              
044049,000112:    4710           56004                           XCH      FBANK                                 
044050,000113:    4711           56073                           XCH      RUPTREG4                              
044051,000114:    4712           00072                           TC       RUPTREG3                              
044052,000115: 
044053,000116:                                                                                                  #  2. USPRCADR ACCESSES INTERPRETIVE CODING IN OTHER THAN THE USER'S FBANK.  THE CALLING SEQUENCE IS AS FOLLOWS:
044054,000117:                                                                                                  #        L       TC      USPRCADR
044055,000118:                                                                                                  #        L+1     CADR    INTPRETX        INTPRETX IS THE INTERPRETIVE CODING
044056,000119:                                                                                                  #                                        RETURN IS TO L+2
044057,000120: 
044058,000121:    4713           54164        USPRCADR           TS       LOC                                   #  SAVE A
044059,000122:    4714           34744                           CA       BIT8                                  
044060,000123:    4715           54023                           TS       EDOP                                  #  EXIT INSTRUCTION TO EDOP
044061,000124:    4716           30006                           CA       BBANK                                 
044062,000125:    4717           54165                           TS       BANKSET                               #  USER'S BBANK TO BANKSET
044063,000126:    4720           50002                           INDEX    Q                                     
044064,000127:    4721           30000                           CA       0                                     
044065,000128:    4722           54004                           TS       FBANK                                 #  INTERPRETIVE BANK TO FBANK
044066,000129:    4723           75012                           MASK     LOW10                                 #  YIELDS INTERPRETIVE RELATIVE ADDRESS
044067,000130:    4724           56002                           XCH      Q                                     #  INTERPRETIVE ADDRESS TO Q, FETCHING L+1
044068,000131:    4725           56164                           XCH      LOC                                   #  L+1 TO LOC, RETRIEVING ORIGINAL A
044069,000132:    4726           14643                           TCF      Q+10000                               
044070,000133: 

Page 996

044072,000135:                                                                                                  #  THERE ARE FOUR POSSIBLE SETTINGS FOR CHANNEL 07.  (CHANNEL 07 CONTAINS THE SUPERBANK SETTING.)
044073,000136: 
044074,000137:                                                                                                  #                                        PSEUDO-FIXED      OCTAL PSEUDO
044075,000138:                                                                                                  #  SUPERBANK     SETTING S-REG. VALUE    BANK NUMBERS      ADDRESSES
044076,000139:                                                                                                  #  ----------    ------- ------------     ------------      ------------
044077,000140:                                                                                                  #  SUPERBANK 3     0XX    2000 - 3777       30 - 37       70000 - 107777         (WHERE XX CAN BE ANYTHING AND
044078,000141:                                                                                                  #                                                                                WILL USUALLY BE SEEN AS 11)
044079,000142:                                                                                                  #  SUPERBANK 4     100    2000 - 3777       40 - 47      110000 - 127777         (AS FAR AS IT CAN BE SEEN,
044080,000143:                                                                                                  #                                                                                ONLY BANKS 40-43 WILL EVER BE
044081,000144:                                                                                                  #                                                                                AND ARE PRESENTLY AVAILABLE)
044082,000145:                                                                                                  #  SUPERBANK 5     101    2000 - 3777       50 - 57      130000 - 147777         (PRESENTLY NOT AVAILABLE TO
044083,000146:                                                                                                  #                                                                                THE USER)
044084,000147:                                                                                                  #  SUPERBANK 6     110    2000 - 3777       60 - 67      150000 - 167777         (PRESENTLY NOT AVAILABLE TO
044085,000148:                                                                                                  #                                                                                THE USER)
044086,000149:                                                                                                  #  *** THIS ROUTINE MAY BE CALLED BY ANY PROGRAM LOCATED IN BANKS 00 - 27.  I.E., NO PROGRAM LIVING IN ANY
044087,000150:                                                                                                  #  SUPERBANK SHOULD USE SUPERSW. ***
044088,000151: 
044089,000152:                                                                                                  #  SUPERSW MAY BE CALLED IN THIS FASHION:
044090,000153:                                                                                                  #        CAF     ABBCON          WHERE   -- ABBCON   BBCON  SOMETHIN  --
044091,000154:                                                                                                  #        TCR     SUPERSW         (THE SUPERBNK BITS ARE IN THE BBCON)
044092,000155:                                                                                                  #        ...       ...
044093,000156:                                                                                                  #         .         .
044094,000157:                                                                                                  #         .         .
044095,000158:                                                                                                  #  OR IN THIS FASHION:
044096,000159:                                                                                                  #        CAF     SUPERSET        WHERE SUPERSET IS ONE OF THE FOUR AVAILABLE
044097,000160:                                                                                                  #        TCR     SUPERSW         SUPERBANK BIT CONSTANTS:
044098,000161:                                                                                                  #        ...       ...                                   SUPER011 OCTAL  60
044099,000162:                                                                                                  #         .         .                                    SUPER100 OCTAL 100
044100,000163:                                                                                                  #         .         .                                    SUPER101 OCTAL 120
044101,000164:                                                                                                  #                                                        SUPER110 OCTAL 140
044102,000165: 
044103,000166:    4727           00006        SUPERSW            EXTEND                                         
044104,000167:    4730           01007                           WRITE    SUPERBNK                              #  WRITE BITS 7-6-5 OF THE ACCUMULATOR INTO
044105,000168:                                                                                                  #  CHANNEL 07
044106,000169:    4731           00002                           TC       Q                                     #  TC TO INSTRUCTION FOLLOWING
044107,000170:                                                                                                  #   TC SUPERSW
044108,000171: 

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