mirror of
https://github.com/sampletext32/ParkanPlayground.git
synced 2025-06-20 08:18:36 +03:00
Updated instruction handlers to use Type and StructuredOperands instead of Mnemonic and Operands
This commit is contained in:
32
X86Disassembler/X86/Operands/ImmediateOperand.cs
Normal file
32
X86Disassembler/X86/Operands/ImmediateOperand.cs
Normal file
@ -0,0 +1,32 @@
|
||||
namespace X86Disassembler.X86.Operands;
|
||||
|
||||
/// <summary>
|
||||
/// Represents an immediate value operand in an x86 instruction
|
||||
/// </summary>
|
||||
public class ImmediateOperand : Operand
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the immediate value
|
||||
/// </summary>
|
||||
public long Value { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the ImmediateOperand class
|
||||
/// </summary>
|
||||
/// <param name="value">The immediate value</param>
|
||||
/// <param name="size">The size of the value in bits</param>
|
||||
public ImmediateOperand(long value, int size = 32)
|
||||
{
|
||||
Type = OperandType.ImmediateValue;
|
||||
Value = value;
|
||||
Size = size;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string representation of this operand
|
||||
/// </summary>
|
||||
public override string ToString()
|
||||
{
|
||||
return $"0x{Value:X}";
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user