mirror of
https://github.com/sampletext32/ParkanPlayground.git
synced 2025-06-20 08:18:36 +03:00
Test fixes
This commit is contained in:
@ -52,11 +52,10 @@ public class XorImmWithRm16Handler : InstructionHandler
|
||||
return false;
|
||||
}
|
||||
|
||||
// Read the ModR/M byte
|
||||
var (_, _, _, destinationOperand) = ModRMDecoder.ReadModRM();
|
||||
// Read the ModR/M byte, specifying that we're dealing with 16-bit operands
|
||||
var (_, _, _, destinationOperand) = ModRMDecoder.ReadModRM16();
|
||||
|
||||
// Ensure the destination operand has the correct size (16-bit)
|
||||
destinationOperand.Size = 16;
|
||||
// Note: The operand size is already set to 16-bit by the ReadModRM16 method
|
||||
|
||||
// Check if we have enough bytes for the immediate value
|
||||
if (!Decoder.CanReadUShort())
|
||||
|
@ -55,10 +55,9 @@ public class XorImmWithRm16SignExtendedHandler : InstructionHandler
|
||||
// For XOR r/m16, imm8 (sign-extended) (0x83 /6 with 0x66 prefix):
|
||||
// - The r/m field with mod specifies the destination operand (register or memory)
|
||||
// - The immediate value is the source operand (sign-extended from 8 to 16 bits)
|
||||
var (_, _, _, destinationOperand) = ModRMDecoder.ReadModRM();
|
||||
var (_, _, _, destinationOperand) = ModRMDecoder.ReadModRM16();
|
||||
|
||||
// Adjust the operand size to 16-bit
|
||||
destinationOperand.Size = 16;
|
||||
// Note: The operand size is already set to 16-bit by the ReadModRM16 method
|
||||
|
||||
// Read the immediate value (sign-extended from 8 to 16 bits)
|
||||
if (!Decoder.CanReadByte())
|
||||
|
@ -49,8 +49,7 @@ public class XorImmWithRm8Handler : InstructionHandler
|
||||
// Read the ModR/M byte, specifying that we're dealing with 8-bit operands
|
||||
var (_, _, _, destinationOperand) = ModRMDecoder.ReadModRM8();
|
||||
|
||||
// Ensure the destination operand has the correct size (8-bit)
|
||||
destinationOperand.Size = 8;
|
||||
// Note: The operand size is already set to 8-bit by the ReadModRM8 method
|
||||
|
||||
// Read the immediate value
|
||||
if (!Decoder.CanReadByte())
|
||||
|
@ -47,10 +47,9 @@ public class XorR16Rm16Handler : InstructionHandler
|
||||
// For XOR r16, r/m16 (0x33 with 0x66 prefix):
|
||||
// - The reg field specifies the destination register
|
||||
// - The r/m field with mod specifies the source operand (register or memory)
|
||||
var (_, reg, _, sourceOperand) = ModRMDecoder.ReadModRM();
|
||||
var (_, reg, _, sourceOperand) = ModRMDecoder.ReadModRM16();
|
||||
|
||||
// Adjust the operand size to 16-bit
|
||||
sourceOperand.Size = 16;
|
||||
// Note: The operand size is already set to 16-bit by the ReadModRM16 method
|
||||
|
||||
// Create the destination register operand
|
||||
var destinationOperand = OperandFactory.CreateRegisterOperand(reg, 16);
|
||||
|
@ -40,8 +40,7 @@ public class XorR8Rm8Handler : InstructionHandler
|
||||
// Read the ModR/M byte, specifying that we're dealing with 8-bit operands
|
||||
var (_, reg, _, sourceOperand) = ModRMDecoder.ReadModRM8();
|
||||
|
||||
// Ensure the source operand has the correct size (8-bit)
|
||||
sourceOperand.Size = 8;
|
||||
// Note: The operand size is already set to 8-bit by the ReadModRM8 method
|
||||
|
||||
// Create the destination register operand using the 8-bit register type
|
||||
var destinationOperand = OperandFactory.CreateRegisterOperand8(reg);
|
||||
|
@ -43,15 +43,13 @@ public class XorRm16R16Handler : InstructionHandler
|
||||
return false;
|
||||
}
|
||||
|
||||
// Read the ModR/M byte
|
||||
var (_, reg, _, destinationOperand) = ModRMDecoder.ReadModRM();
|
||||
|
||||
// Create the source register operand (16-bit)
|
||||
// Read the ModR/M byte, specifying that we're dealing with 16-bit operands
|
||||
var (_, reg, _, destinationOperand) = ModRMDecoder.ReadModRM16();
|
||||
|
||||
// Create the source register operand with 16-bit size
|
||||
var sourceOperand = OperandFactory.CreateRegisterOperand(reg, 16);
|
||||
|
||||
// For all operands, we need to adjust the size to 16-bit
|
||||
// This ensures register operands also get the correct size
|
||||
destinationOperand.Size = 16;
|
||||
// Note: The operand size is already set to 16-bit by the ReadModRM16 method
|
||||
|
||||
// Set the structured operands
|
||||
instruction.StructuredOperands =
|
||||
|
@ -40,8 +40,7 @@ public class XorRm8R8Handler : InstructionHandler
|
||||
// Read the ModR/M byte, specifying that we're dealing with 8-bit operands
|
||||
var (_, reg, _, destinationOperand) = ModRMDecoder.ReadModRM8();
|
||||
|
||||
// Ensure the destination operand has the correct size (8-bit)
|
||||
destinationOperand.Size = 8;
|
||||
// Note: The operand size is already set to 8-bit by the ReadModRM8 method
|
||||
|
||||
// Create the source register operand using the 8-bit register type
|
||||
var sourceOperand = OperandFactory.CreateRegisterOperand8(reg);
|
||||
|
Reference in New Issue
Block a user