From bcd242e96c13b86f0f13bf9f0a0b850f38a31609 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Sun, 17 Apr 2011 05:48:04 +0000 Subject: [PATCH] Referenced most occurences of the "adc" instruction by now --- src/arch/i386.ins | 16 ++++++++++++++++ test/i386.S | 4 ++++ 2 files changed, 20 insertions(+) diff --git a/src/arch/i386.ins b/src/arch/i386.ins index f76bfd0..137b3ee 100644 --- a/src/arch/i386.ins +++ b/src/arch/i386.ins @@ -34,6 +34,10 @@ #define OP_RMW_D8 AO_DREGISTER(AOF_I386_MODRM, 8, W, 0) /* 0x40 */ #define OP_RMW_DW AO_DREGISTER(AOF_I386_MODRM, W, W, 0) /* 0x80 */ #define OP_RMW_RW AO_REGISTER(AOF_I386_MODRM, W, 0) /* 0xc0 */ +#define OP_RMW_D0_R AO_DREGISTER(AOF_I386_MODRM, 0, W, 8) /* 0x00 */ +#define OP_RMW_D8_R AO_DREGISTER(AOF_I386_MODRM, 8, W, 8) /* 0x40 */ +#define OP_RMW_DW_R AO_DREGISTER(AOF_I386_MODRM, W, W, 8) /* 0x80 */ +#define OP_RMW_RW_R AO_REGISTER(AOF_I386_MODRM, W, 8) /* 0xc0 */ /* immediate values */ #define OP_S8 AO_IMMEDIATE(AOF_SIGNED, 0, 8) @@ -54,6 +58,11 @@ { "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 0x11 /r 1 r/mW rW */ +{ "adc", 0x11, OP1F, OP_RMW_D0_R,OP_RW, AOT_NONE }, +{ "adc", 0x11, OP1F, OP_RMW_D8_R,OP_RW, AOT_NONE }, +{ "adc", 0x11, OP1F, OP_RMW_DW_R,OP_RW, AOT_NONE }, +{ "adc", 0x11, OP1F, OP_RMW_RW_R,OP_RW, 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 }, @@ -61,6 +70,13 @@ { "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 0x13 /r 1 rW r/mW */ +#if 1 /* FIXME doesn't work at the moment */ +{ "adc", 0x13, OP1F, OP_RMW_RW_R,OP_RMW_D0_R,AOT_NONE }, +{ "adc", 0x13, OP1F, OP_RMW_RW_R,OP_RMW_D8_R,AOT_NONE }, +{ "adc", 0x13, OP1F, OP_RMW_RW_R,OP_RMW_DW_R,AOT_NONE }, +{ "adc", 0x13, OP1F, OP_RMW_RW_R,OP_RMW_RW_R,AOT_NONE }, +#endif /* ADC 0x14 ib 1 al imm8 */ { "adc", 0x14, OP1F, OP_al, OP_S8, AOT_NONE }, /* ADC 0x15 iW 1 AX immW */ diff --git a/test/i386.S b/test/i386.S index 6aca98d..8f45da3 100644 --- a/test/i386.S +++ b/test/i386.S @@ -10,9 +10,13 @@ adc [%ecx], %dh /* 10 31 */ adc [%ecx+$0x50], %dh /* 10 71 50 */ adc %bl, %bh /* 10 fb */ + adc %eax, %eax /* 11 c0 */ + adc [%eax], %eax /* 11 00 */ #if 1 /* FIXME doesn't work at the moment */ adc %dh, [%ecx] /* 12 */ adc %bl, %bh /* 12 */ + adc %edx, [%ecx] /* 13 */ + adc %ebx, %ebx /* 13 */ #endif adc %al, $0x40 /* 14 40 */ adc %eax, $0x41424344 /* 15 44 43 42 41 */