Is your feature request related to a problem? Please describe.
The CPU lacks basic integer subtraction capabilities. Without SUB and SUBS, the emulator cannot perform fundamental arithmetic operations, loop decrements, or comparisons. Specifically, SUBS is required to update the APSR flags used for conditional branching.
Describe the solution you'd like
Implement the logic for SUB (Subtract without flags) and SUBS (Subtract with flags) in ArithmeticOps.cs.
The operation is defined as: $Rd = Rn - Operand2$.
Acceptance Criteria:
Datasheet Reference
- ARMv6-M Architecture Reference Manual:
- Section A6.7.68 (SUB - immediate)
- Section A6.7.69 (SUB - register)
Is your feature request related to a problem? Please describe.
The CPU lacks basic integer subtraction capabilities. Without
SUBandSUBS, the emulator cannot perform fundamental arithmetic operations, loop decrements, or comparisons. Specifically,SUBSis required to update the APSR flags used for conditional branching.Describe the solution you'd like
$Rd = Rn - Operand2$ .
Implement the logic for
SUB(Subtract without flags) andSUBS(Subtract with flags) inArithmeticOps.cs.The operation is defined as:
Acceptance Criteria:
InstructionDecoder.cs.Datasheet Reference