fix(log): logged improper second opcode for THUMB BL

This commit is contained in:
Rekai Nyangadzayi Musuka 2022-11-20 15:36:40 -04:00
parent 96a9ae2ca5
commit f31699d921
1 changed files with 1 additions and 1 deletions

View File

@ -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");