mirror of
https://github.com/sampletext32/ParkanPlayground.git
synced 2025-06-20 08:18:36 +03:00
nice big refactor
This commit is contained in:
@ -11,11 +11,11 @@ public class PushImm32Handler : InstructionHandler
|
||||
/// <param name="codeBuffer">The buffer containing the code to decode</param>
|
||||
/// <param name="decoder">The instruction decoder that owns this handler</param>
|
||||
/// <param name="length">The length of the buffer</param>
|
||||
public PushImm32Handler(byte[] codeBuffer, InstructionDecoder decoder, int length)
|
||||
public PushImm32Handler(byte[] codeBuffer, InstructionDecoder decoder, int length)
|
||||
: base(codeBuffer, decoder, length)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Checks if this handler can decode the given opcode
|
||||
/// </summary>
|
||||
@ -25,7 +25,7 @@ public class PushImm32Handler : InstructionHandler
|
||||
{
|
||||
return opcode == 0x68;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Decodes a PUSH imm32 instruction
|
||||
/// </summary>
|
||||
@ -36,17 +36,13 @@ public class PushImm32Handler : InstructionHandler
|
||||
{
|
||||
// Set the mnemonic
|
||||
instruction.Mnemonic = "push";
|
||||
|
||||
|
||||
// Read the immediate value
|
||||
uint imm32 = Decoder.ReadUInt32();
|
||||
if (Decoder.GetPosition() > Length)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Set the operands with 8-digit padding to match test expectations
|
||||
instruction.Operands = $"0x{imm32:X8}";
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user