From 62e698791999b1e940d00cb222bcec2b93688dd9 Mon Sep 17 00:00:00 2001 From: TQ Hirsch Date: Tue, 26 Sep 2023 23:54:53 +0200 Subject: [PATCH] Fixed a misunderstanding of autoincrement/autodecrement mode; now EKBB prints its header message --- src/main/kotlin/com/thequux/mcpdp/core/CPU.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/com/thequux/mcpdp/core/CPU.kt b/src/main/kotlin/com/thequux/mcpdp/core/CPU.kt index 8ed5540..53a0bd6 100644 --- a/src/main/kotlin/com/thequux/mcpdp/core/CPU.kt +++ b/src/main/kotlin/com/thequux/mcpdp/core/CPU.kt @@ -731,7 +731,7 @@ class CPU(val mbus: MemBus, val tracer: ITracer = NullTracer()) { val mode = operand shr 3 val reg = operand and 0x7 val is_pc = reg == 7 - val increment = if (byte_mode && !is_pc) 1U else 2U + val increment = if (byte_mode && reg < 6) 1U else 2U val decoded = 0x80_FFFFu and when (mode and 0x7) { 0 -> reg.toUInt() bis PADDR_REG_BIT 1 -> registers[reg].toUInt()