From 91ed230d8324cded1a5d82cf8f85d9d81af00956 Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Mon, 31 Oct 2022 19:14:05 -0700 Subject: Only use DF for addresses generated via indirection. --- isa/checker.cpp | 3 ++- isa/decode.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'isa') diff --git a/isa/checker.cpp b/isa/checker.cpp index 770d9d6..6eaa15f 100644 --- a/isa/checker.cpp +++ b/isa/checker.cpp @@ -21,7 +21,8 @@ void checker::execute() { addr = (addr + 1) & 07777; mem.store(*inst.init_address, addr); } - inst.final_address = addr; + auto df = ctlregs[DATA_INSTRUCTION_FIELD_BUFFER] >> 3; + inst.final_address = (df << 12) | addr; } else { assert(!inst.need_autoinc_store); } diff --git a/isa/decode.cpp b/isa/decode.cpp index af38c64..f183c1f 100644 --- a/isa/decode.cpp +++ b/isa/decode.cpp @@ -373,7 +373,7 @@ instruction_context decode(unsigned int dfifb, unsigned int pc, unsigned int bit // Instructions with memory operands may be direct or indirect if (inst.need_exec_load || inst.need_exec_store || inst.possibly_redirects) { - auto addr = (df << 12) | ((bits & 00200) ? (pc & 07600) : 0) | (bits & 00177); + auto addr = (pc & 070000) | ((bits & 00200) ? (pc & 07600) : 0) | (bits & 00177); if (bits & 00400) { inst.need_indirect_load = true; inst.init_address = addr; -- cgit v1.2.3