From b45781ad5f182e327683b51d1b4c6d3866c709e9 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 13 Jun 2003 02:34:40 +0000 Subject: [PATCH] Fix twobytemem (two byte memory accessing, no size) opcodes. Add testcase to check them. Found and patched by: Ben Skeggs svn path=/trunk/yasm/; revision=981 --- modules/arch/x86/tests/Makefile.inc | 3 + modules/arch/x86/tests/twobytemem.asm | 15 +++++ modules/arch/x86/tests/twobytemem.errwarn | 0 modules/arch/x86/tests/twobytemem.hex | 75 +++++++++++++++++++++++ modules/arch/x86/x86id.re | 2 +- 5 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 modules/arch/x86/tests/twobytemem.asm create mode 100644 modules/arch/x86/tests/twobytemem.errwarn create mode 100644 modules/arch/x86/tests/twobytemem.hex diff --git a/modules/arch/x86/tests/Makefile.inc b/modules/arch/x86/tests/Makefile.inc index 94f513da..cc1aba18 100644 --- a/modules/arch/x86/tests/Makefile.inc +++ b/modules/arch/x86/tests/Makefile.inc @@ -56,6 +56,9 @@ EXTRA_DIST += modules/arch/x86/tests/segmov.hex EXTRA_DIST += modules/arch/x86/tests/shift.asm EXTRA_DIST += modules/arch/x86/tests/shift.errwarn EXTRA_DIST += modules/arch/x86/tests/shift.hex +EXTRA_DIST += modules/arch/x86/tests/twobytemem.asm +EXTRA_DIST += modules/arch/x86/tests/twobytemem.errwarn +EXTRA_DIST += modules/arch/x86/tests/twobytemem.hex EXTRA_DIST += modules/arch/x86/tests/x86label.asm EXTRA_DIST += modules/arch/x86/tests/x86label.errwarn EXTRA_DIST += modules/arch/x86/tests/x86label.hex diff --git a/modules/arch/x86/tests/twobytemem.asm b/modules/arch/x86/tests/twobytemem.asm new file mode 100644 index 00000000..8a6dbecb --- /dev/null +++ b/modules/arch/x86/tests/twobytemem.asm @@ -0,0 +1,15 @@ +lgdt [0] +lidt [0x100] +sgdt [0x1000] +sidt [0x2004] +fstenv [0x4] +fsave [0x800] +invlpg [0xffff0000] +fxsave [0x200] +fxrstor [0x400] +prefetchnta [0x4] +prefetcht0 [0x8] +prefetcht1 [0xC] +prefetcht2 [0x10] +prefetch [0x50] +prefetchw [0x60] diff --git a/modules/arch/x86/tests/twobytemem.errwarn b/modules/arch/x86/tests/twobytemem.errwarn new file mode 100644 index 00000000..e69de29b diff --git a/modules/arch/x86/tests/twobytemem.hex b/modules/arch/x86/tests/twobytemem.hex new file mode 100644 index 00000000..c7fc297c --- /dev/null +++ b/modules/arch/x86/tests/twobytemem.hex @@ -0,0 +1,75 @@ +0f +01 +16 +00 +00 +0f +01 +1e +00 +01 +0f +01 +06 +00 +10 +0f +01 +0e +04 +20 +9b +d9 +36 +04 +00 +9b +dd +36 +00 +08 +0f +01 +3e +00 +00 +0f +ae +06 +00 +02 +0f +ae +0e +00 +04 +0f +18 +06 +04 +00 +0f +18 +0e +08 +00 +0f +18 +16 +0c +00 +0f +18 +1e +10 +00 +0f +0d +06 +50 +00 +0f +0d +0e +60 +00 diff --git a/modules/arch/x86/x86id.re b/modules/arch/x86/x86id.re index 7c573765..0f8bba4a 100644 --- a/modules/arch/x86/x86id.re +++ b/modules/arch/x86/x86id.re @@ -311,7 +311,7 @@ static const x86_insn_info onebytemem_insn[] = { /* Two byte opcode instructions with general memory operand */ static const x86_insn_info twobytemem_insn[] = { - { CPU_Any, MOD_Op1Add|MOD_Op0Add|MOD_SpAdd, 0, 1, {0, 0, 0}, 0, 1, + { CPU_Any, MOD_Op1Add|MOD_Op0Add|MOD_SpAdd, 0, 2, {0, 0, 0}, 0, 1, {OPT_Mem|OPS_Any|OPA_EA, 0, 0} } }; -- 2.40.0