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,1968Note that the date is the date of the printout, not the date of the program revision. |
043958,000002: ## Copyright: Public domain.
043959,000003: ## Filename: INTER-BANK_COMMUNICATION.agc
043960,000004: ## Purpose: The main source file for Luminary revision 069.
043961,000005: ## It is part of the source code for the original release
043962,000006: ## of the flight software for the Lunar Module's (LM) Apollo
043963,000007: ## Guidance Computer (AGC) for Apollo 10. The actual flown
043964,000008: ## version was Luminary 69 revision 2, which included a
043965,000009: ## newer lunar gravity model and only affected module 2.
043966,000010: ## This file is intended to be a faithful transcription, except
043967,000011: ## that the code format has been changed to conform to the
043968,000012: ## requirements of the yaYUL assembler rather than the
043969,000013: ## original YUL assembler.
043970,000014: ## Reference: pp. 993-996
043971,000015: ## Assembler: yaYUL
043972,000016: ## Contact: Ron Burkey <info@sandroid.org>.
043973,000017: ## Website: www.ibiblio.org/apollo/index.html
043974,000018: ## Mod history: 2016-12-13 MAS Created from Luminary 99.
043975,000019: ## 2016-12-18 MAS Updated from comment-proofed Luminary 99 version.
043976,000020: ## 2017-01-04 RRB Updated for Luminary 69.
043977,000021: ## 2017-01-28 RSB Proofed comment text using octopus/prooferComments
043978,000022: ## but no errors found.
043979,000023: ## 2017-03-17 RSB Comment-text fixes identified in diff'ing
043980,000024: ## Luminary 99 vs Comanche 55.
043981,000025: ## 2021-05-30 ABS ISWCALLL -> ISWCALL
043982,000026:
Page 993 |
043984,000028: # THE FOLLOWING ROUTINE CAN BE USED TO CALL A SUBROUTINE IN ANOTHER BANK. IN THE BANKCALL VERSION, THE
043985,000029: # CADR OF THE SUBROUTINE IMMEDIATELY FOLLOWS THE TC BANKCALL INSTRUCTION, WITH C(A) AND C(L) PRESERVED.
043986,000030:
043987,000031: 4616 BLOCK 02
043988,000032: 4616 COUNT* $$/BANK
043989,000033: 4616 52134 BANKCALL DXCH BUF2 # SAVE INCOMING A,L.
043990,000034: 4617 50002 INDEX Q # PICK UP CADR.
043991,000035: 4620 30000 CA 0
043992,000036: 4621 24002 INCR Q # SO WE RETURN TO THE LOC. AFTER THE CADR.
043993,000037:
043994,000038: # SWCALL IS IDENTICAL TO BANKCALL, EXCEPT THAT THE CADR ARRIVES IN A.
043995,000039:
043996,000040: 4622 54001 SWCALL TS L
043997,000041: 4623 22004 LXCH FBANK # SWITCH BANKS, SAVING RETURN.
043998,000042: 4624 75012 MASK LOW10 # GET SUB-ADDRESS OF CADR.
043999,000043: 4625 56002 XCH Q # A,L NOW CONTAINS DP RETURN.
044000,000044: 4626 52134 DXCH BUF2 # RESTORING INPUTS IF THIS IS A BANKCALL.
044001,000045: 4627 50002 INDEX Q
044002,000046: 4630 02000 TC 10000 # SETTING Q TO SWRETURN.
044003,000047:
044004,000048: 4631 56134 SWRETURN XCH BUF2 +1 # COMES HERE TO RETURN TO CALLER. C(A,L)
044005,000049: 4632 56004 XCH FBANK # ARE PRESERVED FOR RETURN.
044006,000050: 4633 56134 XCH BUF2 +1
044007,000051: 4634 00133 TC BUF2
044008,000052:
044009,000053: # THE FOLLOWING ROUTINE CAN BE USED AS A UNILATERAL JUMP WITH C(A,L) PRESERVED AND THE CADR IMMEDIATELY
044010,000054: # FOLLOWING THE TC POSTJUMP INSTRUCTION.
044011,000055:
044012,000056: 4635 56002 POSTJUMP XCH Q # SAVE INCOMING C(A).
044013,000057: 4636 50000 INDEX A # GET CADR.
044014,000058: 4637 30000 CA 0
044015,000059:
044016,000060: # BANKJUMP IS THE SAME AS POSTJUMP, EXCEPT THAT THE CADR ARRIVES IN A.
044017,000061:
044018,000062: 4640 54004 BANKJUMP TS FBANK
044019,000063: 4641 75012 MASK LOW10
044020,000064: 4642 56002 XCH Q # RESTORING INPUT C(A) IF THIS WAS A
044021,000065: 4643 50002 Q+10000 INDEX Q # POSTJUMP.
044022,000066: 4644 12000 PRIO12 TCF 10000 # PRIO12 = TCF 10000 = 12000
044023,000067:
Page 994 |
044025,000069: # THE FOLLOWING ROUTINE GETS THE RETURN CADR SAVED BY SWCALL OR BANKCALL AND LEAVES IT IN A.
044026,000070:
044027,000071: 4645 35012 MAKECADR CAF LOW10
044028,000072: 4646 70133 MASK BUF2
044029,000073: 4647 60134 AD BUF2 +1
044030,000074: 4650 00002 TC Q
044031,000075:
044032,000076: 4651 54135 SUPDACAL TS MPTEMP
044033,000077: 4652 56004 XCH FBANK # SET FBANK FOR DATA.
044034,000078: 4653 00006 EXTEND
044035,000079: 4654 04007 ROR SUPERBNK # SAVE FBANK IN BITS 15-11, AND
044036,000080: 4655 56135 XCH MPTEMP # SUPERBANK IN BITS 7-5.
044037,000081: 4656 75012 MASK LOW10
044038,000082: 4657 56001 XCH L # SAVE REL. ADR. IN BANK, FETCH SUPERBITS.
044039,000083: 4660 00004 INHINT # BECAUSE RUPT DOES NOT SAVE SUPERBANK.
044040,000084: 4661 00006 EXTEND
044041,000085: 4662 01007 WRITE SUPERBNK # SET SUPERBANK FOR DATA.
044042,000086: 4663 50001 INDEX L
044043,000087: 4664 32000 CA 10000 # PINBALL (FIX MEM DISP) PREVENTS DCA HERE
044044,000088: 4665 56135 XCH MPTEMP # SAVE 1ST WD, FETCH OLD FBANK AND SBANK.
044045,000089: 4666 00006 EXTEND
044046,000090: 4667 01007 WRITE SUPERBNK # RESTORE SUPERBANK.
044047,000091: 4670 00003 RELINT
044048,000092: 4671 54004 TS FBANK # RESTORE FBANK.
044049,000093: 4672 30135 CA MPTEMP # RECOVER FIRST WORD OF DATA.
044050,000094: 4673 00002 RETURN # 24 WDS. DATACALL 516 MU, SUPDACAL 432 MU
044051,000095:
Page 995 |
044053,000097: # THE FOLLOWING ROUTINES ARE IDENTICAL TO BANKCALL AND SWCALL EXCEPT THAT THEY ARE USED IN INTERRUPT.
044054,000098:
044055,000099: 4674 52073 IBNKCALL DXCH RUPTREG3 # USES RUPTREG3,4 FOR DP RETURN ADDRESS.
044056,000100: 4675 50002 INDEX Q
044057,000101: 4676 30000 CAF 0
044058,000102: 4677 24002 INCR Q
044059,000103:
044060,000104: 4700 54001 ISWCALL TS L
044061,000105: 4701 22004 LXCH FBANK
044062,000106: 4702 75012 MASK LOW10
044063,000107: 4703 56002 XCH Q
044064,000108: 4704 52073 DXCH RUPTREG3
044065,000109: 4705 50002 INDEX Q
044066,000110: 4706 02000 TC 10000
044067,000111:
044068,000112: 4707 56073 ISWRETRN XCH RUPTREG4
044069,000113: 4710 56004 XCH FBANK
044070,000114: 4711 56073 XCH RUPTREG4
044071,000115: 4712 00072 TC RUPTREG3
044072,000116:
044073,000117: # 2. USPRCADR ACCESSES INTERPRETIVE CODING IN OTHER THAN THE USER'S FBANK. THE CALLING SEQUENCE IS AS FOLLOWS:
044074,000118: # L TC USPRCADR
044075,000119: # L+1 CADR INTPRETX INTPRETX IS THE INTERPRETIVE CODING
044076,000120: # RETURN IS TO L+2
044077,000121:
044078,000122: 4713 54164 USPRCADR TS LOC # SAVE A
044079,000123: 4714 34744 CA BIT8
044080,000124: 4715 54023 TS EDOP # EXIT INSTRUCTION TO EDOP
044081,000125: 4716 30006 CA BBANK
044082,000126: 4717 54165 TS BANKSET # USER'S BBANK TO BANKSET
044083,000127: 4720 50002 INDEX Q
044084,000128: 4721 30000 CA 0
044085,000129: 4722 54004 TS FBANK # INTERPRETIVE BANK TO FBANK
044086,000130: 4723 75012 MASK LOW10 # YIELDS INTERPRETIVE RELATIVE ADDRESS
044087,000131: 4724 56002 XCH Q # INTERPRETIVE ADDRESS TO Q, FETCHING L+1
044088,000132: 4725 56164 XCH LOC # L+1 TO LOC, RETRIEVING ORIGINAL A
044089,000133: 4726 14643 TCF Q+10000
044090,000134:
Page 996 |
044092,000136: # THERE ARE FOUR POSSIBLE SETTINGS FOR CHANNEL 07. (CHANNEL 07 CONTAINS THE SUPERBANK SETTING.)
044093,000137:
044094,000138: # PSEUDO-FIXED OCTAL PSEUDO
044095,000139: # SUPERBANK SETTING S-REG. VALUE BANK NUMBERS ADDRESSES
044096,000140: # ---------- ------- ------------ ------------ ------------
044097,000141: # SUPERBANK 3 0XX 2000 - 3777 30 - 37 70000 - 107777 (WHERE XX CAN BE ANYTHING AND
044098,000142: # WILL USUALLY BE SEEN AS 11)
044099,000143: # SUPERBANK 4 100 2000 - 3777 40 - 47 110000 - 127777 (AS FAR AS IT CAN BE SEEN,
044100,000144: # ONLY BANKS 40-43 WILL EVER BE
044101,000145: # AND ARE PRESENTLY AVAILABLE)
044102,000146: # SUPERBANK 5 101 2000 - 3777 50 - 57 130000 - 147777 (PRESENTLY NOT AVAILABLE TO
044103,000147: # THE USER)
044104,000148: # SUPERBANK 6 110 2000 - 3777 60 - 67 150000 - 167777 (PRESENTLY NOT AVAILABLE TO
044105,000149: # THE USER)
044106,000150: # *** THIS ROUTINE MAY BE CALLED BY ANY PROGRAM LOCATED IN BANKS 00 - 27. I.E., NO PROGRAM LIVING IN ANY
044107,000151: # SUPERBANK SHOULD USE SUPERSW. ***
044108,000152:
044109,000153: # SUPERSW MAY BE CALLED IN THIS FASHION:
044110,000154: # CAF ABBCON WHERE -- ABBCON BBCON SOMETHIN --
044111,000155: # TCR SUPERSW (THE SUPERBNK BITS ARE IN THE BBCON)
044112,000156: # ... ...
044113,000157: # . .
044114,000158: # . .
044115,000159: # OR IN THIS FASHION:
044116,000160: # CAF SUPERSET WHERE SUPERSET IS ONE OF THE FOUR AVAILABLE
044117,000161: # TCR SUPERSW SUPERBANK BIT CONSTANTS:
044118,000162: # ... ... SUPER011 OCTAL 60
044119,000163: # . . SUPER100 OCTAL 100
044120,000164: # . . SUPER101 OCTAL 120
044121,000165: # SUPER110 OCTAL 140
044122,000166:
044123,000167: 4727 00006 SUPERSW EXTEND
044124,000168: 4730 01007 WRITE SUPERBNK # WRITE BITS 7-6-5 OF THE ACCUMULATOR INTO
044125,000169: # CHANNEL 07
044126,000170: 4731 00002 TC Q # TC TO INSTRUCTION FOLLOWING
044127,000171: # TC SUPERSW
044128,000172:
End of include-file INTER-BANK_COMMUNICATION.agc. Parent file is MAIN.agc