mirror of
https://github.com/sampletext32/ParkanPlayground.git
synced 2025-12-11 04:51:21 +04:00
Refactored register operands to separate 8-bit registers into dedicated Register8Operand class
This commit is contained in:
31
X86Disassembler/X86/Operands/Register8Operand.cs
Normal file
31
X86Disassembler/X86/Operands/Register8Operand.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
namespace X86Disassembler.X86.Operands;
|
||||
|
||||
/// <summary>
|
||||
/// Represents an 8-bit register operand in an x86 instruction
|
||||
/// </summary>
|
||||
public class Register8Operand : Operand
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the 8-bit register
|
||||
/// </summary>
|
||||
public RegisterIndex8 Register { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the Register8Operand class
|
||||
/// </summary>
|
||||
/// <param name="register">The 8-bit register</param>
|
||||
public Register8Operand(RegisterIndex8 register)
|
||||
{
|
||||
Type = OperandType.Register;
|
||||
Register = register;
|
||||
Size = 8; // Always 8 bits for this operand type
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string representation of this operand
|
||||
/// </summary>
|
||||
public override string ToString()
|
||||
{
|
||||
return ModRMDecoder.GetRegisterName(Register);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user