From c2783f0528f0233ec50b25513ca6df1c46375d6c Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Sun, 17 Apr 2011 04:52:39 +0000 Subject: [PATCH] Documented a case that doesn't work in i386 --- src/arch/i386.c | 2 ++ src/arch/i386.ins | 7 +++++++ test/i386.S | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/src/arch/i386.c b/src/arch/i386.c index 0eaaecd..f5a6084 100644 --- a/src/arch/i386.c +++ b/src/arch/i386.c @@ -138,6 +138,7 @@ static int _write_dregister(ArchPlugin * plugin, uint32_t * i, && AO_GET_VALUE(definition) == 8) /* mod r/m, /r */ { (*i)++; /* skip next operand */ + /* FIXME it could as well be an inverted /r */ name = operands[*i].value._register.name; size = AO_GET_SIZE(definitions[*i]); if((ar = helper->get_register_by_name_size(helper->arch, name, @@ -288,6 +289,7 @@ static int _write_register(ArchPlugin * plugin, uint32_t * i, && AO_GET_VALUE(definition) == 8) /* mod r/m, /r */ { (*i)++; /* skip next operand */ + /* FIXME it could as well be an inverted /r */ name = operands[*i].value._register.name; size = AO_GET_SIZE(definitions[*i]); if((ar = helper->get_register_by_name_size(helper->arch, name, diff --git a/src/arch/i386.ins b/src/arch/i386.ins index 4e04674..5600fdc 100644 --- a/src/arch/i386.ins +++ b/src/arch/i386.ins @@ -52,6 +52,13 @@ { "adc", 0x10, OP1F, OP_RM8_D8_R,OP_R8, AOT_NONE }, { "adc", 0x10, OP1F, OP_RM8_DW_R,OP_R8, AOT_NONE }, { "adc", 0x10, OP1F, OP_RM8_R8_R,OP_R8, AOT_NONE }, +/* ADC 0x12 /r 1 r8 r/m8 */ +#if 1 /* FIXME doesn't work at the moment */ +{ "adc", 0x12, OP1F, OP_RM8_R8_R,OP_RM8_D0_R,AOT_NONE }, +{ "adc", 0x12, OP1F, OP_RM8_R8_R,OP_RM8_D8_R,AOT_NONE }, +{ "adc", 0x12, OP1F, OP_RM8_R8_R,OP_RM8_DW_R,AOT_NONE }, +{ "adc", 0x12, OP1F, OP_RM8_R8_R,OP_RM8_R8_R,AOT_NONE }, +#endif /* ADC 0x14 ib 1 al imm8 */ { "adc", 0x14, OP1F, OP_al, OP_U8, AOT_NONE }, /* ADC 0x15 iW 1 AX immW */ diff --git a/test/i386.S b/test/i386.S index bc838dc..697bc5b 100644 --- a/test/i386.S +++ b/test/i386.S @@ -8,7 +8,12 @@ aas /* ADC */ adc [%ecx], %dh /* 10 31 */ + adc [%ecx+$0x50], %dh /* 10 71 50 */ adc %bl, %bh /* 10 fb */ +#if 1 /* FIXME doesn't work at the moment */ + adc %dh, [%ecx] /* 12 */ + adc %bl, %bh /* 12 */ +#endif adc %al, $0x40 /* 14 40 */ adc %eax, $0x41424344 /* 15 41 42 43 44 */ adc [%edx], $0x46 /* 80 12 46 */