thumb: Word align PC when jumping to Arm code
Former-commit-id: 55fa28246c45a6bd807c53ce8bf0bb5865d36564
This commit is contained in:
parent
6ddb136852
commit
0bdf4993ee
|
@ -114,10 +114,12 @@ impl Core {
|
||||||
insn.rs()
|
insn.rs()
|
||||||
};
|
};
|
||||||
|
|
||||||
let addr = self.get_reg(src_reg);
|
let mut addr = self.get_reg(src_reg);
|
||||||
if addr.bit(0) {
|
if addr.bit(0) {
|
||||||
self.cpsr.set_state(CpuState::THUMB);
|
self.cpsr.set_state(CpuState::THUMB);
|
||||||
} else {
|
} else {
|
||||||
|
// word align when switching to arm state
|
||||||
|
addr = addr & !0x3;
|
||||||
self.cpsr.set_state(CpuState::ARM);
|
self.cpsr.set_state(CpuState::ARM);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue