mirror of
https://github.com/sampletext32/ParkanPlayground.git
synced 2025-06-20 16:18:37 +03:00
Updated instruction handlers to use Type and StructuredOperands instead of Mnemonic and Operands
This commit is contained in:
33
X86Disassembler/X86/Operands/DirectMemoryOperand.cs
Normal file
33
X86Disassembler/X86/Operands/DirectMemoryOperand.cs
Normal file
@ -0,0 +1,33 @@
|
||||
namespace X86Disassembler.X86.Operands;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a direct memory operand in an x86 instruction (e.g., [0x12345678])
|
||||
/// </summary>
|
||||
public class DirectMemoryOperand : MemoryOperand
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the memory address
|
||||
/// </summary>
|
||||
public long Address { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the DirectMemoryOperand class
|
||||
/// </summary>
|
||||
/// <param name="address">The memory address</param>
|
||||
/// <param name="size">The size of the memory access in bits</param>
|
||||
/// <param name="segmentOverride">Optional segment override</param>
|
||||
public DirectMemoryOperand(long address, int size = 32, string? segmentOverride = null)
|
||||
: base(size, segmentOverride)
|
||||
{
|
||||
Type = OperandType.MemoryDirect;
|
||||
Address = address;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string representation of this operand
|
||||
/// </summary>
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{GetSegmentPrefix()}[0x{Address:X}]";
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user