I've refactored a bit and completed the shift op2 logic.
Added Type trait for ALU instructions to know if it is logical or arithmetical
I moved the get_operand logic to a separate function
I refactored a bit the shift logic: now barrel shifter operations correctly set the carry flag when the instruction is logical and S is set
I know that 09a20b5b9f95fbc6f301b13b321c79b194b1f9f7 is big but it doesn't make sense to me to split it, since it's all about the same task, but let me know :)
I think the barrel shifter logic is complex enough to be worth quite some tests. I didn't have time yet to add them but they're for sure needed.
I've refactored a bit and completed the shift op2 logic.
Type
trait for ALU instructions to know if it is logical or arithmeticalget_operand
logic to a separate functionshift
logic: now barrel shifter operations correctly set the carry flag when the instruction is logical andS
is setI know that
09a20b5b9f95fbc6f301b13b321c79b194b1f9f7
is big but it doesn't make sense to me to split it, since it's all about the same task, but let me know :)I think the barrel shifter logic is complex enough to be worth quite some tests. I didn't have time yet to add them but they're for sure needed.