1
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:
bird_egop
2025-04-16 01:10:33 +03:00
parent 46592d4877
commit e06ea2beb3
12 changed files with 148 additions and 53 deletions

View 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);
}
}