diff --git a/src/arm7tdmi/thumb/exec.rs b/src/arm7tdmi/thumb/exec.rs index a5c66b0..7d9bcc7 100644 --- a/src/arm7tdmi/thumb/exec.rs +++ b/src/arm7tdmi/thumb/exec.rs @@ -114,10 +114,12 @@ impl Core { insn.rs() }; - let addr = self.get_reg(src_reg); + let mut addr = self.get_reg(src_reg); if addr.bit(0) { self.cpsr.set_state(CpuState::THUMB); } else { + // word align when switching to arm state + addr = addr & !0x3; self.cpsr.set_state(CpuState::ARM); }