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

Updated instruction handlers to use factory methods instead of directly setting Size property

This commit is contained in:
bird_egop
2025-04-16 01:39:23 +03:00
parent e06ea2beb3
commit d4eb920e2f
10 changed files with 89 additions and 48 deletions

View File

@ -43,14 +43,13 @@ public class SubRm16R16Handler : InstructionHandler
return false;
}
// Read the ModR/M byte
var (_, reg, _, destinationOperand) = ModRMDecoder.ReadModRM();
// Read the ModR/M byte, specifying that we're dealing with 16-bit operands
var (_, reg, _, 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
// Create the source register operand (16-bit)
var sourceOperand = OperandFactory.CreateRegisterOperand((RegisterIndex)reg, 16);
var sourceOperand = OperandFactory.CreateRegisterOperand(reg, 16);
// Set the structured operands
instruction.StructuredOperands =