mirror of
https://github.com/sampletext32/ParkanPlayground.git
synced 2025-06-20 08:18:36 +03:00
more cleanup
This commit is contained in:
@ -30,8 +30,7 @@ public class AddImmToRm32Handler : 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
|
||||
}
|
||||
@ -53,7 +52,7 @@ public class AddImmToRm32Handler : InstructionHandler
|
||||
}
|
||||
|
||||
// Read the ModR/M byte
|
||||
var (mod, reg, rm, destOperand) = ModRMDecoder.ReadModRM();
|
||||
var (_, _, _, destOperand) = ModRMDecoder.ReadModRM();
|
||||
|
||||
// Read the immediate value
|
||||
if (!Decoder.CanReadUInt())
|
||||
|
@ -30,8 +30,7 @@ public class AddImmToRm32SignExtendedHandler : 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 AddImmToRm32SignExtendedHandler : InstructionHandler
|
||||
}
|
||||
|
||||
// Read the ModR/M byte
|
||||
var (mod, reg, rm, destOperand) = ModRMDecoder.ReadModRM();
|
||||
var (_, _, _, destOperand) = ModRMDecoder.ReadModRM();
|
||||
|
||||
// Check if we have enough bytes for the immediate value
|
||||
if (!Decoder.CanReadByte())
|
||||
|
@ -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;
|
||||
|
@ -47,7 +47,7 @@ public class AddR32Rm32Handler : InstructionHandler
|
||||
// - The reg field specifies the destination register
|
||||
// - The r/m field with mod specifies the source operand (register or memory)
|
||||
// The sourceOperand is already created by ModRMDecoder based on mod and rm fields
|
||||
var (mod, reg, rm, sourceOperand) = ModRMDecoder.ReadModRM();
|
||||
var (_, reg, _, sourceOperand) = ModRMDecoder.ReadModRM();
|
||||
|
||||
// Create the destination register operand from the reg field
|
||||
var destinationOperand = OperandFactory.CreateRegisterOperand(reg, 32);
|
||||
|
@ -47,7 +47,7 @@ public class AddRm32R32Handler : InstructionHandler
|
||||
// - The r/m field with mod specifies the destination operand (register or memory)
|
||||
// - The reg field specifies the source register
|
||||
// The destinationOperand is already created by ModRMDecoder based on mod and rm fields
|
||||
var (mod, reg, rm, destinationOperand) = ModRMDecoder.ReadModRM();
|
||||
var (_, reg, _, destinationOperand) = ModRMDecoder.ReadModRM();
|
||||
|
||||
// Create the source register operand from the reg field
|
||||
var sourceOperand = OperandFactory.CreateRegisterOperand(reg, 32);
|
||||
|
Reference in New Issue
Block a user