public PopInstruction(int offset, Operand operand) : base(offset, operand) { }
/// <summary> /// Determines if a given operand is 8 bit compatible /// If both operands of a binary operation are 8 bit, then it is a 8 bit operation, otherwise it is a 16 bit operation /// </summary> /// <remarks> /// Operands of type sbyte are acounted for as 16 bit operands, as they will always be sign-extended to 16 bit /// </remarks> /// <param name="operand">The operand to test</param> /// <returns>Returns true if the operand is 8 bit compatible, false otherwise</returns> public static bool IsByteOperand(Operand operand) { return !operand.IsDirect || operand.ValueType == typeof(Register8) || operand.ValueType == typeof(byte); }
public ArithmeticInstruction(int offset, ArithmeticOperation operation, Operand destination, Operand source) : base(offset, destination, source) { this.operation = operation; }
private static ushort GetOperandRawValue(SimulationContext context, Operand operand) { if (operand is Operand<Register8>) return context.GetRegister8(((Operand<Register8>)operand).Value); else if (operand is Operand<Register16>) return context.GetRegister16(((Operand<Register16>)operand).Value); else if (operand is Operand<byte>) return ((Operand<byte>)operand).Value; else if (operand is Operand<ushort>) return ((Operand<ushort>)operand).Value; else if (operand is Operand<sbyte>) { if (operand.IsDirect) return (ushort)(context.SP + ((Operand<sbyte>)operand).Value); else return (ushort)(short)((Operand<sbyte>)operand).Value; } else throw new InvalidOperationException(); }
public UnaryInstruction(int offset, Operand operand) : base(offset) { this.operand = operand; }
public LoadInstruction(int offset, LoadOperationType operation, Operand destination, Operand source) : base(offset, destination, source) { this.operation = operation; }
public LoadInstruction(int offset, Operand destination, Operand source) : this(offset, LoadOperationType.Normal, destination, source) { }
public BinaryInstruction(int offset, Operand destination, Operand source) : base(offset) { this.destination = destination; this.source = source; }
public BitInstruction(int offset, BitOperation operation, Operand destination, Operand source) : base(offset, destination, source) { this.operation = operation; }