Fix the CMP op: it was not executing all the sub logic (overflow/carry check, etc.)
Fix MOV op: it was not setting the CPSR flags
Extracted the add and sub logic to two separate functions since they are used in many operations (SUB and CMP, ADD and CMN) and there will be more with the same logic: ADC, SBC, RSC. I created a new struct to return the result of an arithmetic operation.
SUB
,RSB
andCMN
ALU opCMP
op: it was not executing all the sub logic (overflow/carry check, etc.)MOV
op: it was not setting theCPSR
flagsSUB
andCMP
,ADD
andCMN
) and there will be more with the same logic:ADC
,SBC
,RSC
. I created a new struct to return the result of an arithmetic operation.