From f31699d9216963ce823d56af795295d9063f7d58 Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Sun, 20 Nov 2022 15:36:40 -0400 Subject: [PATCH] fix(log): logged improper second opcode for THUMB BL --- src/util.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.zig b/src/util.zig index 77df231..94a21c7 100644 --- a/src/util.zig +++ b/src/util.zig @@ -145,7 +145,7 @@ pub const Logger = struct { if (cpu.cpsr.t.read()) { if (opcode >> 11 == 0x1E) { // Instruction 1 of a BL Opcode, print in ARM mode - const low = cpu.bus.dbgRead(u16, cpu.r[15]); + const low = cpu.bus.dbgRead(u16, cpu.r[15] - 2); const bl_opcode = @as(u32, opcode) << 16 | low; self.print(arm_fmt, Self.fmtArgs(cpu, bl_opcode)) catch @panic("failed to write to log file");