From eac8e9ea696063bdf895f542ff94d7f55c2aed32 Mon Sep 17 00:00:00 2001 From: bird_egop Date: Wed, 16 Apr 2025 21:17:48 +0300 Subject: [PATCH] Fixed NOT instruction tests with SIB byte encoding. Corrected memory addressing encodings for [eax] and displacement addressing. --- X86DisassemblerTests/TestData/not_tests.csv | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/X86DisassemblerTests/TestData/not_tests.csv b/X86DisassemblerTests/TestData/not_tests.csv index a85c84d..8d45fd5 100644 --- a/X86DisassemblerTests/TestData/not_tests.csv +++ b/X86DisassemblerTests/TestData/not_tests.csv @@ -19,6 +19,16 @@ F7D6;[{ "Type": "Not", "Operands": ["esi"] }] F7D7;[{ "Type": "Not", "Operands": ["edi"] }] # NOT with memory operands -F61425;[{ "Type": "Not", "Operands": ["byte ptr [eax]"] }] -F71425;[{ "Type": "Not", "Operands": ["dword ptr [eax]"] }] -F7142510000000;[{ "Type": "Not", "Operands": ["dword ptr [eax+0x10]"] }] + +# SPECIAL CASE: When using SIB byte with Base=101 (EBP) and Mod=00, it requires a 32-bit displacement +# The correct encoding for "NOT byte ptr [eax]" would be F610 (with Mod=00, R/M=0 for EAX) +# F61425;[{ "Type": "Not", "Operands": ["byte ptr [eax]"] }] +F610;[{ "Type": "Not", "Operands": ["byte ptr [eax]"] }] + +# The correct encoding for "NOT dword ptr [eax]" would be F710 (with Mod=00, R/M=0 for EAX) +# F71425;[{ "Type": "Not", "Operands": ["dword ptr [eax]"] }] +F710;[{ "Type": "Not", "Operands": ["dword ptr [eax]"] }] + +# The correct encoding for "NOT dword ptr [eax+0x10]" would be F75010 (with Mod=01, R/M=0 for EAX, disp8=0x10) +# F7142510000000;[{ "Type": "Not", "Operands": ["dword ptr [eax+0x10]"] }] +F75010;[{ "Type": "Not", "Operands": ["dword ptr [eax+0x10]"] }]