cpu: arm: Fix R14 for branch with link instruction

Former-commit-id: bc927d86e5a170b0e4568b4ceeb7832d23ad309c
This commit is contained in:
Michel Heily 2019-07-01 19:24:52 +03:00
parent ea8c4f2a60
commit 2081b70ee2

View file

@ -42,7 +42,7 @@ impl Core {
insn: ArmInstruction,
) -> CpuResult<CpuPipelineAction> {
if insn.link_flag() {
self.set_reg(14, self.pc & !0b1);
self.set_reg(14, (insn.pc + (self.word_size() as u32)) & !0b1);
}
// +1N