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

Improved PUSH handlers by moving reg field check to CanHandle and adding proper boundary checking

This commit is contained in:
bird_egop
2025-04-14 00:33:39 +03:00
parent 53696a9f1c
commit e134452eda
3 changed files with 39 additions and 17 deletions

View File

@ -37,6 +37,11 @@ public class PushImm8Handler : InstructionHandler
// Set the mnemonic
instruction.Mnemonic = "push";
if(!Decoder.CanReadByte())
{
return false;
}
// Read the immediate value
byte imm8 = Decoder.ReadByte();