public byte Execute(AluCmd command, byte x, byte y, ref StatusRegister status) { byte result = 0; try { result = checked((byte)commands[command](x, y)); status = status.SetOverflow(false, registerFactory); } catch (OverflowException) { result = unchecked((byte)commands[command](x, y)); status = status.SetOverflow(true, registerFactory); } status = status.SetSigned((result & 0x80) != 0, registerFactory); status = status.SetZero(result == 0, registerFactory); return result; }
public MicroInstruction(int address, NextAddress nextAddress, bool enableValue, int value, JumpCriterion jumpCriterion, bool clearInterrupt, bool affected, AluCmd aluCommand, Source source, Destination destination, DataInput dataInput, ReadWrite readWrite) { this.Address = address; this.NextAddress = nextAddress; this.EnableValue = enableValue; this.Value = value; this.JumpCriterion = jumpCriterion; this.ClearInterrupt = clearInterrupt; this.AffectFlags = affected; this.AluCommand = aluCommand; this.Source = source; this.Destination = destination; this.DataInput = dataInput; this.ReadWrite = readWrite; }