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

more refactoring

This commit is contained in:
bird_egop
2025-04-14 01:08:14 +03:00
parent f54dc10596
commit 99b93523a4
78 changed files with 379 additions and 594 deletions

View File

@ -28,7 +28,7 @@ public class AddImmToRm8Handler : InstructionHandler
// Check if the reg field of the ModR/M byte is 0 (ADD)
int position = Decoder.GetPosition();
if (position >= Length)
if (!Decoder.CanReadByte())
return false;
byte modRM = CodeBuffer[position];
@ -48,9 +48,7 @@ public class AddImmToRm8Handler : InstructionHandler
// Set the mnemonic
instruction.Mnemonic = "add";
int position = Decoder.GetPosition();
if (position >= Length)
if (!Decoder.CanReadByte())
{
return false;
}
@ -66,7 +64,7 @@ public class AddImmToRm8Handler : InstructionHandler
}
// Read the immediate value
if (position >= Length)
if (!Decoder.CanReadByte())
{
return false;
}