mirror of
https://github.com/sampletext32/ParkanPlayground.git
synced 2025-05-21 12:51:18 +03:00
fixup
This commit is contained in:
parent
8123ced2d6
commit
9cad5ff95c
@ -1,4 +1,4 @@
|
|||||||
namespace X86Disassembler.X86.Handlers.Group5;
|
namespace X86Disassembler.X86.Handlers.Call;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Handler for CALL r/m32 instruction (0xFF /2)
|
/// Handler for CALL r/m32 instruction (0xFF /2)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
namespace X86Disassembler.X86.Handlers.Group1;
|
namespace X86Disassembler.X86.Handlers.Cmp;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Handler for CMP r/m8, imm8 instruction (0x80 /7)
|
/// Handler for CMP r/m8, imm8 instruction (0x80 /7)
|
||||||
|
49
X86DisassemblerTests/CmpImmWithRm8Tests.cs
Normal file
49
X86DisassemblerTests/CmpImmWithRm8Tests.cs
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
namespace X86DisassemblerTests;
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using Xunit;
|
||||||
|
using X86Disassembler.X86;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Tests for CMP r/m8, imm8 instruction (0x80 /7)
|
||||||
|
/// </summary>
|
||||||
|
public class CmpImmWithRm8Tests
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Tests the CMP r8, imm8 instruction (0x80 /7) with register operand
|
||||||
|
/// </summary>
|
||||||
|
[Fact]
|
||||||
|
public void TestCmpR8Imm8()
|
||||||
|
{
|
||||||
|
// Arrange
|
||||||
|
byte[] code = { 0x80, 0xF9, 0x02 }; // CMP CL, 0x02
|
||||||
|
|
||||||
|
// Act
|
||||||
|
Disassembler disassembler = new Disassembler(code, 0x1000);
|
||||||
|
var instructions = disassembler.Disassemble();
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
Assert.Single(instructions);
|
||||||
|
Assert.Equal("cmp", instructions[0].Mnemonic);
|
||||||
|
Assert.Equal("cl, 0x02", instructions[0].Operands);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Tests the CMP m8, imm8 instruction (0x80 /7) with memory operand
|
||||||
|
/// </summary>
|
||||||
|
[Fact]
|
||||||
|
public void TestCmpM8Imm8()
|
||||||
|
{
|
||||||
|
// Arrange
|
||||||
|
byte[] code = { 0x80, 0x39, 0x05 }; // CMP BYTE PTR [ECX], 0x05
|
||||||
|
|
||||||
|
// Act
|
||||||
|
Disassembler disassembler = new Disassembler(code, 0x1000);
|
||||||
|
var instructions = disassembler.Disassemble();
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
Assert.Single(instructions);
|
||||||
|
Assert.Equal("cmp", instructions[0].Mnemonic);
|
||||||
|
Assert.Equal("byte ptr [ecx], 0x05", instructions[0].Operands);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user