/// <summary> /// Calculate a special debug opcode that sets a position entry. /// </summary> /// <returns>True if the special opcode is valid, false otherwise</returns> private static bool TryCalculateSpecialOpcode(int lineAdv, int addressAdv, out DebugOpCodes opcode) { const int lineBase = -4; const int lineRange = 15; opcode = DebugOpCodes.Special; if ((lineAdv < -4) || (lineAdv > 10) || (addressAdv > 16)) { return(false); } if (addressAdv < 0) { throw new ArgumentOutOfRangeException("addressAdv > 0"); } var adjusted = (lineAdv - lineBase) + (addressAdv * lineRange); var opcodeAsInt = (int)DebugOpCodes.Special + adjusted; var result = (opcodeAsInt >= 0x0A) && (opcodeAsInt <= 0xFF); opcode = result ? (DebugOpCodes)opcodeAsInt : DebugOpCodes.Special; return(result); }
/// <summary> /// Calculate a special debug opcode that sets a position entry. /// </summary> /// <returns>True if the special opcode is valid, false otherwise</returns> private static bool TryCalculateSpecialOpcode(int lineAdv, int addressAdv, out DebugOpCodes opcode) { const int lineBase = -4; const int lineRange = 15; opcode = DebugOpCodes.Special; if ((lineAdv < -4) || (lineAdv > 10) || (addressAdv > 16)) return false; if (addressAdv < 0) throw new ArgumentOutOfRangeException("addressAdv > 0"); var adjusted = (lineAdv - lineBase) + (addressAdv * lineRange); var opcodeAsInt = (int)DebugOpCodes.Special + adjusted; var result = (opcodeAsInt >= 0x0A) && (opcodeAsInt <= 0xFF); opcode = result ? (DebugOpCodes) opcodeAsInt : DebugOpCodes.Special; return result; }
public DebugInstruction(DebugOpCodes opCode, IEnumerable <object> operands) { this.opCode = opCode; this.operands = new List <object>(operands); }
public DebugInstruction(DebugOpCodes opCode, params object[] operands) : this(opCode, (IEnumerable <object>)operands) { }
public DebugInstruction(DebugOpCodes opCode, IEnumerable<object> operands) { this.opCode = opCode; this.operands = new List<object>(operands); }
public DebugInstruction(DebugOpCodes opCode, params object[] operands) : this(opCode, (IEnumerable<object>)operands) { }