alu: Fix bug in SBC and RSC ops

Former-commit-id: 1cb23d6280e1816395c46a7571dd9f48df870202
This commit is contained in:
Michel Heily 2019-07-09 01:29:34 +03:00
parent 19e4196384
commit 34233fa654

View file

@ -267,8 +267,8 @@ impl Core {
RSB => Self::alu_sub_flags(op2, op1, &mut carry, &mut overflow),
ADD | CMN => Self::alu_add_flags(op1, op2, &mut carry, &mut overflow),
ADC => Self::alu_add_flags(op1, op2.wrapping_add(C), &mut carry, &mut overflow),
SBC => Self::alu_sub_flags(op1, op2.wrapping_sub(1 - C), &mut carry, &mut overflow),
RSC => Self::alu_sub_flags(op2, op1.wrapping_sub(1 - C), &mut carry, &mut overflow),
SBC => Self::alu_sub_flags(op1, op2, &mut carry, &mut overflow).wrapping_sub(1 - C),
RSC => Self::alu_sub_flags(op2, op1, &mut carry, &mut overflow).wrapping_sub(1 - C),
ORR => op1 | op2,
MOV => op2,
BIC => op1 & (!op2),