mirror of
https://github.com/sampletext32/ParkanPlayground.git
synced 2025-12-12 01:31:20 +04:00
more refactoring
This commit is contained in:
@@ -37,16 +37,13 @@ public class CmpAlImmHandler : InstructionHandler
|
||||
// Set the mnemonic
|
||||
instruction.Mnemonic = "cmp";
|
||||
|
||||
int position = Decoder.GetPosition();
|
||||
|
||||
if (position >= Length)
|
||||
if (!Decoder.CanReadByte())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Read the immediate value
|
||||
byte imm8 = Decoder.ReadByte();
|
||||
Decoder.SetPosition(position);
|
||||
|
||||
// Set the operands
|
||||
instruction.Operands = $"al, 0x{imm8:X2}";
|
||||
|
||||
Reference in New Issue
Block a user