Source Code
These source-code files are part of a reconstructed copy of Artemis 071, the
first release of the Apollo 15 through 17 Command Module (CM) Apollo Guidance
Computer (AGC) software.
The reconstruction began with source code of Artemis 072 previously transcribed from a digitized copy of that program. The code was then updated by undoing changes between the two versions. The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021154-. Note that page numbers in the reconstructed code match those on the Artemis 072 printout, although the changed code would likely have changed page numbers for a real Artemis 071 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. |
048103,000002: ## Copyright: Public domain.
048104,000003: ## Filename: INTER-BANK_COMMUNICATION.agc
048105,000004: ## Purpose: A section of Artemis revision 071.
048106,000005: ## It is part of the reconstructed source code for the first
048107,000006: ## release of the flight software for the Command Module's
048108,000007: ## (CM) Apollo Guidance Computer (AGC) for Apollo 15 through
048109,000008: ## 17. The code has been recreated from a copy of Artemis 072.
048110,000009: ## It has been adapted such that the resulting bugger words
048111,000010: ## exactly match those specified for Artemis 071 in NASA
048112,000011: ## drawing 2021154-, which gives relatively high confidence
048113,000012: ## that the reconstruction is correct.
048114,000013: ## Reference: 1104
048115,000014: ## Assembler: yaYUL
048116,000015: ## Contact: Ron Burkey <info@sandroid.org>.
048117,000016: ## Website: www.ibiblio.org/apollo/index.html
048118,000017: ## Mod history: 2019-08-14 MAS Created from Artemis 072.
048119,000018:
Page 1104 |
048121,000020:
048122,000021: # THE FOLLOWING ROUTINE CAN BE USED TO CALL A SUBROUTINE IN ANOTHER BANK. IN THE BANKCALL VERSION, THE
048123,000022: # CADR OF THE SUBROUTINE IMMEDIATELY FOLLOWS THE TC BANKCALL INSTRUCTION, WITH C(A) AND C(L) PRESERVED.
048124,000023:
048125,000024: 4000 SETLOC FFTAG1
048126,000025: 4000 BANK
048127,000026:
048128,000027: 4636 COUNT* $$/BANK
048129,000028: 4636 52134 BANKCALL DXCH BUF2 # SAVE INCOMING A,L.
048130,000029: 4637 50002 INDEX Q # PICK UP CADR.
048131,000030: 4640 30000 CA 0
048132,000031: 4641 24002 -1 INCR Q # SO WE RETURN TO THE LOC. AFTER THE CADR.
048133,000032:
048134,000033: # SWCALL IS IDENTICAL TO BANKCALL, EXCEPT THAT THE CADR ARRIVES IN A.
048135,000034:
048136,000035: 4642 54001 SWCALL TS L
048137,000036: 4643 22004 LXCH FBANK # SWITCH BANKS, SAVING RETURN.
048138,000037: 4644 75041 MASK LOW10 # GET SUB-ADDRESS OF CADR.
048139,000038: 4645 56002 XCH Q # A,L NOW CONTAINS DP RETURN.
048140,000039: 4646 52134 DXCH BUF2 # RESTORING INPUTS IF THIS IS A BANKCALL.
048141,000040: 4647 50002 INDEX Q
048142,000041: 4650 02000 TC 10000 # SETTING Q TO SWRETURN.
048143,000042:
048144,000043: 4651 56134 SWRETURN XCH BUF2 +1 # COMES HERE TO RETURN TO CALLER. C(A,L)
048145,000044: 4652 56004 XCH FBANK # ARE PRESERVED FOR RETURN.
048146,000045: 4653 56134 XCH BUF2 +1
048147,000046: 4654 00133 TC BUF2
048148,000047:
048149,000048: # THE FOLLOWING ROUTINE CAN BE USED AS A UNILATERAL JUMP WITH C(A,L) PRESERVED AND THE CADR IMMEDIATELY
048150,000049: # FOLLOWING THE TC POSTJUMP INSTRUCTION.
048151,000050:
048152,000051: 4655 56002 POSTJUMP XCH Q # SAVE INCOMING C(A).
048153,000052: 4656 50000 INDEX A # GET CADR.
048154,000053: 4657 30000 CA 0
048155,000054:
048156,000055: # BANKJUMP IS THE SAME AS POSTJUMP, EXCEPT THAT THE CADR ARRIVES IN A.
048157,000056:
048158,000057: 4660 54004 BANKJUMP TS FBANK
048159,000058: 4661 75041 MASK LOW10
048160,000059: 4662 56002 XCH Q # RESTORING INPUT C(A) IF THIS WAS A
048161,000060: 4663 50002 Q+10000 INDEX Q # POSTJUMP.
048162,000061: 4664 12000 PRIO12 TCF 10000 # PRIO12 = TCF 10000 = 12000
048163,000062:
Page 1105 |
048165,000064:
048166,000065: # THE FOLLOWING ROUTINE GETS THE RETURN CADR SAVED BY SWCALL OR BANKCALL AND LEAVES IT IN A.
048167,000066:
048168,000067: 4665 35041 MAKECADR CAF LOW10
048169,000068: 4666 70133 MASK BUF2
048170,000069: 4667 60134 AD BUF2 +1
048171,000070: 4670 00002 TC Q
048172,000071:
048173,000072: 4671 54135 SUPDACAL TS MPTEMP
048174,000073: 4672 56004 XCH FBANK # SET FBANK FOR DATA.
048175,000074: 4673 00006 EXTEND
048176,000075: 4674 04007 ROR SUPERBNK # SAVE FBANK IN BITS 15-11, AND
048177,000076: 4675 56135 XCH MPTEMP # SUPERBANK IN BITS 7-5.
048178,000077: 4676 75041 MASK LOW10
048179,000078: 4677 56001 XCH L # SAVE REL. ADR. IN BANK, FETCH SUPERBITS.
048180,000079: 4700 00004 INHINT # BECAUSE RUPT DOES NOT SAVE SUPERBANK.
048181,000080: 4701 00006 EXTEND
048182,000081: 4702 01007 WRITE SUPERBNK # SET SUPERBANK FOR DATA.
048183,000082: 4703 50001 INDEX L
048184,000083: 4704 32000 CA 10000 # PINBALL (FIX MEM DISP) PREVENTS DCA HERE
048185,000084: 4705 56135 XCH MPTEMP # SAVE 1ST WD, FETCH OLD FBANK AND SBANK.
048186,000085: 4706 00006 EXTEND
048187,000086: 4707 01007 WRITE SUPERBNK # RESTORE SUPERBANK.
048188,000087: 4710 00003 RELINT
048189,000088: 4711 54004 TS FBANK # RESTORE FBANK.
048190,000089: 4712 30135 CA MPTEMP # RECOVER FIRST WORD OF DATA.
048191,000090: 4713 00002 RETURN # 24 WDS. DATACALL 516 MU, SUPDACAL 432 MU
048192,000091:
Page 1106 |
048194,000093:
048195,000094: # THE FOLLOWING ROUTINES ARE IDENTICAL TO BANKCALL AND SWCALL EXCEPT THAT THEY ARE USED IN INTERRUPT.
048196,000095:
048197,000096: 4714 52073 IBNKCALL DXCH RUPTREG3 # USES RUPTREG3,4 FOR DP RETURN ADDRESS.
048198,000097: 4715 50002 INDEX Q
048199,000098: 4716 30000 CAF 0
048200,000099: 4717 24002 INCR Q
048201,000100:
048202,000101: 4720 54001 ISWCALL TS L
048203,000102: 4721 22004 LXCH FBANK
048204,000103: 4722 75041 MASK LOW10
048205,000104: 4723 56002 XCH Q
048206,000105: 4724 52073 DXCH RUPTREG3
048207,000106: 4725 50002 INDEX Q
048208,000107: 4726 02000 TC 10000
048209,000108:
048210,000109: 4727 56073 ISWRETRN XCH RUPTREG4
048211,000110: 4730 56004 XCH FBANK
048212,000111: 4731 56073 XCH RUPTREG4
048213,000112: 4732 00072 TC RUPTREG3
048214,000113:
048215,000114: # 2. USPRCADR ACCESSES INTERPRETIVE CODING IN OTHER THAN THE USER'S FBANK. THE CALLING SEQUENCE IS AS FOLLOWS:
048216,000115:
048217,000116: # L TC USPRCADR
048218,000117: # L+1 CADR INTPRETX INTPRETX IS THE INTERPRETIVE CODING
048219,000118: # RETURN IS TO L+2
048220,000119:
048221,000120: 4733 54164 USPRCADR TS LOC # SAVE A
048222,000121: 4734 34761 CA BIT8
048223,000122: 4735 54023 TS EDOP # EXIT INSTRUCTION TO EDOP
048224,000123: 4736 30006 CA BBANK
048225,000124: 4737 54165 TS BANKSET # USER'S BBANK TO BANKSET
048226,000125: 4740 50002 INDEX Q
048227,000126: 4741 30000 CA 0
048228,000127: 4742 54004 TS FBANK # INTERPRETIVE BANK TO FBANK
048229,000128: 4743 75041 MASK LOW10 # YIELDS INTERPRETIVE RELATIVE ADDRESS
048230,000129: 4744 56002 XCH Q # INTERPRETIVE ADDRESS TO Q, FETCHING L+1
048231,000130: 4745 56164 XCH LOC # L+1 TO LOC, RETRIEVING ORIGINAL A
048232,000131: 4746 14663 TCF Q+10000
048233,000132:
Page 1107 |
048235,000134:
048236,000135: # THERE ARE FOUR POSSIBLE SETTINGS FOR CHANNEL 07. (CHANNEL 07 CONTAINS THE SUPERBANK SETTING.)
048237,000136:
048238,000137: # PSEUDO-FIXED OCTAL PSEUDO
048239,000138: # SUPERBANK SETTING S-REG. VALUE BANK NUMBERS ADDRESSES
048240,000139: # ---------- ------- ------------ ------------ ------------
048241,000140: # SUPERBANK 3 0XX 2000 - 3777 30 - 37 70000 - 107777 (WHERE XX CAN BE ANYTHING AND
048242,000141: # WILL USUALLY BE SEEN AS 11)
048243,000142: # SUPERBANK 4 100 2000 - 3777 40 - 47 110000 - 127777 (AS FAR AS IT CAN BE SEEN,
048244,000143: # ONLY BANKS 40-43 WILL EVER BE
048245,000144: # AND ARE PRESENTLY AVAILABLE)
048246,000145: # SUPERBANK 5 101 2000 - 3777 50 - 57 130000 - 147777 (PRESENTLY NOT AVAILABLE TO
048247,000146: # THE USER)
048248,000147: # SUPERBANK 6 110 2000 - 3777 60 - 67 150000 - 167777 (PRESENTLY NOT AVAILABLE TO
048249,000148: # THE USER)
048250,000149:
End of include-file INTER-BANK_COMMUNICATION.agc. Parent file is MAIN.agc