From 5b9022371748681d62ddd02750ab861087bd5f6e Mon Sep 17 00:00:00 2001 From: Michel Heily Date: Fri, 17 Jan 2020 13:04:14 +0200 Subject: [PATCH] fix(tests): Fix thumb t225 THUMB 14: Push / pop do not align base Former-commit-id: e8f511387edf5bd2f3991558f7757f997d0289c7 --- src/core/arm7tdmi/thumb/exec.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/arm7tdmi/thumb/exec.rs b/src/core/arm7tdmi/thumb/exec.rs index c3ba127..14666de 100644 --- a/src/core/arm7tdmi/thumb/exec.rs +++ b/src/core/arm7tdmi/thumb/exec.rs @@ -12,10 +12,9 @@ fn push(cpu: &mut Core, bus: &mut SysBus, r: usize) { bus.write_32(stack_addr, cpu.get_reg(r)) } fn pop(cpu: &mut Core, bus: &mut SysBus, r: usize) { - let stack_addr = cpu.gpr[REG_SP] & !3; - let val = cpu.ldr_word(stack_addr, bus); + let val = bus.read_32(cpu.gpr[REG_SP] & !3); cpu.set_reg(r, val); - cpu.gpr[REG_SP] = stack_addr + 4; + cpu.gpr[REG_SP] += 4; } impl Core {