diff --git a/Processor.cs b/Processor.cs index 0c05e5d..4c2ea0d 100644 --- a/Processor.cs +++ b/Processor.cs @@ -452,6 +452,10 @@ public bool Step() default: throw new InvalidOperationException($"{opcodeLow:X} is not a recognised division low opcode"); } + if ((Registers[Data.Register.rsf] & 0b10) != 0) + { + Registers[Data.Register.rsf] ^= 0b10; + } if (Registers[targetRegister] == 0) { Registers[Data.Register.rsf] |= 0b1; @@ -591,6 +595,10 @@ public bool Step() default: throw new InvalidOperationException($"{opcodeLow:X} is not a recognised bitwise low opcode"); } + if ((Registers[Data.Register.rsf] & 0b10) != 0) + { + Registers[Data.Register.rsf] ^= 0b10; + } if (Registers[targetRegister] == 0) { Registers[Data.Register.rsf] |= 0b1;