Source Code
These source-code files are part of a reconstructed copy of Luminary 173, the
second (unflown) release of the Apollo 14 Lunar Module (LM) Apollo Guidance
Computer (AGC) software.
The reconstruction began with reconstructed source code for Luminary 178. Changes between revision 173 and 178 were backed out, as described by Luminary memo 167 (revision 1). The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152N. Note that page numbers in the reconstructed code match those for the baseline log section mentioned in each file's changelog; the page numbers for a real Luminary 173 listing would be different. 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. |
042898,000002: ## Copyright: Public domain.
042899,000003: ## Filename: INTER-BANK_COMMUNICATION.agc
042900,000004: ## Purpose: A section of Luminary revision 173.
042901,000005: ## It is part of the reconstructed source code for the second
042902,000006: ## (unflown) release of the flight software for the Lunar
042903,000007: ## Module's (LM) Apollo Guidance Computer (AGC) for Apollo 14.
042904,000008: ## The code has been recreated from a reconstructed copy of
042905,000009: ## Luminary 178, as well as Luminary memo 167 (revision 1).
042906,000010: ## It has been adapted such that the resulting bugger words
042907,000011: ## exactly match those specified for Luminary 173 in NASA
042908,000012: ## drawing 2021152N, which gives relatively high confidence
042909,000013: ## that the reconstruction is correct.
042910,000014: ## Reference: pp. 989-992
042911,000015: ## Assembler: yaYUL
042912,000016: ## Contact: Ron Burkey <info@sandroid.org>.
042913,000017: ## Website: www.ibiblio.org/apollo/index.html
042914,000018: ## Mod history: 2019-09-18 MAS Created from Luminary 178.
042915,000019: ## 2021-05-30 ABS ISWCALLL -> ISWCALL
042916,000020:
Page 989 |
042918,000022: # THE FOLLOWING ROUTINE CAN BE USED TO CALL A SUBROUTINE IN ANOTHER BANK. IN THE BANKCALL VERSION, THE
042919,000023: # CADR OF THE SUBROUTINE IMMEDIATELY FOLLOWS THE TC BANKCALL INSTRUCTION, WITH C(A) AND C(L) PRESERVED.
042920,000024:
042921,000025: 4616 BLOCK 02
042922,000026: 4616 COUNT* $$/BANK
042923,000027: 4616 52134 BANKCALL DXCH BUF2 # SAVE INCOMING A,L.
042924,000028: 4617 50002 INDEX Q # PICK UP CADR.
042925,000029: 4620 30000 CA 0
042926,000030: 4621 24002 INCR Q # SO WE RETURN TO THE LOC. AFTER THE CADR.
042927,000031:
042928,000032: # SWCALL IS IDENTICAL TO BANKCALL, EXCEPT THAT THE CADR ARRIVES IN A.
042929,000033:
042930,000034: 4622 54001 SWCALL TS L
042931,000035: 4623 22004 LXCH FBANK # SWITCH BANKS, SAVING RETURN.
042932,000036: 4624 75012 MASK LOW10 # GET SUB-ADDRESS OF CADR.
042933,000037: 4625 56002 XCH Q # A,L NOW CONTAINS DP RETURN.
042934,000038: 4626 52134 DXCH BUF2 # RESTORING INPUTS IF THIS IS A BANKCALL.
042935,000039: 4627 50002 INDEX Q
042936,000040: 4630 02000 TC 10000 # SETTING Q TO SWRETURN.
042937,000041:
042938,000042: 4631 56134 SWRETURN XCH BUF2 +1 # COMES HERE TO RETURN TO CALLER. C(A,L)
042939,000043: 4632 56004 XCH FBANK # ARE PRESERVED FOR RETURN.
042940,000044: 4633 56134 XCH BUF2 +1
042941,000045: 4634 00133 TC BUF2
042942,000046:
042943,000047: # THE FOLLOWING ROUTINE CAN BE USED AS A UNILATERAL JUMP WITH C(A,L) PRESERVED AND THE CADR IMMEDIATELY
042944,000048: # FOLLOWING THE TC POSTJUMP INSTRUCTION.
042945,000049:
042946,000050: 4635 56002 POSTJUMP XCH Q # SAVE INCOMING C(A).
042947,000051: 4636 50000 INDEX A # GET CADR.
042948,000052: 4637 30000 CA 0
042949,000053:
042950,000054: # BANKJUMP IS THE SAME AS POSTJUMP, EXCEPT THAT THE CADR ARRIVES IN A.
042951,000055:
042952,000056: 4640 54004 BANKJUMP TS FBANK
042953,000057: 4641 75012 MASK LOW10
042954,000058: 4642 56002 XCH Q # RESTORING INPUT C(A) IF THIS WAS A
042955,000059: 4643 50002 Q+10000 INDEX Q # POSTJUMP.
042956,000060: 4644 12000 PRIO12 TCF 10000 # PRIO12 = TCF 10000 = 12000
042957,000061:
Page 990 |
042959,000063: # THE FOLLOWING ROUTINE GETS THE RETURN CADR SAVED BY SWCALL OR BANKCALL AND LEAVES IT IN A.
042960,000064:
042961,000065: 4645 35012 MAKECADR CAF LOW10
042962,000066: 4646 70133 MASK BUF2
042963,000067: 4647 60134 AD BUF2 +1
042964,000068: 4650 00002 TC Q
042965,000069:
042966,000070:
042967,000071: 4651 54135 SUPDACAL TS MPTEMP
042968,000072: 4652 56004 XCH FBANK # SET FBANK FOR DATA.
042969,000073: 4653 00006 EXTEND
042970,000074: 4654 04007 ROR SUPERBNK # SAVE FBANK IN BITS 15-11, AND
042971,000075: 4655 56135 XCH MPTEMP # SUPERBANK IN BITS 7-5.
042972,000076: 4656 75012 MASK LOW10
042973,000077: 4657 56001 XCH L # SAVE REL. ADR. IN BANK, FETCH SUPERBITS.
042974,000078: 4660 00004 INHINT # BECAUSE RUPT DOES NOT SAVE SUPERBANK.
042975,000079: 4661 00006 EXTEND
042976,000080: 4662 01007 WRITE SUPERBNK # SET SUPERBANK FOR DATA.
042977,000081: 4663 50001 INDEX L
042978,000082: 4664 32000 CA 10000 # PINBALL (FIX MEM DISP) PREVENTS DCA HERE
042979,000083: 4665 56135 XCH MPTEMP # SAVE 1ST WD, FETCH OLD FBANK AND SBANK.
042980,000084: 4666 00006 EXTEND
042981,000085: 4667 01007 WRITE SUPERBNK # RESTORE SUPERBANK.
042982,000086: 4670 00003 RELINT
042983,000087: 4671 54004 TS FBANK # RESTORE FBANK.
042984,000088: 4672 30135 CA MPTEMP # RECOVER FIRST WORD OF DATA.
042985,000089: 4673 00002 RETURN # 24 WDS. DATACALL 516 MU, SUPDACAL 432 MU
042986,000090:
Page 991 |
042988,000092: # THE FOLLOWING ROUTINES ARE IDENTICAL TO BANKCALL AND SWCALL EXCEPT THAT THEY ARE USED IN INTERRUPT.
042989,000093:
042990,000094: 4674 52073 IBNKCALL DXCH RUPTREG3 # USES RUPTREG3,4 FOR DP RETURN ADDRESS.
042991,000095: 4675 50002 INDEX Q
042992,000096: 4676 30000 CAF 0
042993,000097: 4677 24002 INCR Q
042994,000098:
042995,000099: 4700 54001 ISWCALL TS L
042996,000100: 4701 22004 LXCH FBANK
042997,000101: 4702 75012 MASK LOW10
042998,000102: 4703 56002 XCH Q
042999,000103: 4704 52073 DXCH RUPTREG3
043000,000104: 4705 50002 INDEX Q
043001,000105: 4706 02000 TC 10000
043002,000106:
043003,000107: 4707 56073 ISWRETRN XCH RUPTREG4
043004,000108: 4710 56004 XCH FBANK
043005,000109: 4711 56073 XCH RUPTREG4
043006,000110: 4712 00072 TC RUPTREG3
043007,000111:
043008,000112: # 2. USPRCADR ACCESSES INTERPRETIVE CODING IN OTHER THAN THE USER'S FBANK. THE CALLING SEQUENCE IS AS FOLLOWS:
043009,000113:
043010,000114: # L TC USPRCADR
043011,000115: # L+1 CADR INTPRETX INTPRETX IS THE INTERPRETIVE CODING
043012,000116: # RETURN IS TO L+2
043013,000117:
043014,000118:
043015,000119: 4713 54164 USPRCADR TS LOC # SAVE A
043016,000120: 4714 34744 CA BIT8
043017,000121: 4715 54023 TS EDOP # EXIT INSTRUCTION TO EDOP
043018,000122: 4716 30006 CA BBANK
043019,000123: 4717 54165 TS BANKSET # USER'S BBANK TO BANKSET
043020,000124: 4720 50002 INDEX Q
043021,000125: 4721 30000 CA 0
043022,000126: 4722 54004 TS FBANK # INTERPRETIVE BANK TO FBANK
043023,000127: 4723 75012 MASK LOW10 # YIELDS INTERPRETIVE RELATIVE ADDRESS
043024,000128: 4724 56002 XCH Q # INTERPRETIVE ADDRESS TO Q, FETCHING L+1
043025,000129: 4725 56164 XCH LOC # L+1 TO LOC, RETRIEVING ORIGINAL A
043026,000130: 4726 14643 TCF Q+10000
043027,000131:
Page 992 |
043029,000133: # THERE ARE FOUR POSSIBLE SETTINGS FOR CHANNEL 07. (CHANNEL 07 CONTAINS THE SUPERBANK SETTING.)
043030,000134: # PSEUDO-FIXED OCTAL PSEUDO
043031,000135: # SUPERBANK SETTING S-REG. VALUE BANK NUMBERS ADDRESSES
043032,000136: # ---------- ------- ------------ ------------ ------------
043033,000137:
043034,000138: # SUPERBANK 3 0XX 2000 - 3777 30 - 37 70000 - 107777 (WHERE XX CAN BE ANYTHING AND
043035,000139: # WILL USUALLY BE SEEN AS 11)
043036,000140: # SUPERBANK 4 100 2000 - 3777 40 - 47 110000 - 127777 (AS FAR AS IT CAN BE SEEN,
043037,000141: # ONLY BANKS 40-43 WILL EVER BE
043038,000142: # AND ARE PRESENTLY AVAILABLE)
043039,000143: # SUPERBANK 5 101 2000 - 3777 50 - 57 130000 - 147777 (PRESENTLY NOT AVAILABLE TO
043040,000144: # THE USER)
043041,000145: # SUPERBANK 6 110 2000 - 3777 60 - 67 150000 - 167777 (PRESENTLY NOT AVAILABLE TO
043042,000146: # THE USER)
043043,000147: # *** THIS ROUTINE MAYBE CALLED BY ANY PROGRAM LOCATED IN BANKS 00 - 27. I.E., NO PROGRAM LIVING IN ANY
043044,000148: # SUPERBANK SHOULD USE SUPERSW. ***
043045,000149:
043046,000150: # SUPERSW MAYBE CALLED IN THIS FASHION:
043047,000151:
043048,000152: # CAF ABBCON WHERE -- ABBCON BBCON SOMETHIN --
043049,000153: # TCR SUPERSW (THE SUPERBNK BITS ARE IN THE BBCON)
043050,000154: # ... ...
043051,000155: # . .
043052,000156: # . .
043053,000157:
043054,000158: # OR IN THIS FASHION :
043055,000159:
043056,000160: # CAF SUPERSET WHERE SUPERSET IS ONE OF THE FOUR AVAILABLE
043057,000161: # TCR SUPERSW SUPERBANK BIT CONSTANTS:
043058,000162: # ... ... SUPER011 OCTAL 60
043059,000163: # . . SUPER100 OCTAL 100
043060,000164: # . . SUPER101 OCTAL 120
043061,000165: # SUPER110 OCTAL 140
043062,000166:
043063,000167: 4727 00006 SUPERSW EXTEND
043064,000168: 4730 01007 WRITE SUPERBNK # WRITE BITS 7-6-5 OF THE ACCUMULATOR INTO
043065,000169: # CHANNEL 07
043066,000170: 4731 00002 TC Q # TC TO INSTRUCTION FOLLOWING
043067,000171: # TC SUPERSW
043068,000172:
End of include-file INTER-BANK_COMMUNICATION.agc. Parent file is MAIN.agc