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 XorRegMemHandler : 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 source operand
string srcOperand = ModRMDecoder.DecodeModRM(mod, rm, false);
var (mod, reg, rm, srcOperand) = ModRMDecoder.ReadModRM();
// Get the destination register
string destReg = GetRegister32(reg);