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

Fix x86 disassembler issues with direct memory addressing and immediate value formatting

This commit is contained in:
bird_egop
2025-04-15 02:29:32 +03:00
parent d351f41808
commit 3ea327064a
67 changed files with 854 additions and 453 deletions

View File

@ -11,13 +11,13 @@ public class LoadStoreInt16Handler : InstructionHandler
private static readonly InstructionType[] MemoryInstructionTypes =
[
InstructionType.Fild, // fild word ptr [r/m]
InstructionType.Unknown, // fistt word ptr [r/m] (not implemented)
InstructionType.Fst, // fist word ptr [r/m]
InstructionType.Fstp, // fistp word ptr [r/m]
InstructionType.Fld, // fbld packed BCD [r/m]
InstructionType.Fisttp, // fistt word ptr [r/m]
InstructionType.Fist, // fist word ptr [r/m]
InstructionType.Fistp, // fistp word ptr [r/m]
InstructionType.Fbld, // fbld packed BCD [r/m]
InstructionType.Fild, // fild qword ptr [r/m] (64-bit integer)
InstructionType.Fst, // fbstp packed BCD [r/m]
InstructionType.Fstp // fistp qword ptr [r/m] (64-bit integer)
InstructionType.Fbstp, // fbstp packed BCD [r/m]
InstructionType.Fistp // fistp qword ptr [r/m] (64-bit integer)
];
// Register-register operations mapping (mod=3)
@ -94,13 +94,6 @@ public class LoadStoreInt16Handler : InstructionHandler
// Read the ModR/M byte
var (mod, reg, rm, memoryOperand) = ModRMDecoder.ReadModRM();
// Check for FNSTSW AX (DF E0)
if (mod == 3 && reg == RegisterIndex.Bp && rm == RegisterIndex.A)
{
// This is handled by the FnstswHandler, so we should not handle it here
return false;
}
// Handle based on addressing mode
if (mod != 3) // Memory operand
{