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:
@ -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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user