0
mirror of https://github.com/sampletext32/ParkanPlayground.git synced 2025-06-20 16:18:37 +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

@ -67,10 +67,8 @@ public class XorImmWithRm16SignExtendedHandler : InstructionHandler
return false;
}
// Read the immediate value and sign-extend it
byte imm8 = Decoder.ReadByte();
// Sign-extend to 16 bits by converting to sbyte first
short imm16 = (short)((sbyte)imm8);
// Read the immediate value and sign-extend it to 16 bits
short imm16 = (sbyte)Decoder.ReadByte();
// Format the immediate value
string immStr = $"0x{(ushort)imm16:X4}";