[Biew-general] CVS: biew/plugins/disasm/ix86 ix86.c,1.2,1.3 ix86.h,1.1.1.1,1.2 ix86_fun.c,1.3,1.4
Brought to you by:
konst
From: Nick K. <nic...@us...> - 2002-11-26 17:40:53
|
Update of /cvsroot/biew/biew/plugins/disasm/ix86 In directory sc8-pr-cvs1:/tmp/cvs-serv32569/plugins/disasm/ix86 Modified Files: ix86.c ix86.h ix86_fun.c Log Message: Preliminary (pre-alpha) support of Athlon64 disassembler Index: ix86.c =================================================================== RCS file: /cvsroot/biew/biew/plugins/disasm/ix86/ix86.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ix86.c 10 Jan 2002 16:59:26 -0000 1.2 +++ ix86.c 26 Nov 2002 17:40:48 -0000 1.3 @@ -50,265 +50,299 @@ const char * ix86_DrxRegs[] = { "dr0", "dr1", "dr2", "dr3", "dr4", "dr5", "dr6", "dr7" }; const char * ix86_TrxRegs[] = { "tr0", "tr1", "tr2", "tr3", "tr4", "tr5", "tr6", "tr7" }; const char * ix86_XrxRegs[] = { "?r0", "?r1", "?r2", "?r3", "?r4", "?r5", "?r6", "?r7" }; +#ifdef INT64_C +const char * k86_ByteRegs[] = { "al", "cl", "dl", "bl", "sil", "dil", "bpl", "spl", "r8b", "r9b", "r10b", "r11b", "r12b", "r13b", "r14b", "r15b" }; +const char * k86_WordRegs[] = { "ax", "cx", "dx", "bx", "sp", "bp", "si", "di", "r8w", "r9w", "r10w", "r11w", "r12w", "r13w", "r14w", "r15w" }; +const char * k86_DWordRegs[]= { "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi", "r9d", "r10d", "r11d", "r12d", "r13d", "r14d", "r15d" }; +const char * k86_QWordRegs[]= { "rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15" }; +const char * k86_XMMXRegs[] = { "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7", "xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15" }; +/* + REX is 0x4? opcodes + bits meaning + 0 rex.b (extension to the Base) + 1 rex.x (extsnsion to the SIB indeX) + 2 rex.r (extension to the ModRM/REG) + 3 rex.w (extension to the operand Width) + 7-4 0100 + DEFAULT operand size: + if rex.w then 64 + else 66_pref then 16 + else 32 + DEFAULT address size: + if 67_pref then 32 + else 64 + (note: address displasement always has 8, 16 or 32-bit) +*/ +unsigned char k86_REX; +int has_REX; /* is required for accessing to ah-dh registers */ +#endif + +#ifdef INT64_C +#define DECLARE_BASE_INSN(n16, n32, n64, func, func64, flags, flags64)\ +{ n16, n32, n64, func, flags, func64, flags64 } +#else +#define DECLARE_BASE_INSN(n16, n32, n64, func, func64, flags, flags64)\ +{ n16, n32, func, flags } +#endif ix86_Opcodes ix86_table[256] = { - /*0x00*/ { "add", "add", ix86_ArgModRMnDnW, IX86_CPU086 }, - /*0x01*/ { "add", "add", ix86_ArgModRMnDW, IX86_CPU086 }, - /*0x02*/ { "add", "add", ix86_ArgModRMDnW, IX86_CPU086 }, - /*0x03*/ { "add", "add", ix86_ArgModRMDW, IX86_CPU086 }, - /*0x04*/ { "add", "add", ix86_ArgAXDigit, IX86_CPU086 }, - /*0x05*/ { "add", "add", ix86_ArgAXDigit, IX86_CPU086 }, - /*0x06*/ { "push", "push", ix86_ArgES, IX86_CPU086 }, - /*0x07*/ { "pop", "pop", ix86_ArgES, IX86_CPU086 }, - /*0x08*/ { "or", "or", ix86_ArgModRMnDnW, IX86_CPU086 }, - /*0x09*/ { "or", "or", ix86_ArgModRMnDW, IX86_CPU086 }, - /*0x0A*/ { "or", "or", ix86_ArgModRMDnW, IX86_CPU086 }, - /*0x0B*/ { "or", "or", ix86_ArgModRMDW, IX86_CPU086 }, - /*0x0C*/ { "or", "or", ix86_ArgAXDigit, IX86_CPU086 }, - /*0x0D*/ { "or", "or", ix86_ArgAXDigit, IX86_CPU086 }, - /*0x0E*/ { "push", "push", ix86_ArgCS, IX86_CPU086 }, - /*0x0F*/ { "!!!", "!!!", ix86_ExOpCodes, IX86_CPU086 }, - /*0x10*/ { "adc", "adc", ix86_ArgModRMnDnW, IX86_CPU086 }, - /*0x11*/ { "adc", "adc", ix86_ArgModRMnDW, IX86_CPU086 }, - /*0x12*/ { "adc", "adc", ix86_ArgModRMDnW, IX86_CPU086 }, - /*0x13*/ { "adc", "adc", ix86_ArgModRMDW, IX86_CPU086 }, - /*0x14*/ { "adc", "adc", ix86_ArgAXDigit, IX86_CPU086 }, - /*0x15*/ { "adc", "adc", ix86_ArgAXDigit, IX86_CPU086 }, - /*0x16*/ { "push", "push", ix86_ArgSS, IX86_CPU086 }, - /*0x17*/ { "pop", "pop", ix86_ArgSS, IX86_CPU086 }, - /*0x18*/ { "sbb", "sbb", ix86_ArgModRMnDnW, IX86_CPU086 }, - /*0x19*/ { "sbb", "sbb", ix86_ArgModRMnDW, IX86_CPU086 }, - /*0x1A*/ { "sbb", "sbb", ix86_ArgModRMDnW, IX86_CPU086 }, - /*0x1B*/ { "sbb", "sbb", ix86_ArgModRMDW, IX86_CPU086 }, - /*0x1C*/ { "sbb", "sbb", ix86_ArgAXDigit, IX86_CPU086 }, - /*0x1D*/ { "sbb", "sbb", ix86_ArgAXDigit, IX86_CPU086 }, - /*0x1E*/ { "push", "push", ix86_ArgDS, IX86_CPU086 }, - /*0x1F*/ { "pop", "pop", ix86_ArgDS, IX86_CPU086 }, - /*0x20*/ { "and", "and", ix86_ArgModRMnDnW, IX86_CPU086 }, - /*0x21*/ { "and", "and", ix86_ArgModRMnDW, IX86_CPU086 }, - /*0x22*/ { "and", "and", ix86_ArgModRMDnW, IX86_CPU086 }, - /*0x23*/ { "and", "and", ix86_ArgModRMDW, IX86_CPU086 }, - /*0x24*/ { "and", "and", ix86_ArgAXDigit, IX86_CPU086 }, - /*0x25*/ { "and", "and", ix86_ArgAXDigit, IX86_CPU086 }, - /*0x26*/ { "seg", "seg", ix86_ArgES, IX86_CPU086 }, - /*0x27*/ { "daa", "daa", NULL, IX86_CPU086 }, - /*0x28*/ { "sub", "sub", ix86_ArgModRMnDnW, IX86_CPU086 }, - /*0x29*/ { "sub", "sub", ix86_ArgModRMnDW, IX86_CPU086 }, - /*0x2A*/ { "sub", "sub", ix86_ArgModRMDnW, IX86_CPU086 }, - /*0x2B*/ { "sub", "sub", ix86_ArgModRMDW, IX86_CPU086 }, - /*0x2C*/ { "sub", "sub", ix86_ArgAXDigit, IX86_CPU086 }, - /*0x2D*/ { "sub", "sub", ix86_ArgAXDigit, IX86_CPU086 }, - /*0x2E*/ { "seg", "seg", ix86_ArgCS, IX86_CPU086 }, - /*0x2F*/ { "das", "das", NULL, IX86_CPU086 }, - /*0x30*/ { "xor", "xor", ix86_ArgModRMnDnW, IX86_CPU086 }, - /*0x31*/ { "xor", "xor", ix86_ArgModRMnDW, IX86_CPU086 }, - /*0x32*/ { "xor", "xor", ix86_ArgModRMDnW, IX86_CPU086 }, - /*0x33*/ { "xor", "xor", ix86_ArgModRMDW, IX86_CPU086 }, - /*0x34*/ { "xor", "xor", ix86_ArgAXDigit, IX86_CPU086 }, - /*0x35*/ { "xor", "xor", ix86_ArgAXDigit, IX86_CPU086 }, - /*0x36*/ { "seg", "seg", ix86_ArgSS, IX86_CPU086 }, - /*0x37*/ { "aaa", "aaa", NULL, IX86_CPU086 }, - /*0x38*/ { "cmp", "cmp", ix86_ArgModRMnDnW, IX86_CPU086 }, - /*0x39*/ { "cmp", "cmp", ix86_ArgModRMnDW, IX86_CPU086 }, - /*0x3A*/ { "cmp", "cmp", ix86_ArgModRMDnW, IX86_CPU086 }, - /*0x3B*/ { "cmp", "cmp", ix86_ArgModRMDW, IX86_CPU086 }, - /*0x3C*/ { "cmp", "cmp", ix86_ArgAXDigit, IX86_CPU086 }, - /*0x3D*/ { "cmp", "cmp", ix86_ArgAXDigit, IX86_CPU086 }, - /*0x3E*/ { "seg", "seg", ix86_ArgDS, IX86_CPU086 }, - /*0x3F*/ { "aas", "aas", NULL, IX86_CPU086 }, - /*0x40*/ { "inc", "inc", ix86_ArgIReg, IX86_CPU086 }, - /*0x41*/ { "inc", "inc", ix86_ArgIReg, IX86_CPU086 }, - /*0x42*/ { "inc", "inc", ix86_ArgIReg, IX86_CPU086 }, - /*0x43*/ { "inc", "inc", ix86_ArgIReg, IX86_CPU086 }, - /*0x44*/ { "inc", "inc", ix86_ArgIReg, IX86_CPU086 }, - /*0x45*/ { "inc", "inc", ix86_ArgIReg, IX86_CPU086 }, - /*0x46*/ { "inc", "inc", ix86_ArgIReg, IX86_CPU086 }, - /*0x47*/ { "inc", "inc", ix86_ArgIReg, IX86_CPU086 }, - /*0x48*/ { "dec", "dec", ix86_ArgIReg, IX86_CPU086 }, - /*0x49*/ { "dec", "dec", ix86_ArgIReg, IX86_CPU086 }, - /*0x4A*/ { "dec", "dec", ix86_ArgIReg, IX86_CPU086 }, - /*0x4B*/ { "dec", "dec", ix86_ArgIReg, IX86_CPU086 }, - /*0x4C*/ { "dec", "dec", ix86_ArgIReg, IX86_CPU086 }, - /*0x4D*/ { "dec", "dec", ix86_ArgIReg, IX86_CPU086 }, - /*0x4E*/ { "dec", "dec", ix86_ArgIReg, IX86_CPU086 }, - /*0x4F*/ { "dec", "dec", ix86_ArgIReg, IX86_CPU086 }, - /*0x50*/ { "push", "push", ix86_ArgIReg, IX86_CPU086 }, - /*0x51*/ { "push", "push", ix86_ArgIReg, IX86_CPU086 }, - /*0x52*/ { "push", "push", ix86_ArgIReg, IX86_CPU086 }, - /*0x53*/ { "push", "push", ix86_ArgIReg, IX86_CPU086 }, - /*0x54*/ { "push", "push", ix86_ArgIReg, IX86_CPU086 }, - /*0x55*/ { "push", "push", ix86_ArgIReg, IX86_CPU086 }, - /*0x56*/ { "push", "push", ix86_ArgIReg, IX86_CPU086 }, - /*0x57*/ { "push", "push", ix86_ArgIReg, IX86_CPU086 }, - /*0x58*/ { "pop", "pop", ix86_ArgIReg, IX86_CPU086 }, - /*0x59*/ { "pop", "pop", ix86_ArgIReg, IX86_CPU086 }, - /*0x5A*/ { "pop", "pop", ix86_ArgIReg, IX86_CPU086 }, - /*0x5B*/ { "pop", "pop", ix86_ArgIReg, IX86_CPU086 }, - /*0x5C*/ { "pop", "pop", ix86_ArgIReg, IX86_CPU086 }, - /*0x5D*/ { "pop", "pop", ix86_ArgIReg, IX86_CPU086 }, - /*0x5E*/ { "pop", "pop", ix86_ArgIReg, IX86_CPU086 }, - /*0x5F*/ { "pop", "pop", ix86_ArgIReg, IX86_CPU086 }, - /*0x60*/ { "pushaw", "pushad", NULL, IX86_CPU186 }, - /*0x61*/ { "popaw", "popad", NULL, IX86_CPU186 }, - /*0x62*/ { "bound", "bound", ix86_ArgModRMDW, IX86_CPU286 }, - /*0x63*/ { "arpl", "arpl", ix86_ArgModRMDW, IX86_CPU286 }, - /*0x64*/ { "seg", "seg", ix86_ArgFS, IX86_CPU386 }, - /*0x65*/ { "seg", "seg", ix86_ArgGS, IX86_CPU386 }, - /*0x66*/ { "???", "???", NULL, IX86_CPU386 }, - /*0x67*/ { "???", "???", NULL, IX86_CPU386 }, - /*0x68*/ { "push", "push", ix86_ArgInt, IX86_CPU186 }, - /*0x69*/ { "imul", "imul", ix86_ArgRegRMDigit, IX86_CPU186 }, - /*0x6A*/ { "push", "push", ix86_ArgSInt, IX86_CPU186 }, - /*0x6B*/ { "imul", "imul", ix86_ArgRegRMDigit, IX86_CPU186 }, - /*0x6C*/ { "insb", "insb", NULL, IX86_CPU186 }, - /*0x6D*/ { "insw", "insd", NULL, IX86_CPU186 }, - /*0x6E*/ { "outsb", "outsb", NULL, IX86_CPU186 }, - /*0x6F*/ { "outsw", "outsd", NULL, IX86_CPU186 }, - /*0x70*/ { "jo", "jo", ix86_ArgShort, IX86_CPU086 }, - /*0x71*/ { "jno", "jno", ix86_ArgShort, IX86_CPU086 }, - /*0x72*/ { "jc", "jc", ix86_ArgShort, IX86_CPU086 }, - /*0x73*/ { "jnc", "jnc", ix86_ArgShort, IX86_CPU086 }, - /*0x74*/ { "je", "je", ix86_ArgShort, IX86_CPU086 }, - /*0x75*/ { "jne", "jne", ix86_ArgShort, IX86_CPU086 }, - /*0x76*/ { "jna", "jna", ix86_ArgShort, IX86_CPU086 }, - /*0x77*/ { "ja", "ja", ix86_ArgShort, IX86_CPU086 }, - /*0x78*/ { "js", "js", ix86_ArgShort, IX86_CPU086 }, - /*0x79*/ { "jns", "jns", ix86_ArgShort, IX86_CPU086 }, - /*0x7A*/ { "jp", "jp", ix86_ArgShort, IX86_CPU086 }, - /*0x7B*/ { "jnp", "jnp", ix86_ArgShort, IX86_CPU086 }, - /*0x7C*/ { "jl", "jl", ix86_ArgShort, IX86_CPU086 }, - /*0x7D*/ { "jnl", "jnl", ix86_ArgShort, IX86_CPU086 }, - /*0x7E*/ { "jle", "jle", ix86_ArgShort, IX86_CPU086 }, - /*0x7F*/ { "jg", "jg", ix86_ArgShort, IX86_CPU086 }, - /*0x80*/ { "!!!", "!!!", ix86_ArgOp1, IX86_CPU086 }, - /*0x81*/ { "!!!", "!!!", ix86_ArgOp1, IX86_CPU086 }, - /*0x82*/ { "!!!", "!!!", ix86_ArgOp2, IX86_CPU086 }, - /*0x83*/ { "!!!", "!!!", ix86_ArgOp2, IX86_CPU086 }, - /*0x84*/ { "test", "test", ix86_ArgModRMnDnW, IX86_CPU086 }, - /*0x85*/ { "test", "test", ix86_ArgModRMnDW, IX86_CPU086 }, - /*0x86*/ { "xchg", "xchg", ix86_ArgModRMDnW, IX86_CPU086 }, - /*0x87*/ { "xchg", "xchg", ix86_ArgModRMDW, IX86_CPU086 }, - /*0x88*/ { "mov", "mov", ix86_ArgModRMnDnW, IX86_CPU086 }, - /*0x89*/ { "mov", "mov", ix86_ArgModRMnDW, IX86_CPU086 }, - /*0x8A*/ { "mov", "mov", ix86_ArgModRMDnW, IX86_CPU086 }, - /*0x8B*/ { "mov", "mov", ix86_ArgModRMDW, IX86_CPU086 }, - /*0x8C*/ { "mov", "mov", ix86_SMov, IX86_CPU086 }, - /*0x8D*/ { "lea", "lea", ix86_ArgModRMDW, IX86_CPU086 }, - /*0x8E*/ { "mov", "mov", ix86_SMov, IX86_CPU086 }, - /*0x8F*/ { "pop", "pop", ix86_ArgMod, IX86_CPU086 }, - /*0x90*/ { "nop", "nop", NULL, IX86_CPU086 }, - /*0x91*/ { "xchg", "xchg", ix86_ArgAXIReg, IX86_CPU086 }, - /*0x92*/ { "xchg", "xchg", ix86_ArgAXIReg, IX86_CPU086 }, - /*0x93*/ { "xchg", "xchg", ix86_ArgAXIReg, IX86_CPU086 }, - /*0x94*/ { "xchg", "xchg", ix86_ArgAXIReg, IX86_CPU086 }, - /*0x95*/ { "xchg", "xchg", ix86_ArgAXIReg, IX86_CPU086 }, - /*0x96*/ { "xchg", "xchg", ix86_ArgAXIReg, IX86_CPU086 }, - /*0x97*/ { "xchg", "xchg", ix86_ArgAXIReg, IX86_CPU086 }, - /*0x98*/ { "cbw", "cwde", NULL, IX86_CPU086 }, - /*0x99*/ { "cwd", "cdq", NULL, IX86_CPU086 }, - /*0x9A*/ { "callf16", "callf32", ix86_ArgFar, IX86_CPU086 }, - /*0x9B*/ { "wait", "wait", NULL, IX86_CPU086 }, - /*0x9C*/ { "pushfw", "pushfd", NULL, IX86_CPU086 }, - /*0x9D*/ { "popfw", "popfd", NULL, IX86_CPU086 }, - /*0x9E*/ { "sahf", "sahf", NULL, IX86_CPU086 }, - /*0x9F*/ { "lahf", "lahf", NULL, IX86_CPU086 }, - /*0xA0*/ { "mov", "mov", ix86_ArgAXMem, IX86_CPU086 }, - /*0xA1*/ { "mov", "mov", ix86_ArgAXMem, IX86_CPU086 }, - /*0xA2*/ { "mov", "mov", ix86_ArgAXMem, IX86_CPU086 }, - /*0xA3*/ { "mov", "mov", ix86_ArgAXMem, IX86_CPU086 }, - /*0xA4*/ { "movsb", "movsb", NULL, IX86_CPU086 }, - /*0xA5*/ { "movsw", "movsd", NULL, IX86_CPU086 }, - /*0xA6*/ { "cmpsb", "cmpsb", NULL, IX86_CPU086 }, - /*0xA7*/ { "cmpsw", "cmpsd", NULL, IX86_CPU086 }, - /*0xA8*/ { "test", "test", ix86_ArgAXDigit, IX86_CPU086 }, - /*0xA9*/ { "test", "test", ix86_ArgAXDigit, IX86_CPU086 }, - /*0xAA*/ { "stosb", "stosb", NULL, IX86_CPU086 }, - /*0xAB*/ { "stosw", "stosd", NULL, IX86_CPU086 }, - /*0xAC*/ { "lodsb", "lodsb", NULL, IX86_CPU086 }, - /*0xAD*/ { "lodsw", "lodsd", NULL, IX86_CPU086 }, - /*0xAE*/ { "scasb", "scasb", NULL, IX86_CPU086 }, - /*0xAF*/ { "scasw", "scasd", NULL, IX86_CPU086 }, - /*0xB0*/ { "mov", "mov", ix86_ArgIRegDigit, IX86_CPU086 }, - /*0xB1*/ { "mov", "mov", ix86_ArgIRegDigit, IX86_CPU086 }, - /*0xB2*/ { "mov", "mov", ix86_ArgIRegDigit, IX86_CPU086 }, - /*0xB3*/ { "mov", "mov", ix86_ArgIRegDigit, IX86_CPU086 }, - /*0xB4*/ { "mov", "mov", ix86_ArgIRegDigit, IX86_CPU086 }, - /*0xB5*/ { "mov", "mov", ix86_ArgIRegDigit, IX86_CPU086 }, - /*0xB6*/ { "mov", "mov", ix86_ArgIRegDigit, IX86_CPU086 }, - /*0xB7*/ { "mov", "mov", ix86_ArgIRegDigit, IX86_CPU086 }, - /*0xB8*/ { "mov", "mov", ix86_ArgIRegDigit, IX86_CPU086 }, - /*0xB9*/ { "mov", "mov", ix86_ArgIRegDigit, IX86_CPU086 }, - /*0xBA*/ { "mov", "mov", ix86_ArgIRegDigit, IX86_CPU086 }, - /*0xBB*/ { "mov", "mov", ix86_ArgIRegDigit, IX86_CPU086 }, - /*0xBC*/ { "mov", "mov", ix86_ArgIRegDigit, IX86_CPU086 }, - /*0xBD*/ { "mov", "mov", ix86_ArgIRegDigit, IX86_CPU086 }, - /*0xBE*/ { "mov", "mov", ix86_ArgIRegDigit, IX86_CPU086 }, - /*0xBF*/ { "mov", "mov", ix86_ArgIRegDigit, IX86_CPU086 }, - /*0xC0*/ { "!!!", "!!!", ix86_ShOp2, IX86_CPU186 }, - /*0xC1*/ { "!!!", "!!!", ix86_ShOp2, IX86_CPU186 }, - /*0xC2*/ { "retn16", "retn32", ix86_ArgWord, IX86_CPU086 }, - /*0xC3*/ { "retn16", "retn32", NULL, IX86_CPU086 }, - /*0xC4*/ { "les", "les", ix86_ArgModRMDW, IX86_CPU086 }, - /*0xC5*/ { "lds", "lds", ix86_ArgModRMDW, IX86_CPU086 }, - /*0xC6*/ { "mov", "mov", ix86_ArgRMDigit, IX86_CPU086 }, - /*0xC7*/ { "mov", "mov", ix86_ArgRMDigit, IX86_CPU086 }, - /*0xC8*/ { "enter", "enter", ix86_ArgWord_Byte, IX86_CPU186 }, - /*0xC9*/ { "leave", "leave", NULL, IX86_CPU186 }, - /*0xCA*/ { "retf16", "retf32", ix86_ArgWord, IX86_CPU086 }, - /*0xCB*/ { "retf16", "retf32", NULL, IX86_CPU086 }, - /*0xCC*/ { "int3", "int3", NULL, IX86_CPU086 }, - /*0xCD*/ { "int", "int", ix86_ArgByte, IX86_CPU086 }, - /*0xCE*/ { "into16", "into32", NULL, IX86_CPU086 }, - /*0xCF*/ { "iret16", "iret32", NULL, IX86_CPU086 }, - /*0xD0*/ { "!!!", "!!!", ix86_ShOp1, IX86_CPU086 }, - /*0xD1*/ { "!!!", "!!!", ix86_ShOp1, IX86_CPU086 }, - /*0xD2*/ { "!!!", "!!!", ix86_ShOpCL, IX86_CPU086 }, - /*0xD3*/ { "!!!", "!!!", ix86_ShOpCL, IX86_CPU086 }, - /*0xD4*/ { "aam on", "aam on", ix86_ArgByte, IX86_CPU086 }, - /*0xD5*/ { "aad on", "aad on", ix86_ArgByte, IX86_CPU086 }, - /*0xD6*/ { "salc", "salc", NULL, IX86_CPU086 }, - /*0xD7*/ { "xlat", "xlat", NULL, IX86_CPU086 }, - /*0xD8*/ { "esc", "esc", ix86_FPUCmd, IX86_CPU086 }, - /*0xD9*/ { "esc", "esc", ix86_FPUCmd, IX86_CPU086 }, - /*0xDA*/ { "esc", "esc", ix86_FPUCmd, IX86_CPU086 }, - /*0xDB*/ { "esc", "esc", ix86_FPUCmd, IX86_CPU086 }, - /*0xDC*/ { "esc", "esc", ix86_FPUCmd, IX86_CPU086 }, - /*0xDD*/ { "esc", "esc", ix86_FPUCmd, IX86_CPU086 }, - /*0xDE*/ { "esc", "esc", ix86_FPUCmd, IX86_CPU086 }, - /*0xDF*/ { "esc", "esc", ix86_FPUCmd, IX86_CPU086 }, - /*0xE0*/ { "loopnz", "loopnz", ix86_ArgShort, IX86_CPU086 }, - /*0xE1*/ { "loopz", "loopz", ix86_ArgShort, IX86_CPU086 }, - /*0xE2*/ { "loop", "loop", ix86_ArgShort, IX86_CPU086 }, - /*0xE3*/ { "jcxz", "jecxz", ix86_ArgShort, IX86_CPU086 }, - /*0xE4*/ { "in", "in", ix86_InOut, IX86_CPU086 }, - /*0xE5*/ { "in", "in", ix86_InOut, IX86_CPU086 }, - /*0xE6*/ { "out", "out", ix86_InOut, IX86_CPU086 }, - /*0xE7*/ { "out", "out", ix86_InOut, IX86_CPU086 }, - /*0xE8*/ { "calln16", "calln32", ix86_ArgNear, IX86_CPU086 }, - /*0xE9*/ { "jmpn16", "jmpn32", ix86_ArgNear, IX86_CPU086 }, - /*0xEA*/ { "jmpf16", "jmpf32", ix86_ArgFar, IX86_CPU086 }, - /*0xEB*/ { "jmps", "jmps", ix86_ArgShort, IX86_CPU086 }, - /*0xEC*/ { "in", "in", ix86_InOut, IX86_CPU086 }, - /*0xED*/ { "in", "in", ix86_InOut, IX86_CPU086 }, - /*0xEE*/ { "out", "out", ix86_InOut, IX86_CPU086 }, - /*0xEF*/ { "out", "out", ix86_InOut, IX86_CPU086 }, - /*0xF0*/ { "lock", "lock", NULL, IX86_CPU086 }, - /*0xF1*/ { "icebp", "icebp", NULL, IX86_CPU386 }, - /*0xF2*/ { "repne", "repne", NULL, IX86_CPU086 }, - /*0xF3*/ { "rep", "rep", NULL, IX86_CPU086 }, - /*0xF4*/ { "hlt", "hlt", NULL, IX86_CPU086 }, - /*0xF5*/ { "cmc", "cmc", NULL, IX86_CPU086 }, - /*0xF6*/ { "!!!", "!!!", ix86_ArgGrp1, IX86_CPU086 }, - /*0xF7*/ { "!!!", "!!!", ix86_ArgGrp1, IX86_CPU086 }, - /*0xF8*/ { "clc", "clc", NULL, IX86_CPU086 }, - /*0xF9*/ { "stc", "stc", NULL, IX86_CPU086 }, - /*0xFA*/ { "cli", "cli", NULL, IX86_CPU086 }, - /*0xFB*/ { "sti", "sti", NULL, IX86_CPU086 }, - /*0xFC*/ { "cld", "cld", NULL, IX86_CPU086 }, - /*0xFD*/ { "std", "std", NULL, IX86_CPU086 }, - /*0xFE*/ { "!!!", "!!!", ix86_ArgGrp2, IX86_CPU086 }, - /*0xFF*/ { "!!!", "!!!", ix86_ArgGrp2, IX86_CPU086 } + /*0x00*/ DECLARE_BASE_INSN("add","add","add",ix86_ArgModRMnDnW,ix86_ArgModRMnDnW,IX86_CPU086,K64_ATHLON), + /*0x01*/ DECLARE_BASE_INSN("add","add","add",ix86_ArgModRMnDW,ix86_ArgModRMnDW,IX86_CPU086,K64_ATHLON), + /*0x02*/ DECLARE_BASE_INSN("add","add","add",ix86_ArgModRMDnW,ix86_ArgModRMDnW,IX86_CPU086,K64_ATHLON), + /*0x03*/ DECLARE_BASE_INSN("add","add","add",ix86_ArgModRMDW,ix86_ArgModRMDW,IX86_CPU086,K64_ATHLON), + /*0x04*/ DECLARE_BASE_INSN("add","add","add",ix86_ArgAXDigit,ix86_ArgAXDigit,IX86_CPU086,K64_ATHLON), + /*0x05*/ DECLARE_BASE_INSN("add","add","add",ix86_ArgAXDigit,ix86_ArgAXDigit,IX86_CPU086,K64_ATHLON), + /*0x06*/ DECLARE_BASE_INSN("push","push","???",ix86_ArgES,ix86_ArgES,IX86_CPU086,K64_ATHLON), + /*0x07*/ DECLARE_BASE_INSN("pop","pop","???",ix86_ArgES,ix86_ArgES,IX86_CPU086,K64_ATHLON), + /*0x08*/ DECLARE_BASE_INSN("or","or","or",ix86_ArgModRMnDnW,ix86_ArgModRMnDnW,IX86_CPU086,K64_ATHLON), + /*0x09*/ DECLARE_BASE_INSN("or","or","or",ix86_ArgModRMnDW,ix86_ArgModRMnDW,IX86_CPU086,K64_ATHLON), + /*0x0A*/ DECLARE_BASE_INSN("or","or","or",ix86_ArgModRMDnW,ix86_ArgModRMDnW,IX86_CPU086,K64_ATHLON), + /*0x0B*/ DECLARE_BASE_INSN("or","or","or",ix86_ArgModRMDW,ix86_ArgModRMDW,IX86_CPU086,K64_ATHLON), + /*0x0C*/ DECLARE_BASE_INSN("or","or","or",ix86_ArgAXDigit,ix86_ArgAXDigit,IX86_CPU086,K64_ATHLON), + /*0x0D*/ DECLARE_BASE_INSN("or","or","or",ix86_ArgAXDigit,ix86_ArgAXDigit,IX86_CPU086,K64_ATHLON), + /*0x0E*/ DECLARE_BASE_INSN("push","push","???", ix86_ArgCS,ix86_ArgCS,IX86_CPU086,K64_ATHLON), + /*0x0F*/ DECLARE_BASE_INSN("!!!","!!!","!!!",ix86_ExOpCodes,ix86_ExOpCodes,IX86_CPU086,K64_ATHLON), + /*0x10*/ DECLARE_BASE_INSN("adc","adc","adc",ix86_ArgModRMnDnW,ix86_ArgModRMnDnW,IX86_CPU086,K64_ATHLON), + /*0x11*/ DECLARE_BASE_INSN("adc","adc","adc",ix86_ArgModRMnDW,ix86_ArgModRMnDW,IX86_CPU086,K64_ATHLON), + /*0x12*/ DECLARE_BASE_INSN("adc","adc","adc",ix86_ArgModRMDnW,ix86_ArgModRMDnW,IX86_CPU086,K64_ATHLON), + /*0x13*/ DECLARE_BASE_INSN("adc","adc","adc",ix86_ArgModRMDW,ix86_ArgModRMDW,IX86_CPU086,K64_ATHLON), + /*0x14*/ DECLARE_BASE_INSN("adc","adc","adc",ix86_ArgAXDigit,ix86_ArgAXDigit,IX86_CPU086,K64_ATHLON), + /*0x15*/ DECLARE_BASE_INSN("adc","adc","adc",ix86_ArgAXDigit,ix86_ArgAXDigit,IX86_CPU086,K64_ATHLON), + /*0x16*/ DECLARE_BASE_INSN("push","push","???",ix86_ArgSS,ix86_ArgSS,IX86_CPU086,K64_ATHLON), + /*0x17*/ DECLARE_BASE_INSN("pop","pop","???",ix86_ArgSS,ix86_ArgSS,IX86_CPU086,K64_ATHLON), + /*0x18*/ DECLARE_BASE_INSN("sbb","sbb","sbb",ix86_ArgModRMnDnW,ix86_ArgModRMnDnW,IX86_CPU086,K64_ATHLON), + /*0x19*/ DECLARE_BASE_INSN("sbb","sbb","sbb",ix86_ArgModRMnDW,ix86_ArgModRMnDW,IX86_CPU086,K64_ATHLON), + /*0x1A*/ DECLARE_BASE_INSN("sbb","sbb","sbb",ix86_ArgModRMDnW,ix86_ArgModRMDnW,IX86_CPU086,K64_ATHLON), + /*0x1B*/ DECLARE_BASE_INSN("sbb","sbb","sbb",ix86_ArgModRMDW,ix86_ArgModRMDW,IX86_CPU086,K64_ATHLON), + /*0x1C*/ DECLARE_BASE_INSN("sbb","sbb","sbb",ix86_ArgAXDigit,ix86_ArgAXDigit,IX86_CPU086,K64_ATHLON), + /*0x1D*/ DECLARE_BASE_INSN("sbb","sbb","sbb",ix86_ArgAXDigit,ix86_ArgAXDigit,IX86_CPU086,K64_ATHLON), + /*0x1E*/ DECLARE_BASE_INSN("push","push","???",ix86_ArgDS,ix86_ArgDS,IX86_CPU086,K64_ATHLON), + /*0x1F*/ DECLARE_BASE_INSN("pop","pop","???",ix86_ArgDS,ix86_ArgDS,IX86_CPU086,K64_ATHLON), + /*0x20*/ DECLARE_BASE_INSN("and","and","and",ix86_ArgModRMnDnW,ix86_ArgModRMnDnW,IX86_CPU086,K64_ATHLON), + /*0x21*/ DECLARE_BASE_INSN("and","and","and",ix86_ArgModRMnDW,ix86_ArgModRMnDW,IX86_CPU086,K64_ATHLON), + /*0x22*/ DECLARE_BASE_INSN("and","and","and",ix86_ArgModRMDnW,ix86_ArgModRMDnW,IX86_CPU086,K64_ATHLON), + /*0x23*/ DECLARE_BASE_INSN("and","and","and",ix86_ArgModRMDW,ix86_ArgModRMDW,IX86_CPU086,K64_ATHLON), + /*0x24*/ DECLARE_BASE_INSN("and","and","and",ix86_ArgAXDigit,ix86_ArgAXDigit,IX86_CPU086,K64_ATHLON), + /*0x25*/ DECLARE_BASE_INSN("and","and","and",ix86_ArgAXDigit,ix86_ArgAXDigit,IX86_CPU086,K64_ATHLON), + /*0x26*/ DECLARE_BASE_INSN("seg","seg","seg",ix86_ArgES,ix86_ArgES,IX86_CPU086,K64_ATHLON), + /*0x27*/ DECLARE_BASE_INSN("daa","daa","???",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0x28*/ DECLARE_BASE_INSN("sub","sub","sub",ix86_ArgModRMnDnW,ix86_ArgModRMnDnW,IX86_CPU086,K64_ATHLON), + /*0x29*/ DECLARE_BASE_INSN("sub","sub","sub",ix86_ArgModRMnDW,ix86_ArgModRMnDW,IX86_CPU086,K64_ATHLON), + /*0x2A*/ DECLARE_BASE_INSN("sub","sub","sub",ix86_ArgModRMDnW,ix86_ArgModRMDnW,IX86_CPU086,K64_ATHLON), + /*0x2B*/ DECLARE_BASE_INSN("sub","sub","sub",ix86_ArgModRMDW,ix86_ArgModRMDW,IX86_CPU086,K64_ATHLON), + /*0x2C*/ DECLARE_BASE_INSN("sub","sub","sub",ix86_ArgAXDigit,ix86_ArgAXDigit,IX86_CPU086,K64_ATHLON), + /*0x2D*/ DECLARE_BASE_INSN("sub","sub","sub",ix86_ArgAXDigit,ix86_ArgAXDigit,IX86_CPU086,K64_ATHLON), + /*0x2E*/ DECLARE_BASE_INSN("seg","seg","seg",ix86_ArgCS,ix86_ArgCS,IX86_CPU086,K64_ATHLON), + /*0x2F*/ DECLARE_BASE_INSN("das","das","???",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0x30*/ DECLARE_BASE_INSN("xor","xor","xor",ix86_ArgModRMnDnW,ix86_ArgModRMnDnW,IX86_CPU086,K64_ATHLON), + /*0x31*/ DECLARE_BASE_INSN("xor","xor","xor",ix86_ArgModRMnDW,ix86_ArgModRMnDW,IX86_CPU086,K64_ATHLON), + /*0x32*/ DECLARE_BASE_INSN("xor","xor","xor",ix86_ArgModRMDnW,ix86_ArgModRMDnW,IX86_CPU086,K64_ATHLON), + /*0x33*/ DECLARE_BASE_INSN("xor","xor","xor",ix86_ArgModRMDW,ix86_ArgModRMDW,IX86_CPU086,K64_ATHLON), + /*0x34*/ DECLARE_BASE_INSN("xor","xor","xor",ix86_ArgAXDigit,ix86_ArgAXDigit,IX86_CPU086,K64_ATHLON), + /*0x35*/ DECLARE_BASE_INSN("xor","xor","xor",ix86_ArgAXDigit,ix86_ArgAXDigit,IX86_CPU086,K64_ATHLON), + /*0x36*/ DECLARE_BASE_INSN("seg","seg","seg",ix86_ArgSS,ix86_ArgSS,IX86_CPU086,K64_ATHLON), + /*0x37*/ DECLARE_BASE_INSN("aaa","aaa","???",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0x38*/ DECLARE_BASE_INSN("cmp","cmp","cmp",ix86_ArgModRMnDnW,ix86_ArgModRMnDnW,IX86_CPU086,K64_ATHLON), + /*0x39*/ DECLARE_BASE_INSN("cmp","cmp","cmp",ix86_ArgModRMnDW,ix86_ArgModRMnDW,IX86_CPU086,K64_ATHLON), + /*0x3A*/ DECLARE_BASE_INSN("cmp","cmp","cmp",ix86_ArgModRMDnW,ix86_ArgModRMDnW,IX86_CPU086,K64_ATHLON), + /*0x3B*/ DECLARE_BASE_INSN("cmp","cmp","cmp",ix86_ArgModRMDW,ix86_ArgModRMDW,IX86_CPU086,K64_ATHLON), + /*0x3C*/ DECLARE_BASE_INSN("cmp","cmp","cmp",ix86_ArgAXDigit,ix86_ArgAXDigit,IX86_CPU086,K64_ATHLON), + /*0x3D*/ DECLARE_BASE_INSN("cmp","cmp","cmp",ix86_ArgAXDigit,ix86_ArgAXDigit,IX86_CPU086,K64_ATHLON), + /*0x3E*/ DECLARE_BASE_INSN("seg","seg","seg",ix86_ArgDS,ix86_ArgDS,IX86_CPU086,K64_ATHLON), + /*0x3F*/ DECLARE_BASE_INSN("aas","aas","???",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0x40*/ DECLARE_BASE_INSN("inc","inc","inc",ix86_ArgIReg,ix86_ArgIReg,IX86_CPU086,K64_ATHLON), + /*0x41*/ DECLARE_BASE_INSN("inc","inc","inc",ix86_ArgIReg,ix86_ArgIReg,IX86_CPU086,K64_ATHLON), + /*0x42*/ DECLARE_BASE_INSN("inc","inc","inc",ix86_ArgIReg,ix86_ArgIReg,IX86_CPU086,K64_ATHLON), + /*0x43*/ DECLARE_BASE_INSN("inc","inc","inc",ix86_ArgIReg,ix86_ArgIReg,IX86_CPU086,K64_ATHLON), + /*0x44*/ DECLARE_BASE_INSN("inc","inc","inc",ix86_ArgIReg,ix86_ArgIReg,IX86_CPU086,K64_ATHLON), + /*0x45*/ DECLARE_BASE_INSN("inc","inc","inc",ix86_ArgIReg,ix86_ArgIReg,IX86_CPU086,K64_ATHLON), + /*0x46*/ DECLARE_BASE_INSN("inc","inc","inc",ix86_ArgIReg,ix86_ArgIReg,IX86_CPU086,K64_ATHLON), + /*0x47*/ DECLARE_BASE_INSN("inc","inc","inc",ix86_ArgIReg,ix86_ArgIReg,IX86_CPU086,K64_ATHLON), + /*0x48*/ DECLARE_BASE_INSN("dec","dec","dec",ix86_ArgIReg,ix86_ArgIReg,IX86_CPU086,K64_ATHLON), + /*0x49*/ DECLARE_BASE_INSN("dec","dec","dec",ix86_ArgIReg,ix86_ArgIReg,IX86_CPU086,K64_ATHLON), + /*0x4A*/ DECLARE_BASE_INSN("dec","dec","dec",ix86_ArgIReg,ix86_ArgIReg,IX86_CPU086,K64_ATHLON), + /*0x4B*/ DECLARE_BASE_INSN("dec","dec","dec",ix86_ArgIReg,ix86_ArgIReg,IX86_CPU086,K64_ATHLON), + /*0x4C*/ DECLARE_BASE_INSN("dec","dec","dec",ix86_ArgIReg,ix86_ArgIReg,IX86_CPU086,K64_ATHLON), + /*0x4D*/ DECLARE_BASE_INSN("dec","dec","dec",ix86_ArgIReg,ix86_ArgIReg,IX86_CPU086,K64_ATHLON), + /*0x4E*/ DECLARE_BASE_INSN("dec","dec","dec",ix86_ArgIReg,ix86_ArgIReg,IX86_CPU086,K64_ATHLON), + /*0x4F*/ DECLARE_BASE_INSN("dec","dec","dec",ix86_ArgIReg,ix86_ArgIReg,IX86_CPU086,K64_ATHLON), + /*0x50*/ DECLARE_BASE_INSN("push","push","push",ix86_ArgIReg,ix86_ArgIReg,IX86_CPU086,K64_ATHLON), + /*0x51*/ DECLARE_BASE_INSN("push","push","push",ix86_ArgIReg,ix86_ArgIReg,IX86_CPU086,K64_ATHLON), + /*0x52*/ DECLARE_BASE_INSN("push","push","push",ix86_ArgIReg,ix86_ArgIReg,IX86_CPU086,K64_ATHLON), + /*0x53*/ DECLARE_BASE_INSN("push","push","push",ix86_ArgIReg,ix86_ArgIReg,IX86_CPU086,K64_ATHLON), + /*0x54*/ DECLARE_BASE_INSN("push","push","push",ix86_ArgIReg,ix86_ArgIReg,IX86_CPU086,K64_ATHLON), + /*0x55*/ DECLARE_BASE_INSN("push","push","push",ix86_ArgIReg,ix86_ArgIReg,IX86_CPU086,K64_ATHLON), + /*0x56*/ DECLARE_BASE_INSN("push","push","push",ix86_ArgIReg,ix86_ArgIReg,IX86_CPU086,K64_ATHLON), + /*0x57*/ DECLARE_BASE_INSN("push","push","push",ix86_ArgIReg,ix86_ArgIReg,IX86_CPU086,K64_ATHLON), + /*0x58*/ DECLARE_BASE_INSN("pop","pop","pop",ix86_ArgIReg,ix86_ArgIReg,IX86_CPU086,K64_ATHLON), + /*0x59*/ DECLARE_BASE_INSN("pop","pop","pop",ix86_ArgIReg,ix86_ArgIReg,IX86_CPU086,K64_ATHLON), + /*0x5A*/ DECLARE_BASE_INSN("pop","pop","pop",ix86_ArgIReg,ix86_ArgIReg,IX86_CPU086,K64_ATHLON), + /*0x5B*/ DECLARE_BASE_INSN("pop","pop","pop",ix86_ArgIReg,ix86_ArgIReg,IX86_CPU086,K64_ATHLON), + /*0x5C*/ DECLARE_BASE_INSN("pop","pop","pop",ix86_ArgIReg,ix86_ArgIReg,IX86_CPU086,K64_ATHLON), + /*0x5D*/ DECLARE_BASE_INSN("pop","pop","pop",ix86_ArgIReg,ix86_ArgIReg,IX86_CPU086,K64_ATHLON), + /*0x5E*/ DECLARE_BASE_INSN("pop","pop","pop",ix86_ArgIReg,ix86_ArgIReg,IX86_CPU086,K64_ATHLON), + /*0x5F*/ DECLARE_BASE_INSN("pop","pop","pop",ix86_ArgIReg,ix86_ArgIReg,IX86_CPU086,K64_ATHLON), + /*0x60*/ DECLARE_BASE_INSN("pushaw","pushad","pushad",NULL,NULL,IX86_CPU186,K64_ATHLON), + /*0x61*/ DECLARE_BASE_INSN("popaw","popad","popad",NULL,NULL,IX86_CPU186,K64_ATHLON), + /*0x62*/ DECLARE_BASE_INSN("bound","bound","???",ix86_ArgModRMDW,ix86_ArgModRMDW,IX86_CPU286,K64_ATHLON), + /*0x63*/ DECLARE_BASE_INSN("arpl","arpl","movsxd",ix86_ArgModRMDW,ix86_ArgModRMDW,IX86_CPU286,K64_ATHLON), + /*0x64*/ DECLARE_BASE_INSN("seg","seg","seg",ix86_ArgFS,ix86_ArgFS,IX86_CPU386,K64_ATHLON), + /*0x65*/ DECLARE_BASE_INSN("seg","seg","seg",ix86_ArgGS,ix86_ArgGS,IX86_CPU386,K64_ATHLON), + /*0x66*/ DECLARE_BASE_INSN("???","???","???",NULL,NULL,IX86_CPU386,K64_ATHLON), + /*0x67*/ DECLARE_BASE_INSN("???","???","???",NULL,NULL,IX86_CPU386,K64_ATHLON), + /*0x68*/ DECLARE_BASE_INSN("push","push","push",ix86_ArgInt,ix86_ArgInt,IX86_CPU186,K64_ATHLON), + /*0x69*/ DECLARE_BASE_INSN("imul","imul","imul",ix86_ArgRegRMDigit,ix86_ArgRegRMDigit,IX86_CPU186,K64_ATHLON), + /*0x6A*/ DECLARE_BASE_INSN("push","push","push",ix86_ArgSInt,ix86_ArgSInt,IX86_CPU186,K64_ATHLON), + /*0x6B*/ DECLARE_BASE_INSN("imul","imul","imul",ix86_ArgRegRMDigit,ix86_ArgRegRMDigit,IX86_CPU186,K64_ATHLON), + /*0x6C*/ DECLARE_BASE_INSN("insb","insb","insb",NULL,NULL,IX86_CPU186,K64_ATHLON), + /*0x6D*/ DECLARE_BASE_INSN("insw","insd","insq",NULL,NULL,IX86_CPU186,K64_ATHLON), + /*0x6E*/ DECLARE_BASE_INSN("outsb","outsb","outsb",NULL,NULL,IX86_CPU186,K64_ATHLON), + /*0x6F*/ DECLARE_BASE_INSN("outsw","outsd","outsq",NULL,NULL,IX86_CPU186,K64_ATHLON), + /*0x70*/ DECLARE_BASE_INSN("jo","jo","jo",ix86_ArgShort,ix86_ArgShort,IX86_CPU086,K64_ATHLON), + /*0x71*/ DECLARE_BASE_INSN("jno","jno","jno",ix86_ArgShort,ix86_ArgShort,IX86_CPU086,K64_ATHLON), + /*0x72*/ DECLARE_BASE_INSN("jc","jc","jc",ix86_ArgShort,ix86_ArgShort,IX86_CPU086,K64_ATHLON), + /*0x73*/ DECLARE_BASE_INSN("jnc","jnc","jnc",ix86_ArgShort,ix86_ArgShort,IX86_CPU086,K64_ATHLON), + /*0x74*/ DECLARE_BASE_INSN("je","je","je",ix86_ArgShort,ix86_ArgShort,IX86_CPU086,K64_ATHLON), + /*0x75*/ DECLARE_BASE_INSN("jne","jne","jne",ix86_ArgShort,ix86_ArgShort,IX86_CPU086,K64_ATHLON), + /*0x76*/ DECLARE_BASE_INSN("jna","jna","jna",ix86_ArgShort,ix86_ArgShort,IX86_CPU086,K64_ATHLON), + /*0x77*/ DECLARE_BASE_INSN("ja","ja","ja",ix86_ArgShort,ix86_ArgShort,IX86_CPU086,K64_ATHLON), + /*0x78*/ DECLARE_BASE_INSN("js","js","js",ix86_ArgShort,ix86_ArgShort,IX86_CPU086,K64_ATHLON), + /*0x79*/ DECLARE_BASE_INSN("jns","jns","jns",ix86_ArgShort,ix86_ArgShort,IX86_CPU086,K64_ATHLON), + /*0x7A*/ DECLARE_BASE_INSN("jp","jp","jp",ix86_ArgShort,ix86_ArgShort,IX86_CPU086,K64_ATHLON), + /*0x7B*/ DECLARE_BASE_INSN("jnp","jnp","jnp",ix86_ArgShort,ix86_ArgShort,IX86_CPU086,K64_ATHLON), + /*0x7C*/ DECLARE_BASE_INSN("jl","jl","jl",ix86_ArgShort,ix86_ArgShort,IX86_CPU086,K64_ATHLON), + /*0x7D*/ DECLARE_BASE_INSN("jnl","jnl","jnl",ix86_ArgShort,ix86_ArgShort,IX86_CPU086,K64_ATHLON), + /*0x7E*/ DECLARE_BASE_INSN("jle","jle","jle",ix86_ArgShort,ix86_ArgShort,IX86_CPU086,K64_ATHLON), + /*0x7F*/ DECLARE_BASE_INSN("jg","jg","jg",ix86_ArgShort,ix86_ArgShort,IX86_CPU086,K64_ATHLON), + /*0x80*/ DECLARE_BASE_INSN("!!!","!!!","!!!",ix86_ArgOp1,ix86_ArgOp1,IX86_CPU086,K64_ATHLON), + /*0x81*/ DECLARE_BASE_INSN("!!!","!!!","!!!",ix86_ArgOp1,ix86_ArgOp1,IX86_CPU086,K64_ATHLON), + /*0x82*/ DECLARE_BASE_INSN("!!!","!!!","!!!",ix86_ArgOp2,ix86_ArgOp2,IX86_CPU086,K64_ATHLON), + /*0x83*/ DECLARE_BASE_INSN("!!!","!!!","!!!",ix86_ArgOp2,ix86_ArgOp2,IX86_CPU086,K64_ATHLON), + /*0x84*/ DECLARE_BASE_INSN("test","test","test",ix86_ArgModRMnDnW,ix86_ArgModRMnDnW,IX86_CPU086,K64_ATHLON), + /*0x85*/ DECLARE_BASE_INSN("test","test","test",ix86_ArgModRMnDW,ix86_ArgModRMnDW,IX86_CPU086,K64_ATHLON), + /*0x86*/ DECLARE_BASE_INSN("xchg","xchg","xchg",ix86_ArgModRMDnW,ix86_ArgModRMDnW,IX86_CPU086,K64_ATHLON), + /*0x87*/ DECLARE_BASE_INSN("xchg","xchg","xchg",ix86_ArgModRMDW,ix86_ArgModRMDW,IX86_CPU086,K64_ATHLON), + /*0x88*/ DECLARE_BASE_INSN("mov","mov","mov",ix86_ArgModRMnDnW,ix86_ArgModRMnDnW,IX86_CPU086,K64_ATHLON), + /*0x89*/ DECLARE_BASE_INSN("mov","mov","mov",ix86_ArgModRMnDW,ix86_ArgModRMnDW,IX86_CPU086,K64_ATHLON), + /*0x8A*/ DECLARE_BASE_INSN("mov","mov","mov",ix86_ArgModRMDnW,ix86_ArgModRMDnW,IX86_CPU086,K64_ATHLON), + /*0x8B*/ DECLARE_BASE_INSN("mov","mov","mov",ix86_ArgModRMDW,ix86_ArgModRMDW,IX86_CPU086,K64_ATHLON), + /*0x8C*/ DECLARE_BASE_INSN("mov","mov","mov",ix86_SMov,ix86_SMov,IX86_CPU086,K64_ATHLON), + /*0x8D*/ DECLARE_BASE_INSN("lea","lea","lea",ix86_ArgModRMDW,ix86_ArgModRMDW,IX86_CPU086,K64_ATHLON), + /*0x8E*/ DECLARE_BASE_INSN("mov","mov","mov",ix86_SMov,ix86_SMov,IX86_CPU086,K64_ATHLON), + /*0x8F*/ DECLARE_BASE_INSN("pop","pop","pop",ix86_ArgMod,ix86_ArgMod,IX86_CPU086,K64_ATHLON), + /*0x90*/ DECLARE_BASE_INSN("nop","nop","nop",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0x91*/ DECLARE_BASE_INSN("xchg","xchg","xchg",ix86_ArgAXIReg,ix86_ArgAXIReg,IX86_CPU086,K64_ATHLON), + /*0x92*/ DECLARE_BASE_INSN("xchg","xchg","xchg",ix86_ArgAXIReg,ix86_ArgAXIReg,IX86_CPU086,K64_ATHLON), + /*0x93*/ DECLARE_BASE_INSN("xchg","xchg","xchg",ix86_ArgAXIReg,ix86_ArgAXIReg,IX86_CPU086,K64_ATHLON), + /*0x94*/ DECLARE_BASE_INSN("xchg","xchg","xchg",ix86_ArgAXIReg,ix86_ArgAXIReg,IX86_CPU086,K64_ATHLON), + /*0x95*/ DECLARE_BASE_INSN("xchg","xchg","xchg",ix86_ArgAXIReg,ix86_ArgAXIReg,IX86_CPU086,K64_ATHLON), + /*0x96*/ DECLARE_BASE_INSN("xchg","xchg","xchg",ix86_ArgAXIReg,ix86_ArgAXIReg,IX86_CPU086,K64_ATHLON), + /*0x97*/ DECLARE_BASE_INSN("xchg","xchg","xchg",ix86_ArgAXIReg,ix86_ArgAXIReg,IX86_CPU086,K64_ATHLON), + /*0x98*/ DECLARE_BASE_INSN("cbw","cwde","cwde",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0x99*/ DECLARE_BASE_INSN("cwd","cdq","cdq",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0x9A*/ DECLARE_BASE_INSN("callf16","callf32","???",ix86_ArgFar,ix86_ArgFar,IX86_CPU086,K64_ATHLON), + /*0x9B*/ DECLARE_BASE_INSN("wait","wait","wait",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0x9C*/ DECLARE_BASE_INSN("pushfw","pushfd","pushfd",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0x9D*/ DECLARE_BASE_INSN("popfw","popfd","popfd",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0x9E*/ DECLARE_BASE_INSN("sahf","sahf","???",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0x9F*/ DECLARE_BASE_INSN("lahf","lahf","???",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0xA0*/ DECLARE_BASE_INSN("mov","mov","mov",ix86_ArgAXMem,ix86_ArgAXMem,IX86_CPU086,K64_ATHLON), + /*0xA1*/ DECLARE_BASE_INSN("mov","mov","mov",ix86_ArgAXMem,ix86_ArgAXMem,IX86_CPU086,K64_ATHLON), + /*0xA2*/ DECLARE_BASE_INSN("mov","mov","mov",ix86_ArgAXMem,ix86_ArgAXMem,IX86_CPU086,K64_ATHLON), + /*0xA3*/ DECLARE_BASE_INSN("mov","mov","mov",ix86_ArgAXMem,ix86_ArgAXMem,IX86_CPU086,K64_ATHLON), + /*0xA4*/ DECLARE_BASE_INSN("movsb","movsb","movsb",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0xA5*/ DECLARE_BASE_INSN("movsw","movsd","movsq",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0xA6*/ DECLARE_BASE_INSN("cmpsb","cmpsb","cmpsb",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0xA7*/ DECLARE_BASE_INSN("cmpsw","cmpsd","cmpsq",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0xA8*/ DECLARE_BASE_INSN("test","test","test",ix86_ArgAXDigit,ix86_ArgAXDigit,IX86_CPU086,K64_ATHLON), + /*0xA9*/ DECLARE_BASE_INSN("test","test","test",ix86_ArgAXDigit,ix86_ArgAXDigit,IX86_CPU086,K64_ATHLON), + /*0xAA*/ DECLARE_BASE_INSN("stosb","stosb","stosb",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0xAB*/ DECLARE_BASE_INSN("stosw","stosd","stosq",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0xAC*/ DECLARE_BASE_INSN("lodsb","lodsb","lodsb",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0xAD*/ DECLARE_BASE_INSN("lodsw","lodsd","lodsq",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0xAE*/ DECLARE_BASE_INSN("scasb","scasb","scasb",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0xAF*/ DECLARE_BASE_INSN("scasw","scasd","scasq",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0xB0*/ DECLARE_BASE_INSN("mov","mov","mov",ix86_ArgIRegDigit,ix86_ArgIRegDigit,IX86_CPU086,K64_ATHLON), + /*0xB1*/ DECLARE_BASE_INSN("mov","mov","mov",ix86_ArgIRegDigit,ix86_ArgIRegDigit,IX86_CPU086,K64_ATHLON), + /*0xB2*/ DECLARE_BASE_INSN("mov","mov","mov",ix86_ArgIRegDigit,ix86_ArgIRegDigit,IX86_CPU086,K64_ATHLON), + /*0xB3*/ DECLARE_BASE_INSN("mov","mov","mov",ix86_ArgIRegDigit,ix86_ArgIRegDigit,IX86_CPU086,K64_ATHLON), + /*0xB4*/ DECLARE_BASE_INSN("mov","mov","mov",ix86_ArgIRegDigit,ix86_ArgIRegDigit,IX86_CPU086,K64_ATHLON), + /*0xB5*/ DECLARE_BASE_INSN("mov","mov","mov",ix86_ArgIRegDigit,ix86_ArgIRegDigit,IX86_CPU086,K64_ATHLON), + /*0xB6*/ DECLARE_BASE_INSN("mov","mov","mov",ix86_ArgIRegDigit,ix86_ArgIRegDigit,IX86_CPU086,K64_ATHLON), + /*0xB7*/ DECLARE_BASE_INSN("mov","mov","mov",ix86_ArgIRegDigit,ix86_ArgIRegDigit,IX86_CPU086,K64_ATHLON), + /*0xB8*/ DECLARE_BASE_INSN("mov","mov","mov",ix86_ArgIRegDigit,ix86_ArgIRegDigit,IX86_CPU086,K64_ATHLON), + /*0xB9*/ DECLARE_BASE_INSN("mov","mov","mov",ix86_ArgIRegDigit,ix86_ArgIRegDigit,IX86_CPU086,K64_ATHLON), + /*0xBA*/ DECLARE_BASE_INSN("mov","mov","mov",ix86_ArgIRegDigit,ix86_ArgIRegDigit,IX86_CPU086,K64_ATHLON), + /*0xBB*/ DECLARE_BASE_INSN("mov","mov","mov",ix86_ArgIRegDigit,ix86_ArgIRegDigit,IX86_CPU086,K64_ATHLON), + /*0xBC*/ DECLARE_BASE_INSN("mov","mov","mov",ix86_ArgIRegDigit,ix86_ArgIRegDigit,IX86_CPU086,K64_ATHLON), + /*0xBD*/ DECLARE_BASE_INSN("mov","mov","mov",ix86_ArgIRegDigit,ix86_ArgIRegDigit,IX86_CPU086,K64_ATHLON), + /*0xBE*/ DECLARE_BASE_INSN("mov","mov","mov",ix86_ArgIRegDigit,ix86_ArgIRegDigit,IX86_CPU086,K64_ATHLON), + /*0xBF*/ DECLARE_BASE_INSN("mov","mov","mov",ix86_ArgIRegDigit,ix86_ArgIRegDigit,IX86_CPU086,K64_ATHLON), + /*0xC0*/ DECLARE_BASE_INSN("!!!","!!!","!!!",ix86_ShOp2,ix86_ShOp2,IX86_CPU186,K64_ATHLON), + /*0xC1*/ DECLARE_BASE_INSN("!!!","!!!","!!!",ix86_ShOp2,ix86_ShOp2,IX86_CPU186,K64_ATHLON), + /*0xC2*/ DECLARE_BASE_INSN("retn16","retn32","retn32",ix86_ArgWord,ix86_ArgWord,IX86_CPU086,K64_ATHLON), + /*0xC3*/ DECLARE_BASE_INSN("retn16","retn32","retn32",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0xC4*/ DECLARE_BASE_INSN("les","les","???",ix86_ArgModRMDW,ix86_ArgModRMDW,IX86_CPU086,K64_ATHLON), + /*0xC5*/ DECLARE_BASE_INSN("lds","lds","???",ix86_ArgModRMDW,ix86_ArgModRMDW,IX86_CPU086,K64_ATHLON), + /*0xC6*/ DECLARE_BASE_INSN("mov","mov","mov",ix86_ArgRMDigit,ix86_ArgRMDigit,IX86_CPU086,K64_ATHLON), + /*0xC7*/ DECLARE_BASE_INSN("mov","mov","mov",ix86_ArgRMDigit,ix86_ArgRMDigit,IX86_CPU086,K64_ATHLON), + /*0xC8*/ DECLARE_BASE_INSN("enter","enter","enter",ix86_ArgWord_Byte,ix86_ArgWord_Byte,IX86_CPU186,K64_ATHLON), + /*0xC9*/ DECLARE_BASE_INSN("leave","leave","leave",NULL,NULL,IX86_CPU186,K64_ATHLON), + /*0xCA*/ DECLARE_BASE_INSN("retf16","retf32","retf32",ix86_ArgWord,ix86_ArgWord,IX86_CPU086,K64_ATHLON), + /*0xCB*/ DECLARE_BASE_INSN("retf16","retf32","retf32",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0xCC*/ DECLARE_BASE_INSN("int3","int3","int3",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0xCD*/ DECLARE_BASE_INSN("int","int","int",ix86_ArgByte,ix86_ArgByte,IX86_CPU086,K64_ATHLON), + /*0xCE*/ DECLARE_BASE_INSN("into16","into32","???",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0xCF*/ DECLARE_BASE_INSN("iret16","iret32","iret32",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0xD0*/ DECLARE_BASE_INSN("!!!","!!!","!!!",ix86_ShOp1,ix86_ShOp1,IX86_CPU086,K64_ATHLON), + /*0xD1*/ DECLARE_BASE_INSN("!!!","!!!","!!!",ix86_ShOp1,ix86_ShOp1,IX86_CPU086,K64_ATHLON), + /*0xD2*/ DECLARE_BASE_INSN("!!!","!!!","!!!",ix86_ShOpCL,ix86_ShOpCL,IX86_CPU086,K64_ATHLON), + /*0xD3*/ DECLARE_BASE_INSN("!!!","!!!","!!!",ix86_ShOpCL,ix86_ShOpCL,IX86_CPU086,K64_ATHLON), + /*0xD4*/ DECLARE_BASE_INSN("aam on","aam on","???",ix86_ArgByte,ix86_ArgByte,IX86_CPU086,K64_ATHLON), + /*0xD5*/ DECLARE_BASE_INSN("aad on","aad on","???",ix86_ArgByte,ix86_ArgByte,IX86_CPU086,K64_ATHLON), + /*0xD6*/ DECLARE_BASE_INSN("salc","salc","salc",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0xD7*/ DECLARE_BASE_INSN("xlat","xlat","xlat",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0xD8*/ DECLARE_BASE_INSN("esc","esc","esc",ix86_FPUCmd,ix86_FPUCmd,IX86_CPU086,K64_ATHLON), + /*0xD9*/ DECLARE_BASE_INSN("esc","esc","esc",ix86_FPUCmd,ix86_FPUCmd,IX86_CPU086,K64_ATHLON), + /*0xDA*/ DECLARE_BASE_INSN("esc","esc","esc",ix86_FPUCmd,ix86_FPUCmd,IX86_CPU086,K64_ATHLON), + /*0xDB*/ DECLARE_BASE_INSN("esc","esc","esc",ix86_FPUCmd,ix86_FPUCmd,IX86_CPU086,K64_ATHLON), + /*0xDC*/ DECLARE_BASE_INSN("esc","esc","esc",ix86_FPUCmd,ix86_FPUCmd,IX86_CPU086,K64_ATHLON), + /*0xDD*/ DECLARE_BASE_INSN("esc","esc","esc",ix86_FPUCmd,ix86_FPUCmd,IX86_CPU086,K64_ATHLON), + /*0xDE*/ DECLARE_BASE_INSN("esc","esc","esc",ix86_FPUCmd,ix86_FPUCmd,IX86_CPU086,K64_ATHLON), + /*0xDF*/ DECLARE_BASE_INSN("esc","esc","esc",ix86_FPUCmd,ix86_FPUCmd,IX86_CPU086,K64_ATHLON), + /*0xE0*/ DECLARE_BASE_INSN("loopnz","loopnz","loopnz",ix86_ArgShort,ix86_ArgShort,IX86_CPU086,K64_ATHLON), + /*0xE1*/ DECLARE_BASE_INSN("loopz","loopz","loopz",ix86_ArgShort,ix86_ArgShort,IX86_CPU086,K64_ATHLON), + /*0xE2*/ DECLARE_BASE_INSN("loop","loop","loop",ix86_ArgShort,ix86_ArgShort,IX86_CPU086,K64_ATHLON), + /*0xE3*/ DECLARE_BASE_INSN("jcxz","jecxz","jrcxz",ix86_ArgShort,ix86_ArgShort,IX86_CPU086,K64_ATHLON), + /*0xE4*/ DECLARE_BASE_INSN("in","in","in",ix86_InOut,ix86_InOut,IX86_CPU086,K64_ATHLON), + /*0xE5*/ DECLARE_BASE_INSN("in","in","in",ix86_InOut,ix86_InOut,IX86_CPU086,K64_ATHLON), + /*0xE6*/ DECLARE_BASE_INSN("out","out","out",ix86_InOut,ix86_InOut,IX86_CPU086,K64_ATHLON), + /*0xE7*/ DECLARE_BASE_INSN("out","out","out",ix86_InOut,ix86_InOut,IX86_CPU086,K64_ATHLON), + /*0xE8*/ DECLARE_BASE_INSN("calln16","calln32","calln32",ix86_ArgNear,ix86_ArgNear,IX86_CPU086,K64_ATHLON), + /*0xE9*/ DECLARE_BASE_INSN("jmpn16","jmpn32","jmpn32",ix86_ArgNear,ix86_ArgNear,IX86_CPU086,K64_ATHLON), + /*0xEA*/ DECLARE_BASE_INSN("jmpf16","jmpf32","???",ix86_ArgFar,ix86_ArgFar,IX86_CPU086,K64_ATHLON), + /*0xEB*/ DECLARE_BASE_INSN("jmps","jmps","jmps",ix86_ArgShort,ix86_ArgShort,IX86_CPU086,K64_ATHLON), + /*0xEC*/ DECLARE_BASE_INSN("in","in","in",ix86_InOut,ix86_InOut,IX86_CPU086,K64_ATHLON), + /*0xED*/ DECLARE_BASE_INSN("in","in","in",ix86_InOut,ix86_InOut,IX86_CPU086,K64_ATHLON), + /*0xEE*/ DECLARE_BASE_INSN("out","out","out",ix86_InOut,ix86_InOut,IX86_CPU086,K64_ATHLON), + /*0xEF*/ DECLARE_BASE_INSN("out","out","out",ix86_InOut,ix86_InOut,IX86_CPU086,K64_ATHLON), + /*0xF0*/ DECLARE_BASE_INSN("lock","lock","lock",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0xF1*/ DECLARE_BASE_INSN("icebp","icebp","icebp",NULL,NULL,IX86_CPU386,K64_ATHLON), + /*0xF2*/ DECLARE_BASE_INSN("repne","repne","repne",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0xF3*/ DECLARE_BASE_INSN("rep","rep","rep",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0xF4*/ DECLARE_BASE_INSN("hlt","hlt","hlt",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0xF5*/ DECLARE_BASE_INSN("cmc","cmc","cmc",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0xF6*/ DECLARE_BASE_INSN("!!!","!!!","!!!",ix86_ArgGrp1,ix86_ArgGrp1,IX86_CPU086,K64_ATHLON), + /*0xF7*/ DECLARE_BASE_INSN("!!!","!!!","!!!",ix86_ArgGrp1,ix86_ArgGrp1,IX86_CPU086,K64_ATHLON), + /*0xF8*/ DECLARE_BASE_INSN("clc","clc","clc",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0xF9*/ DECLARE_BASE_INSN("stc","stc","stc",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0xFA*/ DECLARE_BASE_INSN("cli","cli","cli",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0xFB*/ DECLARE_BASE_INSN("sti","sti","sti",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0xFC*/ DECLARE_BASE_INSN("cld","cld","cld",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0xFD*/ DECLARE_BASE_INSN("std","std","std",NULL,NULL,IX86_CPU086,K64_ATHLON), + /*0xFE*/ DECLARE_BASE_INSN("!!!","!!!","!!!",ix86_ArgGrp2,ix86_ArgGrp2,IX86_CPU086,K64_ATHLON), + /*0xFF*/ DECLARE_BASE_INSN("!!!","!!!","!!!",ix86_ArgGrp2,ix86_ArgGrp2,IX86_CPU086,K64_ATHLON) }; ix86_ExOpcodes ix86_extable[256] = /* for 0FH leading */ @@ -1897,7 +1931,7 @@ const char *ix86_KatmaiCmpSuffixes[] = { "eq", "lt", "le", "unord", "neq", "nlt", "nle", "ord" }; -static unsigned x86_Bitness = DAB_AUTO; +unsigned x86_Bitness = DAB_AUTO; static unsigned BITNESS = DAB_AUTO; char *ix86_voidstr; @@ -1905,7 +1939,7 @@ char ix86_segpref[4] = ""; -tBool Use32Addr,Use32Data,UseMMXSet,UseXMMXSet; +tBool Use32Addr,Use32Data,UseMMXSet,UseXMMXSet,Use64; const unsigned char leave_insns[] = { 0x07, 0x17, 0x1F, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, 0x61, 0x90, 0xC9 }; @@ -1920,15 +1954,41 @@ { MBuffer insn; char ua,ud,up,has_lock,has_rep,has_seg; +#ifdef INT64_C + char has_rex; +#endif insn = &_DisP->RealCmd[0]; dret->pro_clone = __INSNT_ORDINAL; has_lock = has_rep = has_seg = 0; up = ua = ud = 0; +#ifdef INT64_C + has_rex=0; + k86_REX=0; +#endif RepeateByPrefix: if(has_lock + has_rep > 1 || has_seg > 1 || ua > 1 || ud > 1) goto get_type; /** do prefixes loop */ switch(insn[0]) { +#ifdef INT64_C + case 0x40: + case 0x41: + case 0x42: + case 0x43: + case 0x44: + case 0x45: + case 0x46: + case 0x47: + case 0x48: + case 0x49: + case 0x4A: + case 0x4B: + case 0x4C: + case 0x4D: + case 0x4E: + case 0x4F: if(x86_Bitness == DAB_USE64 && !has_rex) { has_rex++; k86_REX = insn[0]; goto MakePref; } + break; +#endif case 0x26: case 0x2E: case 0x36: @@ -2092,13 +2152,22 @@ if(BITNESS == DAB_AUTO && detectedFormat->query_bitness) x86_Bitness = detectedFormat->query_bitness(ulShift); else x86_Bitness = BITNESS; - if(x86_Bitness == DAB_USE32) + if(x86_Bitness == DAB_USE32 +#ifdef INT64_C + || x86_Bitness == DAB_USE64 +#endif + ) { Use32Data = Use32Data ? False : True; Use32Addr = Use32Addr ? False : True; } Ret.str = ix86_voidstr; Ret.str[0] = 0; +#ifdef INT64_C + has_REX=0; + k86_REX=0; + Use64 = 0; +#endif RepeateByPrefix: if(has_lock + has_rep > 1 || has_seg > 1 || ua > 1 || ud > 1) { @@ -2109,6 +2178,31 @@ /** do prefixes loop */ switch(code) { +#ifdef INT64_C + case 0x40: + case 0x41: + case 0x42: + case 0x43: + case 0x44: + case 0x45: + case 0x46: + case 0x47: + case 0x48: + case 0x49: + case 0x4A: + case 0x4B: + case 0x4C: + case 0x4D: + case 0x4E: + case 0x4F: if(x86_Bitness == DAB_USE64 && !has_REX) + { + has_REX++; + k86_REX = code; + Use64 = (code & 0x0F)>>3; + goto MakePref; + } + break; +#endif case 0x26: if(has_seg) break; strcpy(ix86_segpref,"es:"); @@ -2234,7 +2328,22 @@ up++; goto RepeateByPrefix; } +#ifdef INT64_C + if(x86_Bitness == DAB_USE64) strcpy(Ret.str,ix86_table[code].name64); + else +#endif strcpy(Ret.str,Use32Data ? ix86_table[code].name32 : ix86_table[code].name16); +#ifdef INT64_C + if(x86_Bitness == DAB_USE64) + { + if(ix86_table[code].method64) + { + TabSpace(Ret.str,TAB_POS); + ix86_table[code].method64(Ret.str,&DisP); + } + } + else +#endif if(ix86_table[code].method) { TabSpace(Ret.str,TAB_POS); @@ -2269,12 +2378,18 @@ break; default: break; } - if((DisP.pro_clone & IX86_CPUMASK) < ix86_table[code].pro_clone) DisP.pro_clone = ix86_table[code].pro_clone; - if((DisP.pro_clone & IX86_FPUMASK) < (ix86_table[code].pro_clone & IX86_FPUMASK) && - (DisP.pro_clone & IX86_CPUMASK) == IX86_CPUMASK) DisP.pro_clone = ix86_table[code].pro_clone; - if((DisP.pro_clone & IX86_MMXMASK) < (ix86_table[code].pro_clone & IX86_MMXMASK) && - (DisP.pro_clone & IX86_CPUMASK) == IX86_CPUMASK && - (DisP.pro_clone & IX86_FPUMASK) == IX86_FPUMASK ) DisP.pro_clone = ix86_table[code].pro_clone; +#ifdef INT64_C + if(x86_Bitness == DAB_USE64) DisP.pro_clone = ix86_table[code].flags64 & K64_CLONEMASK; + else +#endif + { + if((DisP.pro_clone & IX86_CPUMASK) < ix86_table[code].pro_clone) DisP.pro_clone = ix86_table[code].pro_clone; + if((DisP.pro_clone & IX86_FPUMASK) < (ix86_table[code].pro_clone & IX86_FPUMASK) && + (DisP.pro_clone & IX86_CPUMASK) == IX86_CPUMASK) DisP.pro_clone = ix86_table[code].pro_clone; + if((DisP.pro_clone & IX86_MMXMASK) < (ix86_table[code].pro_clone & IX86_MMXMASK) && + (DisP.pro_clone & IX86_CPUMASK) == IX86_CPUMASK && + (DisP.pro_clone & IX86_FPUMASK) == IX86_FPUMASK ) DisP.pro_clone = ix86_table[code].pro_clone; + } ExitDisAsm: if(up) DisP.codelen+=up; if(ix86_segpref[0]) @@ -2287,6 +2402,9 @@ if(ix86_da_out[0]) TabSpace(ix86_da_out,TAB_POS); strcat(ix86_da_out,Ret.str); Ret.str = ix86_da_out; +#ifdef INT64_C + if(x86_Bitness < DAB_USE64) +#endif if(Use32Data || Use32Addr || x86_Bitness == DAB_USE32) { if((DisP.pro_clone & IX86_CPUMASK) < IX86_CPU386) DisP.pro_clone |= IX86_CPU386; @@ -2342,8 +2460,28 @@ " ??? " }; +#ifdef INT64_C +static const char * CPU64Names[] = +{ + "K86-64", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " " +}; +#endif + static ColorAttr __FASTCALL__ ix86GetAsmColor(unsigned long clone) { +#ifdef INT64_C + if(x86_Bitness == DAB_USE64) return disasm_cset.cpu_cset[0].clone[clone]; + else +#endif if(clone & IX86_MMXMASK) return disasm_cset.cpu_cset[2].clone[(clone >> 16) & 0xFF]; else if((clone & IX86_FPUMASK) || clone == IX86_FPU087) return disasm_cset.cpu_cset[1].clone[(clone >> 8) & 0xFF]; @@ -2430,6 +2568,9 @@ { "Use1~6", "Use~32", +#ifdef INT64_C + "Use6~4", +#endif "~Auto" }; @@ -2438,15 +2579,15 @@ unsigned nModes; int i; nModes = sizeof(use_names)/sizeof(char *); - if(BITNESS == DAB_AUTO) BITNESS = 2; + if(BITNESS == DAB_AUTO) BITNESS = 3; i = SelBoxA(use_names,nModes," Select bitness mode: ",BITNESS); if(i != -1) { - if(i == 2) i = DAB_AUTO; + if(i == 3) i = DAB_AUTO; BITNESS = x86_Bitness = i; return True; } - else if(BITNESS == 2) BITNESS = x86_Bitness = DAB_AUTO; + else if(BITNESS == 3) BITNESS = x86_Bitness = DAB_AUTO; return False; } @@ -2500,7 +2641,7 @@ { biewReadProfileString(ini,"Biew","Browser","SubSubMode3","1",tmps,sizeof(tmps)); BITNESS = (unsigned)strtoul(tmps,NULL,10); - if(BITNESS > 1 && BITNESS != DAB_AUTO) BITNESS = 0; + if(BITNESS > 2 && BITNESS != DAB_AUTO) BITNESS = 0; x86_Bitness = BITNESS; } } Index: ix86.h =================================================================== RCS file: /cvsroot/biew/biew/plugins/disasm/ix86/ix86.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- ix86.h 18 Nov 2001 17:05:49 -0000 1.1.1.1 +++ ix86.h 26 Nov 2002 17:40:48 -0000 1.2 @@ -49,7 +49,7 @@ unsigned char codelen; }ix86Param; -extern tBool Use32Addr,Use32Data,UseMMXSet,UseXMMXSet; +extern tBool Use32Addr,Use32Data,UseMMXSet,UseXMMXSet,Use64; extern char * SJump[]; typedef void (__FASTCALL__*ix86_method)(char *encode_str,ix86Param *); @@ -117,12 +117,22 @@ #define IX86_CYRIX686MMX IX86_CYRIX | IX86_MMX586 #define IX86_UNKCYRIX IX86_CYRIX | IX86_CPU686 +#define K64_ATHLON 0x00000000UL +#define K64_CLONEMASK 0x00FFFFFFUL + typedef struct tag_ix86opcodes { const char * name16; const char * name32; +#ifdef INT64_C + const char * name64; +#endif ix86_method method; unsigned long pro_clone; +#ifdef INT64_C + ix86_method method64; + unsigned long flags64; +#endif }ix86_Opcodes; typedef struct tag_ix86ExOpcodes @@ -138,6 +148,7 @@ unsigned long pro_clone; }ix86_3dNowopcodes; +extern unsigned x86_Bitness; extern ix86_Opcodes ix86_table[]; extern ix86_ExOpcodes ix86_extable[]; @@ -153,6 +164,15 @@ extern const char * ix86_DWordRegs[]; extern const char * ix86_MMXRegs[]; extern const char * ix86_XMMXRegs[]; +#ifdef INT64_C +extern const char * k86_ByteRegs[]; +extern const char * k86_WordRegs[]; +extern const char * k86_DWordRegs[]; +extern const char * k86_QWordRegs[]; +extern const char * k86_XMMXRegs[]; +extern unsigned char k86_REX; +extern int has_REX; +#endif extern const char * ix86_SegRegs[]; extern const char * ix86_CrxRegs[]; extern const char * ix86_DrxRegs[]; Index: ix86_fun.c =================================================================== RCS file: /cvsroot/biew/biew/plugins/disasm/ix86/ix86_fun.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ix86_fun.c 5 Apr 2002 18:42:12 -0000 1.3 +++ ix86_fun.c 26 Nov 2002 17:40:49 -0000 1.4 @@ -41,14 +41,43 @@ #define getSREG(sreg) (ix86_SegRegs[(unsigned char)sreg]) #define getTile(DisP) __getTile(DisP,DisP->RealCmd[0] & 0x01,DisP->RealCmd[0] & 0x02) -static const char * __FASTCALL__ ix86_getREG(unsigned char reg,tBool w) +#ifdef INT64_C +#define REX_reg(rex,reg) (reg|((rex&1)<<3)) +#endif + +static const char * __FASTCALL__ k86_getREG(unsigned char reg,tBool w,tBool rex, tBool use64) { +#ifdef INT64_C + if(UseXMMXSet) return x86_Bitness==DAB_USE64?k86_XMMXRegs[REX_reg(rex,reg)]:ix86_XMMXRegs[reg]; + else + if(UseMMXSet) return ix86_MMXRegs[reg]; + else + if(!w) return (x86_Bitness==DAB_USE64&&has_REX)?k86_ByteRegs[REX_reg(rex,reg)]:ix86_ByteRegs[reg]; + else + if(x86_Bitness==DAB_USE64) + return use64?k86_QWordRegs[REX_reg(rex,reg)]:Use32Data?k86_DWordRegs[REX_reg(rex,reg)]:k86_WordRegs[REX_reg(rex,reg)]; + else return Use32Data ? ix86_DWordRegs[reg] : ix86_WordRegs[reg]; +#else if(UseXMMXSet) return ix86_XMMXRegs[reg]; else if(UseMMXSet) return ix86_MMXRegs[reg]; else if(!w) return ix86_ByteRegs[reg]; else return Use32Data ? ix86_DWordRegs[reg] : ix86_WordRegs[reg]; + rex=rex; +#endif +} + + +static const char * __FASTCALL__ ix86_getREG(unsigned char reg,tBool w) +{ + tBool rex; +#ifdef INT64_C + rex = (k86_REX&4)>>2; +#else + rex=0; +#endif + return k86_getREG(reg, w, rex, Use64); } static char * __NEAR__ __FASTCALL__ GetDigitsApp(unsigned char loc_off, @@ -68,7 +97,10 @@ #define Get4SignDigApp(loc_off,DisP) GetDigitsApp(loc_off,DisP,2,DISARG_SHORT) #define Get8DigitApp(loc_off,DisP) GetDigitsApp(loc_off,DisP,4,DISARG_DWORD) #define Get8SignDigApp(loc_off,DisP) GetDigitsApp(loc_off,DisP,4,DISARG_LONG) - +#ifdef INT64_C +#define Get16DigitApp(loc_off,DisP) GetDigitsApp(loc_off,DisP,8,DISARG_QWORD) +#define Get16SignDigApp(loc_off,DisP) GetDigitsApp(loc_off,DisP,8,DISARG_LLONG) +#endif static char * __NEAR__ __FASTCALL__ Get2SquareDig(unsigned char loc_off,ix86Param *DisP,tBool as_sign) { char *ptr = ix86_apistr; @@ -117,6 +149,25 @@ return ix86_apistr; } +#ifdef INT64_C +static char * __NEAR__ __FASTCALL__ Get16SquareDig(unsigned char loc_off,ix86Param *DisP,tBool as_sign,tBool is_disponly) +{ + char *ptr = ix86_apistr; + char *rets; + unsigned type; + *ptr = 0; + if(!((DisP->flags & __DISF_SIZEONLY) == __DISF_SIZEONLY)) + { + type = as_sign ? DISARG_LLONG : DISARG_QWORD; + type |= is_disponly ? DISARG_DISP : DISARG_IDXDISP; + rets = GetDigitsApp(loc_off,DisP,8,type); + if(!(rets[0] == '+' || rets[0] == '-')) *ptr++ = '+'; + strcpy(ptr,rets); + } + return ix86_apistr; +} +#endif + void __FASTCALL__ ix86_ArgES(char *str,ix86Param *param) { UNUSED(param); @@ -194,9 +245,20 @@ static char * __FASTCALL__ ix86_GetDigitTile(ix86Param* DisP,char wrd,char sgn,unsigned char loc_off) { int cl,type; - cl = wrd ? ( Use32Data ? 4 : 2 ) : 1; +#ifdef INT64_C + int do_64; + do_64 = 0; + if(x86_Bitness == DAB_USE64 && wrd == -1) /* special case for */ + do_64 = 1; +#endif + cl = do_64 ? 8 : wrd ? ( Use32Data ? 4 : 2 ) : 1; if(!((DisP->flags & __DISF_SIZEONLY) == __DISF_SIZEONLY)) { +#ifdef INT64_C + if(do_64) + type = sgn ? DISARG_LLONG : DISARG_QWORD; + else +#endif type = sgn ? wrd ? ( Use32Data ? DISARG_LONG : DISARG_SHORT ) : DISARG_CHAR: wrd ? ( Use32Data ? DISARG_DWORD : DISARG_WORD ) : DISARG_BYTE; type |= DISARG_IMM; @@ -274,9 +336,35 @@ } else scale[0] = 0; if(ind == 4) _index[0] = 0; - else strcpy(_index,ix86_getREG(ind,True)); + else + { +#ifdef INT64_C + if(x86_Bitness == DAB_USE64) + { + tBool use64; + /* trickly: use32 is set by default. If it's unset then there is 67 prefix */ + use64 = Use32Addr?1:0; + strcpy(_index,k86_getREG(ind,True,(k86_REX&2)>>1,use64)); + } + else +#endif + strcpy(_index,ix86_getREG(ind,True)); + } if(bas == 5 && *mod == 0) { base[0] = 0; *mod = 2; } - else strcpy(base,ix86_getREG(bas,True)); + else + { +#ifdef INT64_C + if(x86_Bitness == DAB_USE64) + { + tBool use64; + /* trickly: use32 is set by default. If it's unset then there is 67 prefix */ + use64 = Use32Addr?1:0; + strcpy(base,k86_getREG(bas,True,(k86_REX&1)>>0,use64)); + } + else +#endif + strcpy(base,ix86_getREG(bas,True)); + } Use32Data = use32data; UseMMXSet = useMMX; UseXMMXSet = useXMMX; @@ -317,6 +405,13 @@ if(rm == 4 && Use32Addr) cptr = ConstrSibMod(ret1,base,_index,scale,DisP->RealCmd[2],&new_mode); else { +#ifdef INT64_C + if(x86_Bitness == DAB_USE64) + { + cptr = Use32Addr ? k86_QWordRegs[REX_reg(k86_REX&1,rm)] : k86_DWordRegs[REX_reg(k86_REX&1,rm)]; + } + else +#endif cptr = Use32Addr ? ix86_DWordRegs[rm] : ix86_A16[rm]; #if 0 is_stack = Use32Addr ? rm == 4 || rm == 5 : rm == 2 || rm == 3 || rm == 6; @@ -560,6 +655,9 @@ char w = (DisP->RealCmd[0] >> 3 ) & 0x01; char reg = (DisP->RealCmd[0]) & 0x07; strcat(str,ix86_getREG(reg,w)); +#ifdef INT64_C + if(x86_Bitness == DAB_USE64 && Use64 && w) w = -1; +#endif ix86_CStile(str,ix86_GetDigitTile(DisP,w,0,1)); } @@ -735,13 +833,31 @@ { unsigned char d = DisP->RealCmd[0] & 0x02; const char *mem,*reg; - mem = Use32Addr ? Get8SquareDig(1,DisP,False,True) : Get4SquareDig(1,DisP,False,True); +#ifdef INT64_C + unsigned char sav_REX; + sav_REX = k86_REX; + if(x86_Bitness == DAB_USE64 && Use64) + mem = Get16SquareDig(1,DisP,False,True); + else +#endif + mem = Use32Addr ? Get8SquareDig(1,DisP,False,True) : Get4SquareDig(1,DisP,False,True); strcpy(ix86_appstr,ix86_segpref); ix86_segpref[0] = 0; strcat(ix86_appstr,"["); strcat(ix86_appstr,mem); strcat(ix86_appstr,"]"); +#ifdef INT64_C + if(x86_Bitness == DAB_USE64 && Use64) k86_REX=0; +#endif reg = ix86_getREG(0,DisP->RealCmd[0] & 0x01); +#ifdef INT64_C + if(x86_Bitness == DAB_USE64 && Use64) k86_REX=sav_REX; +#endif +#ifdef INT64_C + if(x86_Bitness == DAB_USE64 && Use64) + DisP->codelen = 9; + else +#endif DisP->codelen = Use32Addr ? 5 : 3; strcat(str,d ? ix86_appstr : reg); ix86_CStile(str,d ? reg : ix86_appstr); @@ -807,6 +923,15 @@ unsigned char mod = (DisP->RealCmd[1] & 0xC0) >> 6; unsigned char buf,ptr; tBool word; +#ifdef INT64_C + if(x86_Bitness == DAB_USE64) + { + if(DisP->RealCmd[1] == 0xF8) + strcpy(str,"swapgs"); + DisP->codelen++; + return; + } +#endif strcpy(str,ix86_ExGrp1[rm]); TabSpace(str,TAB_POS); DisP->codelen++; |