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

Fixed several instruction handling issues: 1) Added proper handling for zero displacements in memory operands, 2) Fixed large unsigned displacement values display, 3) Added CmpEaxImmHandler for CMP EAX, imm32 instruction, 4) Fixed JP and JNP conditional jump instruction types

This commit is contained in:
bird_egop
2025-04-16 19:43:03 +03:00
parent 193f9cd2d8
commit db96af74ff
13 changed files with 271 additions and 47 deletions

View File

@ -231,11 +231,18 @@ public class InstructionHandlerFactory
/// </summary>
private void RegisterCmpHandlers()
{
// Add Cmp handlers
// Add Cmp handlers for 32-bit operands
_handlers.Add(new CmpR32Rm32Handler(_decoder));
_handlers.Add(new CmpRm32R32Handler(_decoder));
// Add Cmp handlers for 8-bit operands
_handlers.Add(new CmpRm8R8Handler(_decoder)); // CMP r/m8, r8 (opcode 38)
_handlers.Add(new CmpR8Rm8Handler(_decoder)); // CMP r8, r/m8 (opcode 3A)
// Add Cmp handlers for immediate operands
_handlers.Add(new CmpImmWithRm8Handler(_decoder));
_handlers.Add(new CmpAlImmHandler(_decoder));
_handlers.Add(new CmpAlImmHandler(_decoder)); // CMP AL, imm8 (opcode 3C)
_handlers.Add(new CmpEaxImmHandler(_decoder)); // CMP EAX, imm32 (opcode 3D)
// Add CMP immediate handlers from ArithmeticImmediate namespace
_handlers.Add(new CmpImmWithRm32Handler(_decoder));