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

refactor xors

This commit is contained in:
bird_egop
2025-04-13 19:35:28 +03:00
parent 30676b36a1
commit b0ade45f1b
7 changed files with 15 additions and 42 deletions

View File

@ -45,17 +45,8 @@ public class XorMemRegHandler : InstructionHandler
}
// Read the ModR/M byte
byte modRM = CodeBuffer[position++];
Decoder.SetPosition(position);
// Extract the fields from the ModR/M byte
byte mod = (byte)((modRM & 0xC0) >> 6);
byte reg = (byte)((modRM & 0x38) >> 3);
byte rm = (byte)(modRM & 0x07);
// Decode the destination operand
string destOperand = ModRMDecoder.DecodeModRM(mod, rm, false);
var (mod, reg, rm, destOperand) = ModRMDecoder.ReadModRM();
// Get the source register
string srcReg = GetRegister32(reg);