Source Code
These source-code files are part of a reconstructed copy of Luminary 69/2,
the flown, final release of the Apollo 10 Lunar Module (LM) Apollo Guidance Computer (AGC) software.
The reconstruction is based on the source code of Luminary 69 — i.e., the initial, unflown version, "revision 0" — of which a contemporary listing was available. The code was then updated by incorporating the differences between Luminary 69 and Luminary 69/2, known from other contemporary documentation. The only such difference is the implementation in Luminary 69/2 of the "R-2 Lunar Potential Model", the source code for which was taken from program Luminary 99/1 (Apollo 11 LM), of which a contemporary listing was also available. Finally, the now-reconstructed Luminary 69/2 was then validated by assembling it to executable form and verifying that its memory banks had the correct checksums, known from still other contemporary documentation. Note that page numbers in the reconstructed code match those in the original Luminary 69 program listing, or in the ORBITAL INTEGRATION log section, in Luminary 99/1. Page numbers would certainly differ somewhat in a contemporary Luminary 69/2 listing. Moreover, annotations that were not present in the contemporary source code have been added to the reconstructed code to justify each change in Luminary 69/2 relative to Luminary 69. Here's a guide to the Apollo documentation referenced in those annotations:
|
043656,000002: ## Copyright: Public domain.
043657,000003: ## Filename: INTER-BANK_COMMUNICATION.agc
043658,000004: ## Purpose: A section of LUM69 revision 2.
043659,000005: ## It is part of the reconstructed source code for the flown
043660,000006: ## version of the flight software for the Lunar Module's (LM)
043661,000007: ## Apollo Guidance Computer (AGC) for Apollo 10. The code has
043662,000008: ## been recreated from a copy of Luminary revsion 069, using
043663,000009: ## changes present in Luminary 099 which were described in
043664,000010: ## Luminary memos 75 and 78. The code has been adapted such
043665,000011: ## that the resulting bugger words exactly match those specified
043666,000012: ## for LUM69 revision 2 in NASA drawing 2021152B, which gives
043667,000013: ## relatively high confidence that the reconstruction is correct.
043668,000014: ## Reference: pp. 993-996
043669,000015: ## Assembler: yaYUL
043670,000016: ## Contact: Ron Burkey <info@sandroid.org>.
043671,000017: ## Website: www.ibiblio.org/apollo/index.html
043672,000018: ## Mod history: 2019-07-27 MAS Created from Luminary 69.
043673,000019: ## 2021-05-30 ABS ISWCALLL -> ISWCALL
043674,000020:
Page 993 |
043676,000022: # THE FOLLOWING ROUTINE CAN BE USED TO CALL A SUBROUTINE IN ANOTHER BANK. IN THE BANKCALL VERSION, THE
043677,000023: # CADR OF THE SUBROUTINE IMMEDIATELY FOLLOWS THE TC BANKCALL INSTRUCTION, WITH C(A) AND C(L) PRESERVED.
043678,000024:
043679,000025: 4616 BLOCK 02
043680,000026: 4616 COUNT* $$/BANK
043681,000027: 4616 52134 BANKCALL DXCH BUF2 # SAVE INCOMING A,L.
043682,000028: 4617 50002 INDEX Q # PICK UP CADR.
043683,000029: 4620 30000 CA 0
043684,000030: 4621 24002 INCR Q # SO WE RETURN TO THE LOC. AFTER THE CADR.
043685,000031:
043686,000032: # SWCALL IS IDENTICAL TO BANKCALL, EXCEPT THAT THE CADR ARRIVES IN A.
043687,000033:
043688,000034: 4622 54001 SWCALL TS L
043689,000035: 4623 22004 LXCH FBANK # SWITCH BANKS, SAVING RETURN.
043690,000036: 4624 75012 MASK LOW10 # GET SUB-ADDRESS OF CADR.
043691,000037: 4625 56002 XCH Q # A,L NOW CONTAINS DP RETURN.
043692,000038: 4626 52134 DXCH BUF2 # RESTORING INPUTS IF THIS IS A BANKCALL.
043693,000039: 4627 50002 INDEX Q
043694,000040: 4630 02000 TC 10000 # SETTING Q TO SWRETURN.
043695,000041:
043696,000042: 4631 56134 SWRETURN XCH BUF2 +1 # COMES HERE TO RETURN TO CALLER. C(A,L)
043697,000043: 4632 56004 XCH FBANK # ARE PRESERVED FOR RETURN.
043698,000044: 4633 56134 XCH BUF2 +1
043699,000045: 4634 00133 TC BUF2
043700,000046:
043701,000047: # THE FOLLOWING ROUTINE CAN BE USED AS A UNILATERAL JUMP WITH C(A,L) PRESERVED AND THE CADR IMMEDIATELY
043702,000048: # FOLLOWING THE TC POSTJUMP INSTRUCTION.
043703,000049:
043704,000050: 4635 56002 POSTJUMP XCH Q # SAVE INCOMING C(A).
043705,000051: 4636 50000 INDEX A # GET CADR.
043706,000052: 4637 30000 CA 0
043707,000053:
043708,000054: # BANKJUMP IS THE SAME AS POSTJUMP, EXCEPT THAT THE CADR ARRIVES IN A.
043709,000055:
043710,000056: 4640 54004 BANKJUMP TS FBANK
043711,000057: 4641 75012 MASK LOW10
043712,000058: 4642 56002 XCH Q # RESTORING INPUT C(A) IF THIS WAS A
043713,000059: 4643 50002 Q+10000 INDEX Q # POSTJUMP.
043714,000060: 4644 12000 PRIO12 TCF 10000 # PRIO12 = TCF 10000 = 12000
043715,000061:
Page 994 |
043717,000063: # THE FOLLOWING ROUTINE GETS THE RETURN CADR SAVED BY SWCALL OR BANKCALL AND LEAVES IT IN A.
043718,000064:
043719,000065: 4645 35012 MAKECADR CAF LOW10
043720,000066: 4646 70133 MASK BUF2
043721,000067: 4647 60134 AD BUF2 +1
043722,000068: 4650 00002 TC Q
043723,000069:
043724,000070: 4651 54135 SUPDACAL TS MPTEMP
043725,000071: 4652 56004 XCH FBANK # SET FBANK FOR DATA.
043726,000072: 4653 00006 EXTEND
043727,000073: 4654 04007 ROR SUPERBNK # SAVE FBANK IN BITS 15-11, AND
043728,000074: 4655 56135 XCH MPTEMP # SUPERBANK IN BITS 7-5.
043729,000075: 4656 75012 MASK LOW10
043730,000076: 4657 56001 XCH L # SAVE REL. ADR. IN BANK, FETCH SUPERBITS.
043731,000077: 4660 00004 INHINT # BECAUSE RUPT DOES NOT SAVE SUPERBANK.
043732,000078: 4661 00006 EXTEND
043733,000079: 4662 01007 WRITE SUPERBNK # SET SUPERBANK FOR DATA.
043734,000080: 4663 50001 INDEX L
043735,000081: 4664 32000 CA 10000 # PINBALL (FIX MEM DISP) PREVENTS DCA HERE
043736,000082: 4665 56135 XCH MPTEMP # SAVE 1ST WD, FETCH OLD FBANK AND SBANK.
043737,000083: 4666 00006 EXTEND
043738,000084: 4667 01007 WRITE SUPERBNK # RESTORE SUPERBANK.
043739,000085: 4670 00003 RELINT
043740,000086: 4671 54004 TS FBANK # RESTORE FBANK.
043741,000087: 4672 30135 CA MPTEMP # RECOVER FIRST WORD OF DATA.
043742,000088: 4673 00002 RETURN # 24 WDS. DATACALL 516 MU, SUPDACAL 432 MU
043743,000089:
Page 995 |
043745,000091: # THE FOLLOWING ROUTINES ARE IDENTICAL TO BANKCALL AND SWCALL EXCEPT THAT THEY ARE USED IN INTERRUPT.
043746,000092:
043747,000093: 4674 52073 IBNKCALL DXCH RUPTREG3 # USES RUPTREG3,4 FOR DP RETURN ADDRESS.
043748,000094: 4675 50002 INDEX Q
043749,000095: 4676 30000 CAF 0
043750,000096: 4677 24002 INCR Q
043751,000097:
043752,000098: 4700 54001 ISWCALL TS L
043753,000099: 4701 22004 LXCH FBANK
043754,000100: 4702 75012 MASK LOW10
043755,000101: 4703 56002 XCH Q
043756,000102: 4704 52073 DXCH RUPTREG3
043757,000103: 4705 50002 INDEX Q
043758,000104: 4706 02000 TC 10000
043759,000105:
043760,000106: 4707 56073 ISWRETRN XCH RUPTREG4
043761,000107: 4710 56004 XCH FBANK
043762,000108: 4711 56073 XCH RUPTREG4
043763,000109: 4712 00072 TC RUPTREG3
043764,000110:
043765,000111: # 2. USPRCADR ACCESSES INTERPRETIVE CODING IN OTHER THAN THE USER'S FBANK. THE CALLING SEQUENCE IS AS FOLLOWS:
043766,000112: # L TC USPRCADR
043767,000113: # L+1 CADR INTPRETX INTPRETX IS THE INTERPRETIVE CODING
043768,000114: # RETURN IS TO L+2
043769,000115:
043770,000116: 4713 54164 USPRCADR TS LOC # SAVE A
043771,000117: 4714 34744 CA BIT8
043772,000118: 4715 54023 TS EDOP # EXIT INSTRUCTION TO EDOP
043773,000119: 4716 30006 CA BBANK
043774,000120: 4717 54165 TS BANKSET # USER'S BBANK TO BANKSET
043775,000121: 4720 50002 INDEX Q
043776,000122: 4721 30000 CA 0
043777,000123: 4722 54004 TS FBANK # INTERPRETIVE BANK TO FBANK
043778,000124: 4723 75012 MASK LOW10 # YIELDS INTERPRETIVE RELATIVE ADDRESS
043779,000125: 4724 56002 XCH Q # INTERPRETIVE ADDRESS TO Q, FETCHING L+1
043780,000126: 4725 56164 XCH LOC # L+1 TO LOC, RETRIEVING ORIGINAL A
043781,000127: 4726 14643 TCF Q+10000
043782,000128:
Page 996 |
043784,000130: # THERE ARE FOUR POSSIBLE SETTINGS FOR CHANNEL 07. (CHANNEL 07 CONTAINS THE SUPERBANK SETTING.)
043785,000131:
043786,000132: # PSEUDO-FIXED OCTAL PSEUDO
043787,000133: # SUPERBANK SETTING S-REG. VALUE BANK NUMBERS ADDRESSES
043788,000134: # ---------- ------- ------------ ------------ ------------
043789,000135: # SUPERBANK 3 0XX 2000 - 3777 30 - 37 70000 - 107777 (WHERE XX CAN BE ANYTHING AND
043790,000136: # WILL USUALLY BE SEEN AS 11)
043791,000137: # SUPERBANK 4 100 2000 - 3777 40 - 47 110000 - 127777 (AS FAR AS IT CAN BE SEEN,
043792,000138: # ONLY BANKS 40-43 WILL EVER BE
043793,000139: # AND ARE PRESENTLY AVAILABLE)
043794,000140: # SUPERBANK 5 101 2000 - 3777 50 - 57 130000 - 147777 (PRESENTLY NOT AVAILABLE TO
043795,000141: # THE USER)
043796,000142: # SUPERBANK 6 110 2000 - 3777 60 - 67 150000 - 167777 (PRESENTLY NOT AVAILABLE TO
043797,000143: # THE USER)
043798,000144: # *** THIS ROUTINE MAY BE CALLED BY ANY PROGRAM LOCATED IN BANKS 00 - 27. I.E., NO PROGRAM LIVING IN ANY
043799,000145: # SUPERBANK SHOULD USE SUPERSW. ***
043800,000146:
043801,000147: # SUPERSW MAY BE CALLED IN THIS FASHION:
043802,000148: # CAF ABBCON WHERE -- ABBCON BBCON SOMETHIN --
043803,000149: # TCR SUPERSW (THE SUPERBNK BITS ARE IN THE BBCON)
043804,000150: # ... ...
043805,000151: # . .
043806,000152: # . .
043807,000153: # OR IN THIS FASHION:
043808,000154: # CAF SUPERSET WHERE SUPERSET IS ONE OF THE FOUR AVAILABLE
043809,000155: # TCR SUPERSW SUPERBANK BIT CONSTANTS:
043810,000156: # ... ... SUPER011 OCTAL 60
043811,000157: # . . SUPER100 OCTAL 100
043812,000158: # . . SUPER101 OCTAL 120
043813,000159: # SUPER110 OCTAL 140
043814,000160:
043815,000161: 4727 00006 SUPERSW EXTEND
043816,000162: 4730 01007 WRITE SUPERBNK # WRITE BITS 7-6-5 OF THE ACCUMULATOR INTO
043817,000163: # CHANNEL 07
043818,000164: 4731 00002 TC Q # TC TO INSTRUCTION FOLLOWING
043819,000165: # TC SUPERSW
043820,000166:
End of include-file INTER-BANK_COMMUNICATION.agc. Parent file is MAIN.agc