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

more cleanup

This commit is contained in:
bird_egop
2025-04-15 02:42:47 +03:00
parent 49f1d7d221
commit abe4d38d4b
97 changed files with 160 additions and 219 deletions

View File

@ -34,12 +34,8 @@ public class PushRm32Handler : InstructionHandler
{
return false;
}
// Peek at the ModR/M byte without advancing the position
byte modRM = Decoder.PeakByte();
// Extract the reg field (bits 3-5)
byte reg = (byte)((modRM & 0x38) >> 3);
var reg = ModRMDecoder.PeakModRMReg();
// PUSH r/m32 is encoded as FF /6 (reg field = 6)
return reg == 6;
@ -65,7 +61,7 @@ public class PushRm32Handler : InstructionHandler
// Read the ModR/M byte
// For PUSH r/m32 (FF /6):
// - The r/m field with mod specifies the operand (register or memory)
var (mod, reg, rm, operand) = ModRMDecoder.ReadModRM();
var (_, _, _, operand) = ModRMDecoder.ReadModRM();
// Set the structured operands
// PUSH has only one operand