0
mirror of https://github.com/sampletext32/ParkanPlayground.git synced 2025-06-20 08:18:36 +03:00

more cleanup

This commit is contained in:
bird_egop
2025-04-15 02:42:47 +03:00
parent 49f1d7d221
commit abe4d38d4b
97 changed files with 160 additions and 219 deletions

View File

@ -1,6 +1,6 @@
namespace X86Disassembler.X86.Handlers.Add;
using X86Disassembler.X86.Operands;
using Operands;
/// <summary>
/// Handler for ADD r/m8, imm8 instruction (0x80 /0)
@ -29,8 +29,7 @@ public class AddImmToRm8Handler : InstructionHandler
if (!Decoder.CanReadByte())
return false;
byte modRM = Decoder.PeakByte();
byte reg = (byte) ((modRM & 0x38) >> 3);
var reg = ModRMDecoder.PeakModRMReg();
return reg == 0; // 0 = ADD
}
@ -52,7 +51,7 @@ public class AddImmToRm8Handler : InstructionHandler
}
// Read the ModR/M byte
var (mod, reg, rm, destOperand) = ModRMDecoder.ReadModRM();
var (_, _, _, destOperand) = ModRMDecoder.ReadModRM();
// Adjust the operand size to 8-bit
destOperand.Size = 8;