Added the "test" and "ud2" instructions

This commit is contained in:
Pierre Pronchery 2011-04-18 05:27:23 +00:00
parent 5863e7490b
commit 3761dfe72e
2 changed files with 56 additions and 0 deletions

View File

@ -420,6 +420,40 @@
{ "fwait", 0x9b, OP1F, AOT_NONE, AOT_NONE, AOT_NONE },
/* NOP 0x90 1 */
{ "nop", 0x90, OP1F, AOT_NONE, AOT_NONE, AOT_NONE },
/* TEST 0xa8 ib 1 al imm8 */
{ "test", 0xa8, OP1F, OP_al, OP_S8, AOT_NONE },
/* TEST 0xa9 iW 1 AX immW */
{ "test", 0xa9, OP1F, OP_AX, OP_SW, AOT_NONE },
/* TEST 0xf6 /0 ib 1 r/m8 imm8 */
{ "testb", 0xf6, OP1F, OP_RM8_D0+0,OP_S8, AOT_NONE },
{ "testb", 0xf6, OP1F, OP_RM8_D8+0,OP_S8, AOT_NONE },
{ "testb", 0xf6, OP1F, OP_RM8_DW+0,OP_S8, AOT_NONE },
{ "test", 0xf6, OP1F, OP_RM8_R8+0,OP_S8, AOT_NONE },
/* TEST 0xf7 /0 iW 1 r/mW immW */
{ "test", 0xf7, OP1F, OP_RMW_D0+0,OP_SW, AOT_NONE },
{ "test", 0xf7, OP1F, OP_RMW_D8+0,OP_SW, AOT_NONE },
{ "test", 0xf7, OP1F, OP_RMW_DW+0,OP_SW, AOT_NONE },
{ "test", 0xf7, OP1F, OP_RMW_RW+0,OP_SW, AOT_NONE },
/* TEST 0x84 1 r/m8 r8 */
#if 1 /* FIXME doesn't work */
{ "testb", 0x84, OP1F, OP_RM8_D0, OP_R8, AOT_NONE },
{ "testb", 0x84, OP1F, OP_RM8_D8, OP_R8, AOT_NONE },
{ "testb", 0x84, OP1F, OP_RM8_DW, OP_R8, AOT_NONE },
{ "test", 0x84, OP1F, OP_RM8_R8, OP_R8, AOT_NONE },
#endif
/* TEST 0x85 1 r/mW rW */
#if 1 /* FIXME doesn't work */
{ "test", 0x85, OP1F, OP_RMW_D0, OP_RW, AOT_NONE },
{ "test", 0x85, OP1F, OP_RMW_D8, OP_RW, AOT_NONE },
{ "test", 0x85, OP1F, OP_RMW_DW, OP_RW, AOT_NONE },
{ "test", 0x85, OP1F, OP_RMW_RW, OP_RW, AOT_NONE },
#endif
/* UD2 0x0f0b 2 */
{ "ud2", 0x0f0b, OP2F, AOT_NONE, AOT_NONE, AOT_NONE },
/* VERR 0x0f00 /4 2 r/m16 */
/* FIXME implement */
/* VERW 0x0f00 /5 2 r/m16 */
/* FIXME implement */
/* WAIT 0x9b 1 */
{ "wait", 0x9b, OP1F, AOT_NONE, AOT_NONE, AOT_NONE },
/* WBINVD 0x0f09 2 */

View File

@ -146,6 +146,28 @@
fnclex
fwait
nop /* 90 */
/* TEST */
test %al, $0xaa
test %eax, $0xccddeeff
testb [%ecx], $0x04
testb [%ecx + $0x12], $0x04
testb [%ecx + $0x2212], $0x04
test %bl, $0x04
test [%ecx], $0x04002000
test [%ecx + $0x22], $0x04002000
test [%ecx + $0x2221], $0x04002000
test %ebx, $0x04002000
#if 0 /* FIXME doesn't work */
testb [%ecx], %dh
testb [%ecx + $0x12], %ch
testb [%ecx + $0x2212], %dh
test %bl, %bh
test [%ecx], %eax
test [%ecx + $0x22], %ecx
test [%ecx + $0x2221], %edx
#endif
test %ebx, %ebx /* 85 c3 */
ud2
wait
wbinvd
wrmsr