mirror of
https://github.com/sampletext32/ParkanPlayground.git
synced 2025-05-19 11:51:17 +03:00
Fix FSUB/FSUBR and FSUBP/FSUBRP instruction type handling
This commit is contained in:
parent
7bb14523e5
commit
1536ce4385
@ -3,7 +3,7 @@ namespace X86Disassembler.X86.Handlers.FloatingPoint.Arithmetic;
|
|||||||
using X86Disassembler.X86.Operands;
|
using X86Disassembler.X86.Operands;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Handler for FSUBP ST(i), ST instruction (DE E0-E7)
|
/// Handler for FSUBRP ST(i), ST instruction (DE E0-E7)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class FsubpStiStHandler : InstructionHandler
|
public class FsubpStiStHandler : InstructionHandler
|
||||||
{
|
{
|
||||||
@ -23,7 +23,7 @@ public class FsubpStiStHandler : InstructionHandler
|
|||||||
/// <returns>True if this handler can decode the opcode</returns>
|
/// <returns>True if this handler can decode the opcode</returns>
|
||||||
public override bool CanHandle(byte opcode)
|
public override bool CanHandle(byte opcode)
|
||||||
{
|
{
|
||||||
// FSUBP ST(i), ST is DE E0-E7
|
// FSUBRP ST(i), ST is DE E0-E7
|
||||||
if (opcode != 0xDE) return false;
|
if (opcode != 0xDE) return false;
|
||||||
|
|
||||||
if (!Decoder.CanReadByte())
|
if (!Decoder.CanReadByte())
|
||||||
@ -39,7 +39,7 @@ public class FsubpStiStHandler : InstructionHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Decodes a FSUBP ST(i), ST instruction
|
/// Decodes a FSUBRP ST(i), ST instruction
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="opcode">The opcode of the instruction</param>
|
/// <param name="opcode">The opcode of the instruction</param>
|
||||||
/// <param name="instruction">The instruction object to populate</param>
|
/// <param name="instruction">The instruction object to populate</param>
|
||||||
@ -55,7 +55,7 @@ public class FsubpStiStHandler : InstructionHandler
|
|||||||
var stIndex = (FpuRegisterIndex)(Decoder.ReadByte() - 0xE0);
|
var stIndex = (FpuRegisterIndex)(Decoder.ReadByte() - 0xE0);
|
||||||
|
|
||||||
// Set the instruction type
|
// Set the instruction type
|
||||||
instruction.Type = InstructionType.Fsubp;
|
instruction.Type = InstructionType.Fsubrp;
|
||||||
|
|
||||||
// Create the FPU register operands
|
// Create the FPU register operands
|
||||||
var stiOperand = OperandFactory.CreateFPURegisterOperand(stIndex);
|
var stiOperand = OperandFactory.CreateFPURegisterOperand(stIndex);
|
||||||
|
@ -3,7 +3,7 @@ namespace X86Disassembler.X86.Handlers.FloatingPoint.Arithmetic;
|
|||||||
using X86Disassembler.X86.Operands;
|
using X86Disassembler.X86.Operands;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Handler for FSUBRP ST(i), ST instruction (DE E8-EF)
|
/// Handler for FSUBP ST(i), ST instruction (DE E8-EF)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class FsubrpStiStHandler : InstructionHandler
|
public class FsubrpStiStHandler : InstructionHandler
|
||||||
{
|
{
|
||||||
@ -23,7 +23,7 @@ public class FsubrpStiStHandler : InstructionHandler
|
|||||||
/// <returns>True if this handler can decode the opcode</returns>
|
/// <returns>True if this handler can decode the opcode</returns>
|
||||||
public override bool CanHandle(byte opcode)
|
public override bool CanHandle(byte opcode)
|
||||||
{
|
{
|
||||||
// FSUBRP ST(i), ST is DE E8-EF
|
// FSUBP ST(i), ST is DE E8-EF
|
||||||
if (opcode != 0xDE) return false;
|
if (opcode != 0xDE) return false;
|
||||||
|
|
||||||
if (!Decoder.CanReadByte())
|
if (!Decoder.CanReadByte())
|
||||||
@ -39,7 +39,7 @@ public class FsubrpStiStHandler : InstructionHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Decodes a FSUBRP ST(i), ST instruction
|
/// Decodes a FSUBP ST(i), ST instruction
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="opcode">The opcode of the instruction</param>
|
/// <param name="opcode">The opcode of the instruction</param>
|
||||||
/// <param name="instruction">The instruction object to populate</param>
|
/// <param name="instruction">The instruction object to populate</param>
|
||||||
@ -55,7 +55,7 @@ public class FsubrpStiStHandler : InstructionHandler
|
|||||||
var stIndex = (FpuRegisterIndex)(Decoder.ReadByte() - 0xE8);
|
var stIndex = (FpuRegisterIndex)(Decoder.ReadByte() - 0xE8);
|
||||||
|
|
||||||
// Set the instruction type
|
// Set the instruction type
|
||||||
instruction.Type = InstructionType.Fsubrp;
|
instruction.Type = InstructionType.Fsubp;
|
||||||
|
|
||||||
// Create the FPU register operands
|
// Create the FPU register operands
|
||||||
var stiOperand = OperandFactory.CreateFPURegisterOperand(stIndex);
|
var stiOperand = OperandFactory.CreateFPURegisterOperand(stIndex);
|
||||||
|
@ -470,7 +470,7 @@ public class InstructionHandlerFactory
|
|||||||
_handlers.Add(new FloatingPoint.Arithmetic.FaddStiStHandler(_decoder)); // FADD ST(i), ST (DC C0-C7)
|
_handlers.Add(new FloatingPoint.Arithmetic.FaddStiStHandler(_decoder)); // FADD ST(i), ST (DC C0-C7)
|
||||||
_handlers.Add(new FloatingPoint.Arithmetic.FmulStiStHandler(_decoder)); // FMUL ST(i), ST (DC C8-CF)
|
_handlers.Add(new FloatingPoint.Arithmetic.FmulStiStHandler(_decoder)); // FMUL ST(i), ST (DC C8-CF)
|
||||||
_handlers.Add(new FloatingPoint.Comparison.FcomRegisterHandler(_decoder)); // FCOM ST(i), ST(0) (DC D0-D7)
|
_handlers.Add(new FloatingPoint.Comparison.FcomRegisterHandler(_decoder)); // FCOM ST(i), ST(0) (DC D0-D7)
|
||||||
_handlers.Add(new FloatingPoint.Arithmetic.FsubStiStHandler(_decoder)); // FSUB ST(i), ST (DC E0-E7)
|
_handlers.Add(new FloatingPoint.Arithmetic.FsubStiStHandler(_decoder)); // FSUBR ST(i), ST (DC E0-E7)
|
||||||
_handlers.Add(new FloatingPoint.Arithmetic.FsubrStiStHandler(_decoder)); // FSUB ST(i), ST (DC E8-EF)
|
_handlers.Add(new FloatingPoint.Arithmetic.FsubrStiStHandler(_decoder)); // FSUB ST(i), ST (DC E8-EF)
|
||||||
_handlers.Add(new FloatingPoint.Arithmetic.FdivrStiStHandler(_decoder)); // FDIVR ST(i), ST (DC F0-F7)
|
_handlers.Add(new FloatingPoint.Arithmetic.FdivrStiStHandler(_decoder)); // FDIVR ST(i), ST (DC F0-F7)
|
||||||
_handlers.Add(new FloatingPoint.Arithmetic.FdivStiStHandler(_decoder)); // FDIV ST(i), ST (DC F8-FF)
|
_handlers.Add(new FloatingPoint.Arithmetic.FdivStiStHandler(_decoder)); // FDIV ST(i), ST (DC F8-FF)
|
||||||
@ -502,10 +502,10 @@ public class InstructionHandlerFactory
|
|||||||
_handlers.Add(new FloatingPoint.Arithmetic.FaddpStiStHandler(_decoder)); // FADDP ST(i), ST (DE C0-C7)
|
_handlers.Add(new FloatingPoint.Arithmetic.FaddpStiStHandler(_decoder)); // FADDP ST(i), ST (DE C0-C7)
|
||||||
_handlers.Add(new FloatingPoint.Arithmetic.FmulpStiStHandler(_decoder)); // FMULP ST(i), ST (DE C8-CF)
|
_handlers.Add(new FloatingPoint.Arithmetic.FmulpStiStHandler(_decoder)); // FMULP ST(i), ST (DE C8-CF)
|
||||||
_handlers.Add(new FloatingPoint.Comparison.FcomppHandler(_decoder)); // FCOMPP (DE D9)
|
_handlers.Add(new FloatingPoint.Comparison.FcomppHandler(_decoder)); // FCOMPP (DE D9)
|
||||||
_handlers.Add(new FloatingPoint.Arithmetic.FsubpStiStHandler(_decoder)); // FSUBP ST(i), ST (DE E0-E7)
|
_handlers.Add(new FloatingPoint.Arithmetic.FsubpStiStHandler(_decoder)); // FSUBRP ST(i), ST (DE E0-E7)
|
||||||
_handlers.Add(new FloatingPoint.Arithmetic.FsubrpStiStHandler(_decoder)); // FSUBRP ST(i), ST (DE E8-EF)
|
_handlers.Add(new FloatingPoint.Arithmetic.FsubrpStiStHandler(_decoder)); // FSUBP ST(i), ST (DE E8-EF)
|
||||||
_handlers.Add(new FloatingPoint.Arithmetic.FdivrpStiStHandler(_decoder)); // FDIVP ST(i), ST (DE F0-F7)
|
_handlers.Add(new FloatingPoint.Arithmetic.FdivrpStiStHandler(_decoder)); // FDIVRP ST(i), ST (DE F0-F7)
|
||||||
_handlers.Add(new FloatingPoint.Arithmetic.FdivpStiStHandler(_decoder)); // FDIVRP ST(i), ST (DE F8-FF)
|
_handlers.Add(new FloatingPoint.Arithmetic.FdivpStiStHandler(_decoder)); // FDIVP ST(i), ST (DE F8-FF)
|
||||||
|
|
||||||
// DF opcode handlers (memory operations)
|
// DF opcode handlers (memory operations)
|
||||||
_handlers.Add(new FloatingPoint.LoadStore.FildInt16Handler(_decoder)); // FILD int16 (DF /0)
|
_handlers.Add(new FloatingPoint.LoadStore.FildInt16Handler(_decoder)); // FILD int16 (DF /0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user