From 6a22fe7a70b50d6fd8741a51f5b96b05a17cbed4 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 23 Oct 2003 01:19:15 +0000 Subject: [PATCH] Fix encoding of repe and repz prefixes. Reported by: Edouard Gomez svn path=/trunk/yasm/; revision=1075 --- modules/arch/x86/tests/Makefile.inc | 3 +++ modules/arch/x86/tests/rep.asm | 5 +++++ modules/arch/x86/tests/rep.errwarn | 0 modules/arch/x86/tests/rep.hex | 11 +++++++++++ modules/arch/x86/x86id.re | 4 ++-- 5 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 modules/arch/x86/tests/rep.asm create mode 100644 modules/arch/x86/tests/rep.errwarn create mode 100644 modules/arch/x86/tests/rep.hex diff --git a/modules/arch/x86/tests/Makefile.inc b/modules/arch/x86/tests/Makefile.inc index 65dd2038..076659b1 100644 --- a/modules/arch/x86/tests/Makefile.inc +++ b/modules/arch/x86/tests/Makefile.inc @@ -89,6 +89,9 @@ EXTRA_DIST += modules/arch/x86/tests/opsize-err.errwarn EXTRA_DIST += modules/arch/x86/tests/overflow.asm EXTRA_DIST += modules/arch/x86/tests/overflow.errwarn EXTRA_DIST += modules/arch/x86/tests/overflow.hex +EXTRA_DIST += modules/arch/x86/tests/rep.asm +EXTRA_DIST += modules/arch/x86/tests/rep.errwarn +EXTRA_DIST += modules/arch/x86/tests/rep.hex EXTRA_DIST += modules/arch/x86/tests/ret.asm EXTRA_DIST += modules/arch/x86/tests/ret.errwarn EXTRA_DIST += modules/arch/x86/tests/ret.hex diff --git a/modules/arch/x86/tests/rep.asm b/modules/arch/x86/tests/rep.asm new file mode 100644 index 00000000..e3e12b6c --- /dev/null +++ b/modules/arch/x86/tests/rep.asm @@ -0,0 +1,5 @@ +repne lodsw +repnz lodsd +rep stosb +repe cmpsb +repz movsb diff --git a/modules/arch/x86/tests/rep.errwarn b/modules/arch/x86/tests/rep.errwarn new file mode 100644 index 00000000..e69de29b diff --git a/modules/arch/x86/tests/rep.hex b/modules/arch/x86/tests/rep.hex new file mode 100644 index 00000000..84f34767 --- /dev/null +++ b/modules/arch/x86/tests/rep.hex @@ -0,0 +1,11 @@ +f2 +ad +f2 +66 +ad +f3 +aa +f3 +a6 +f3 +a4 diff --git a/modules/arch/x86/x86id.re b/modules/arch/x86/x86id.re index fa3c9c05..23b1652f 100644 --- a/modules/arch/x86/x86id.re +++ b/modules/arch/x86/x86id.re @@ -2400,12 +2400,12 @@ yasm_x86__parse_check_id(yasm_arch *arch, unsigned long data[4], } R E P E { data[0] = X86_LOCKREP; - data[1] = 0xF4; + data[1] = 0xF3; return YASM_ARCH_CHECK_ID_PREFIX; } R E P Z { data[0] = X86_LOCKREP; - data[1] = 0xF4; + data[1] = 0xF3; return YASM_ARCH_CHECK_ID_PREFIX; } -- 2.40.0