cpu/arm: fix MSR by changing modes

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
2024-06-13 03:55:08 +05:30
parent c4a9c5ee5e
commit eaa4abcb90

View File

@@ -377,6 +377,11 @@ Instruction::exec(Cpu& cpu) {
pc_error(data.operand); pc_error(data.operand);
if (cpu.cpsr.mode() != Mode::User) { if (cpu.cpsr.mode() != Mode::User) {
if (!data.spsr) {
Psr tmp = Psr(cpu.gpr[data.operand]);
cpu.chg_mode(tmp.mode());
}
psr.set_all(cpu.gpr[data.operand]); psr.set_all(cpu.gpr[data.operand]);
} }
break; break;