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

Split FloatingPointHandler into specialized handlers for each instruction type and fixed FLDCW instruction formatting

This commit is contained in:
bird_egop
2025-04-12 23:33:40 +03:00
parent 82653f96f2
commit 3cc6d27e33
9 changed files with 260 additions and 18 deletions

View File

@ -74,11 +74,20 @@ public class LoadStoreControlHandler : FloatingPointBaseHandler
// Different operand types based on the instruction
if (reg == 0 || reg == 2 || reg == 3) // fld, fst, fstp
{
instruction.Operands = $"dword ptr {operand}";
// Keep the dword ptr prefix from ModRMDecoder
instruction.Operands = operand;
}
else // fldenv, fldcw, fnstenv, fnstcw
{
instruction.Operands = operand;
if (reg == 5) // fldcw - should use word ptr
{
instruction.Operands = operand.Replace("dword ptr", "word ptr");
}
else // fldenv, fnstenv, fnstcw
{
// Remove the dword ptr prefix for other control operations
instruction.Operands = operand.Replace("dword ptr ", "");
}
}
}
else // Register operand (ST(i))