mirror of
https://github.com/sampletext32/ParkanPlayground.git
synced 2025-06-20 16:18:37 +03:00
more refactoring
This commit is contained in:
@ -47,9 +47,7 @@ public class Float32OperationHandler : InstructionHandler
|
||||
/// <returns>True if the instruction was successfully decoded</returns>
|
||||
public override bool Decode(byte opcode, Instruction instruction)
|
||||
{
|
||||
int position = Decoder.GetPosition();
|
||||
|
||||
if (position >= Length)
|
||||
if (!Decoder.CanReadByte())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -47,9 +47,7 @@ public class Float64OperationHandler : InstructionHandler
|
||||
/// <returns>True if the instruction was successfully decoded</returns>
|
||||
public override bool Decode(byte opcode, Instruction instruction)
|
||||
{
|
||||
int position = Decoder.GetPosition();
|
||||
|
||||
if (position >= Length)
|
||||
if (!Decoder.CanReadByte())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -55,15 +55,12 @@ public class FnstswHandler : InstructionHandler
|
||||
}
|
||||
|
||||
// Verify the second byte is 0xE0
|
||||
byte secondByte = CodeBuffer[Decoder.GetPosition()];
|
||||
byte secondByte = Decoder.ReadByte();
|
||||
if (secondByte != 0xE0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Skip the second byte of the opcode
|
||||
Decoder.ReadByte(); // Consume the 0xE0 byte
|
||||
|
||||
// Set the mnemonic and operands
|
||||
instruction.Mnemonic = "fnstsw";
|
||||
instruction.Operands = "ax";
|
||||
|
Reference in New Issue
Block a user