diff --git a/common/emitter/groups.cpp b/common/emitter/groups.cpp index 22a2f3bdeb..26820b33ea 100644 --- a/common/emitter/groups.cpp +++ b/common/emitter/groups.cpp @@ -45,7 +45,7 @@ namespace x86Emitter { if (sibdest.Is8BitOp()) { - xOpWrite(sibdest.GetPrefix16(), 0x80, InstType, sibdest); + xOpWrite(sibdest.GetPrefix16(), 0x80, InstType, sibdest, 1); xWrite(imm); } diff --git a/tests/ctest/x86emitter/codegen_tests_main.cpp b/tests/ctest/x86emitter/codegen_tests_main.cpp index 83c6417276..71353e3c13 100644 --- a/tests/ctest/x86emitter/codegen_tests_main.cpp +++ b/tests/ctest/x86emitter/codegen_tests_main.cpp @@ -113,6 +113,7 @@ TEST(CodegenTests, MathTest) CODEGEN_TEST_64(xADD(r8, r9), "4d 01 c8"); CODEGEN_TEST_64(xADD(r8, 0x12), "49 83 c0 12"); CODEGEN_TEST_64(xADD(rax, 0x1234), "48 05 34 12 00 00"); + CODEGEN_TEST_64(xADD(ptr8[base], 1), "80 05 f9 ff ff ff 01"); CODEGEN_TEST_64(xADD(ptr32[base], -0x60), "83 05 f9 ff ff ff a0"); CODEGEN_TEST_64(xADD(ptr32[base], 0x1234), "81 05 f6 ff ff ff 34 12 00 00"); CODEGEN_TEST_BOTH(xADD(eax, ebx), "01 d8");