0
mirror of https://github.com/sampletext32/ParkanPlayground.git synced 2025-06-19 16:08:02 +03:00

Fixed floating point instruction handling. Removed redundant FNSTSW AX check from FloatingPointHandler and added dedicated test for FnstswHandler.

This commit is contained in:
bird_egop
2025-04-12 21:27:17 +03:00
parent fe0b04f5a1
commit 6ed6a7bd00
7 changed files with 42 additions and 14 deletions

View File

@ -0,0 +1,32 @@
namespace X86DisassemblerTests;
using System;
using Xunit;
using X86Disassembler.X86;
using X86Disassembler.X86.Handlers;
/// <summary>
/// Tests for floating-point instruction handlers
/// </summary>
public class FloatingPointInstructionTests
{
/// <summary>
/// Tests the FnstswHandler for decoding FNSTSW AX instruction
/// </summary>
[Fact]
public void FnstswHandler_DecodesFnstswAx_Correctly()
{
// Arrange
// FNSTSW AX (DF E0)
byte[] codeBuffer = new byte[] { 0xDF, 0xE0 };
var decoder = new InstructionDecoder(codeBuffer, codeBuffer.Length);
// Act
var instruction = decoder.DecodeInstruction();
// Assert
Assert.NotNull(instruction);
Assert.Equal("fnstsw", instruction.Mnemonic);
Assert.Equal("ax", instruction.Operands);
}
}