mirror of
https://github.com/sampletext32/ParkanPlayground.git
synced 2025-06-21 00:28: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/FPURegisterOperand.cs
Normal file
32
X86Disassembler/X86/Operands/FPURegisterOperand.cs
Normal file
@ -0,0 +1,32 @@
|
||||
namespace X86Disassembler.X86.Operands;
|
||||
|
||||
/// <summary>
|
||||
/// Represents an FPU register operand (ST(0) to ST(7))
|
||||
/// </summary>
|
||||
public class FPURegisterOperand : Operand
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the FPU register index (0-7)
|
||||
/// </summary>
|
||||
public FpuRegisterIndex RegisterIndex { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the FPURegisterOperand class
|
||||
/// </summary>
|
||||
/// <param name="registerIndex">The FPU register index (RegisterIndex.A to RegisterIndex.Di)</param>
|
||||
public FPURegisterOperand(FpuRegisterIndex registerIndex)
|
||||
{
|
||||
RegisterIndex = registerIndex;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string representation of the FPU register operand
|
||||
/// </summary>
|
||||
/// <returns>A string representation of the FPU register operand</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
// Convert RegisterIndex to a numerical index (0-7)
|
||||
int index = (int)RegisterIndex;
|
||||
return $"ST({index})";
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user