using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Cosmos.Assembler.X86
{
///
/// This class represents a variant of a intructions with a specific asm code and specific operands
///
public class InstructionVariant
{
//public Action ModifyBytes;
//public byte[] OpCode;
public byte[] NasmData;
public List AllowedOperandData { get; set; }
///
/// Gets or sets the requirements like instructionsets
///
/// The requirements.
public InstructionRequirement Requirements { get; set; }
///
/// If ModR/M byte needed, set to true. If true, all other fields on
/// which refer to bytes, can assume an extra ModRM byte.
///
public bool NeedsModRMByte;
public byte InitialModRMByteValue;
public bool ReverseRegisters = false;
public BitSize AllowedSizes = BitSize.Default;
public BitSize DefaultSize = BitSize.Bits32;
public string ToString( InstructionOutputFormat aFormat )
{
string Instruction = "";
string tmp;
switch( aFormat )
{
case InstructionOutputFormat.ASM:
throw new Exception("Fix");
//tmp = Size.ToString();
if( tmp == "" )
return Instruction;
Instruction += tmp + " ";
return Instruction;
}
return "Format not supported.";
}
///
/// The index in OpCode where the OperandSize bit is encoded
///
//public byte? OperandSizeByte;
///
/// The amount of bits the operandsize bit gets shifted to left, if neccessary
///
//public byte OperandSizeBitShiftLeft;
}
}