From 3f6b5e337b282bd8675a97e048e267e6f90ccec6 Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Mon, 17 Oct 2022 17:54:53 -0700 Subject: Clean up address handling and change autoinc to preincrement --- isa/checker.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'isa/checker.cpp') diff --git a/isa/checker.cpp b/isa/checker.cpp index 7bca5c9..770d9d6 100644 --- a/isa/checker.cpp +++ b/isa/checker.cpp @@ -17,8 +17,10 @@ void checker::execute() { if (inst.need_indirect_load) { auto addr = mem.fetch(inst.init_address.value()); - if (inst.need_autoinc_store) - mem.store(*inst.init_address, (addr + 1) & 07777); + if (inst.need_autoinc_store) { + addr = (addr + 1) & 07777; + mem.store(*inst.init_address, addr); + } inst.final_address = addr; } else { assert(!inst.need_autoinc_store); -- cgit v1.2.3