namespace X86Disassembler.X86.Operands;
///
/// Represents a standard register operand (16/32/64-bit) in an x86 instruction
///
public class RegisterOperand : Operand
{
///
/// Gets or sets the register
///
public RegisterIndex Register { get; set; }
///
/// Initializes a new instance of the RegisterOperand class
///
/// The register
/// The size of the register in bits (16, 32, or 64)
public RegisterOperand(RegisterIndex register, int size = 32)
{
Type = OperandType.Register;
Register = register;
Size = size;
}
///
/// Returns a string representation of this operand
///
public override string ToString()
{
return ModRMDecoder.GetRegisterName(Register, Size);
}
}