From 19e41963845118ecc8c594f3c788124e3f399a0c Mon Sep 17 00:00:00 2001 From: Michel Heily Date: Tue, 9 Jul 2019 01:28:14 +0300 Subject: [PATCH] Thumb 4 - Set flags if needed (For CMP) Former-commit-id: 4f5bc97375c8aa45036b025a3420331a8137da17 --- src/arm7tdmi/thumb/exec.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/arm7tdmi/thumb/exec.rs b/src/arm7tdmi/thumb/exec.rs index 7d9bcc7..6c4f999 100644 --- a/src/arm7tdmi/thumb/exec.rs +++ b/src/arm7tdmi/thumb/exec.rs @@ -147,9 +147,10 @@ impl Core { insn.rs() }; let arm_alu_op: AluOpCode = insn.format5_op().into(); + let set_flags = arm_alu_op.is_setting_flags(); let op1 = self.get_reg(dst_reg) as i32; let op2 = self.get_reg(src_reg) as i32; - let result = self.alu(arm_alu_op, op1, op2, false); + let result = self.alu(arm_alu_op, op1, op2, set_flags); if let Some(result) = result { self.set_reg(dst_reg, result as u32); if dst_reg == REG_PC {