diff --git a/src/arm7tdmi/thumb/exec.rs b/src/arm7tdmi/thumb/exec.rs index 9727f0b..85c608e 100644 --- a/src/arm7tdmi/thumb/exec.rs +++ b/src/arm7tdmi/thumb/exec.rs @@ -375,6 +375,8 @@ impl Core { } } + self.gpr[rb] = addr as u32; + Ok(CpuPipelineAction::IncPC) } diff --git a/src/arm7tdmi/thumb/mod.rs b/src/arm7tdmi/thumb/mod.rs index 84ff609..748c7ca 100644 --- a/src/arm7tdmi/thumb/mod.rs +++ b/src/arm7tdmi/thumb/mod.rs @@ -219,7 +219,10 @@ impl ThumbInstruction { } pub fn rb(&self) -> usize { - self.raw.bit_range(3..6) as usize + match self.fmt { + ThumbFormat::LdmStm => self.raw.bit_range(8..11) as usize, + _ => self.raw.bit_range(3..6) as usize, + } } pub fn ro(&self) -> usize {