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

Refactor SUB handlers

This commit is contained in:
bird_egop
2025-04-13 18:22:44 +03:00
parent a04a16af7d
commit e91a0223f7
18 changed files with 493 additions and 200 deletions

View File

@ -1,6 +1,24 @@
namespace X86DisassemblerTests.InstructionTests;
using X86Disassembler.X86;
namespace X86DisassemblerTests.InstructionTests;
public class SubRm8Imm8Tests
{
[Fact]
public void SubRm8Imm8_Decodes_Correctly()
{
// Arrange
// SUB BL, 0x42
byte[] codeBuffer = new byte[] { 0x80, 0xeb, 0x42 };
var decoder = new Disassembler(codeBuffer, 0x1000);
// Act
var instructions = decoder.Disassemble();
// Assert
Assert.Single(instructions);
Assert.NotNull(instructions[0]);
Assert.Equal("sub", instructions[0].Mnemonic);
Assert.Equal("bl, 0x42", instructions[0].Operands);
}
}