- compilation fixes for MSVC toolkit 2003
[bochs-mirror.git] / cpu / fetchdecode.cc
blob71dd7bec9252fb25ac0280deea3cb8a79f0513db
1 /////////////////////////////////////////////////////////////////////////
2 // $Id: fetchdecode.cc,v 1.218 2008/10/06 17:50:06 sshwarts Exp $
3 /////////////////////////////////////////////////////////////////////////
4 //
5 // Copyright (C) 2001 MandrakeSoft S.A.
6 //
7 // MandrakeSoft S.A.
8 // 43, rue d'Aboukir
9 // 75002 Paris - France
10 // http://www.linux-mandrake.com/
11 // http://www.mandrakesoft.com/
13 // This library is free software; you can redistribute it and/or
14 // modify it under the terms of the GNU Lesser General Public
15 // License as published by the Free Software Foundation; either
16 // version 2 of the License, or (at your option) any later version.
18 // This library is distributed in the hope that it will be useful,
19 // but WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 // Lesser General Public License for more details.
23 // You should have received a copy of the GNU Lesser General Public
24 // License along with this library; if not, write to the Free Software
25 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 /////////////////////////////////////////////////////////////////////////
29 #define NEED_CPU_REG_SHORTCUTS 1
30 #include "bochs.h"
31 #include "cpu.h"
32 #define LOG_THIS BX_CPU_THIS_PTR
34 ///////////////////////////
35 // prefix bytes
36 // opcode bytes
37 // modrm/sib
38 // address displacement
39 // immediate constant
40 ///////////////////////////
42 #define X 0 /* undefined opcode */
44 static const Bit8u BxOpcodeHasModrm32[512] = {
45 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
46 /* ------------------------------- */
47 /* 00 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,X,
48 /* 10 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
49 /* 20 */ 1,1,1,1,0,0,X,0,1,1,1,1,0,0,X,0,
50 /* 30 */ 1,1,1,1,0,0,X,0,1,1,1,1,0,0,X,0,
51 /* 40 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
52 /* 50 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
53 /* 60 */ 0,0,1,1,X,X,X,X,0,1,0,1,0,0,0,0,
54 /* 70 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
55 /* 80 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
56 /* 90 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
57 /* A0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
58 /* B0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
59 /* C0 */ 1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0,
60 /* D0 */ 1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,
61 /* E0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
62 /* F0 */ X,0,X,X,0,0,1,1,0,0,0,0,0,0,1,1,
63 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
64 /* ------------------------------- */
65 1,1,1,1,X,0,0,0,0,0,X,0,X,1,0,1, /* 0F 00 */
66 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 0F 10 */
67 1,1,1,1,1,X,1,X,1,1,1,1,1,1,1,1, /* 0F 20 */
68 0,0,0,0,0,0,X,X,1,X,1,X,X,X,X,X, /* 0F 30 */
69 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 0F 40 */
70 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 0F 50 */
71 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 0F 60 */
72 1,1,1,1,1,1,1,0,X,X,X,X,1,1,1,1, /* 0F 70 */
73 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0F 80 */
74 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 0F 90 */
75 0,0,0,1,1,1,0,0,0,0,0,1,1,1,1,1, /* 0F A0 */
76 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 0F B0 */
77 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, /* 0F C0 */
78 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 0F D0 */
79 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 0F E0 */
80 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,X /* 0F F0 */
81 /* ------------------------------- */
82 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
85 #undef X
87 /* *********** */
88 // LOCK PREFIX //
89 /* *********** */
92 * The LOCK prefix can be prepended only to the following instructions
93 * and only to those forms of the instructions where the destination
94 * operand is a memory operand: ADD, ADC, AND, BTC, BTR, BTS, CMPXCHG,
95 * CMPXCH8B, DEC, INC, NEG, NOT, OR, SBB, SUB, XOR, XADD, and XCHG. If
96 * the LOCK prefix is used with one of these instructions and the source
97 * operand is a memory operand, an undefined opcode exception (#UD) will
98 * be generated. An undefined opcode exception will also be generated if
99 * the LOCK prefix is used with any instruction not in the above list.
100 * The XCHG instruction always asserts the LOCK# signal regardless of the
101 * presence or absence of the LOCK prefix.
104 static unsigned Resolve16BaseReg[8] = {
105 BX_16BIT_REG_BX,
106 BX_16BIT_REG_BX,
107 BX_16BIT_REG_BP,
108 BX_16BIT_REG_BP,
109 BX_16BIT_REG_SI,
110 BX_16BIT_REG_DI,
111 BX_16BIT_REG_BP,
112 BX_16BIT_REG_BX
115 static unsigned Resolve16IndexReg[8] = {
116 BX_16BIT_REG_SI,
117 BX_16BIT_REG_DI,
118 BX_16BIT_REG_SI,
119 BX_16BIT_REG_DI,
120 BX_NIL_REGISTER,
121 BX_NIL_REGISTER,
122 BX_NIL_REGISTER,
123 BX_NIL_REGISTER
126 // decoding instructions; accessing seg reg's by index
127 static unsigned sreg_mod00_rm16[8] = {
128 BX_SEG_REG_DS,
129 BX_SEG_REG_DS,
130 BX_SEG_REG_SS,
131 BX_SEG_REG_SS,
132 BX_SEG_REG_DS,
133 BX_SEG_REG_DS,
134 BX_SEG_REG_DS,
135 BX_SEG_REG_DS
138 static unsigned sreg_mod01or10_rm16[8] = {
139 BX_SEG_REG_DS,
140 BX_SEG_REG_DS,
141 BX_SEG_REG_SS,
142 BX_SEG_REG_SS,
143 BX_SEG_REG_DS,
144 BX_SEG_REG_DS,
145 BX_SEG_REG_SS,
146 BX_SEG_REG_DS
149 // decoding instructions; accessing seg reg's by index
150 static unsigned sreg_mod01or10_rm32[8] = {
151 BX_SEG_REG_DS,
152 BX_SEG_REG_DS,
153 BX_SEG_REG_DS,
154 BX_SEG_REG_DS,
155 BX_SEG_REG_NULL, // escape to SIB-byte
156 BX_SEG_REG_SS,
157 BX_SEG_REG_DS,
158 BX_SEG_REG_DS
161 static unsigned sreg_mod0_base32[8] = {
162 BX_SEG_REG_DS,
163 BX_SEG_REG_DS,
164 BX_SEG_REG_DS,
165 BX_SEG_REG_DS,
166 BX_SEG_REG_SS,
167 BX_SEG_REG_DS,
168 BX_SEG_REG_DS,
169 BX_SEG_REG_DS
172 static unsigned sreg_mod1or2_base32[8] = {
173 BX_SEG_REG_DS,
174 BX_SEG_REG_DS,
175 BX_SEG_REG_DS,
176 BX_SEG_REG_DS,
177 BX_SEG_REG_SS,
178 BX_SEG_REG_SS,
179 BX_SEG_REG_DS,
180 BX_SEG_REG_DS
183 // common fetchdecode32/64 opcode tables
184 #include "fetchdecode.h"
186 // table of all Bochs opcodes
187 bxIAOpcodeTable BxOpcodesTable[] = {
188 #define bx_define_opcode(a, b, c) { b, c },
189 #include "ia_opcodes.h"
191 #undef bx_define_opcode
193 /* ************************** */
194 /* 512 entries for 16bit mode */
195 /* 512 entries for 32bit mode */
196 /* ************************** */
198 static const BxOpcodeInfo_t BxOpcodeInfo32R[512*2] = {
199 // 512 entries for 16bit mode
200 /* 00 /wr */ { BxArithDstRM, BX_IA_ADD_GbEbR },
201 /* 01 /wr */ { BxArithDstRM, BX_IA_ADD_GwEwR },
202 /* 02 /wr */ { 0, BX_IA_ADD_GbEbR },
203 /* 03 /wr */ { 0, BX_IA_ADD_GwEwR },
204 /* 04 /wr */ { BxImmediate_Ib, BX_IA_ADD_ALIb },
205 /* 05 /wr */ { BxImmediate_Iw, BX_IA_ADD_AXIw },
206 /* 06 /wr */ { 0, BX_IA_PUSH16_ES },
207 /* 07 /wr */ { 0, BX_IA_POP16_ES },
208 /* 08 /wr */ { BxArithDstRM, BX_IA_OR_GbEbR },
209 /* 09 /wr */ { BxArithDstRM, BX_IA_OR_GwEwR },
210 /* 0A /wr */ { 0, BX_IA_OR_GbEbR },
211 /* 0B /wr */ { 0, BX_IA_OR_GwEwR },
212 /* 0C /wr */ { BxImmediate_Ib, BX_IA_OR_ALIb },
213 /* 0D /wr */ { BxImmediate_Iw, BX_IA_OR_AXIw },
214 /* 0E /wr */ { 0, BX_IA_PUSH16_CS },
215 /* 0F /wr */ { 0, BX_IA_ERROR }, // 2-byte escape
216 /* 10 /wr */ { BxArithDstRM, BX_IA_ADC_GbEbR },
217 /* 11 /wr */ { BxArithDstRM, BX_IA_ADC_GwEwR },
218 /* 12 /wr */ { 0, BX_IA_ADC_GbEbR },
219 /* 13 /wr */ { 0, BX_IA_ADC_GwEwR },
220 /* 14 /wr */ { BxImmediate_Ib, BX_IA_ADC_ALIb },
221 /* 15 /wr */ { BxImmediate_Iw, BX_IA_ADC_AXIw },
222 /* 16 /wr */ { 0, BX_IA_PUSH16_SS },
223 /* 17 /wr */ { BxTraceEnd, BX_IA_POP16_SS }, // async_event = 1
224 /* 18 /wr */ { BxArithDstRM, BX_IA_SBB_GbEbR },
225 /* 19 /wr */ { BxArithDstRM, BX_IA_SBB_GwEwR },
226 /* 1A /wr */ { 0, BX_IA_SBB_GbEbR },
227 /* 1B /wr */ { 0, BX_IA_SBB_GwEwR },
228 /* 1C /wr */ { BxImmediate_Ib, BX_IA_SBB_ALIb },
229 /* 1D /wr */ { BxImmediate_Iw, BX_IA_SBB_AXIw },
230 /* 1E /wr */ { 0, BX_IA_PUSH16_DS },
231 /* 1F /wr */ { 0, BX_IA_POP16_DS },
232 /* 20 /wr */ { BxArithDstRM, BX_IA_AND_GbEbR },
233 /* 21 /wr */ { BxArithDstRM, BX_IA_AND_GwEwR },
234 /* 22 /wr */ { 0, BX_IA_AND_GbEbR },
235 /* 23 /wr */ { 0, BX_IA_AND_GwEwR },
236 /* 24 /wr */ { BxImmediate_Ib, BX_IA_AND_ALIb },
237 /* 25 /wr */ { BxImmediate_Iw, BX_IA_AND_AXIw },
238 /* 26 /wr */ { 0, BX_IA_ERROR }, // ES:
239 /* 27 /wr */ { 0, BX_IA_DAA },
240 /* 28 /wr */ { BxArithDstRM, BX_IA_SUB_GbEbR },
241 /* 29 /wr */ { BxArithDstRM, BX_IA_SUB_GwEwR },
242 /* 2A /wr */ { 0, BX_IA_SUB_GbEbR },
243 /* 2B /wr */ { 0, BX_IA_SUB_GwEwR },
244 /* 2C /wr */ { BxImmediate_Ib, BX_IA_SUB_ALIb },
245 /* 2D /wr */ { BxImmediate_Iw, BX_IA_SUB_AXIw },
246 /* 2E /wr */ { 0, BX_IA_ERROR }, // CS:
247 /* 2F /wr */ { 0, BX_IA_DAS },
248 /* 30 /wr */ { BxArithDstRM, BX_IA_XOR_GbEbR },
249 /* 31 /wr */ { BxArithDstRM, BX_IA_XOR_GwEwR },
250 /* 32 /wr */ { 0, BX_IA_XOR_GbEbR },
251 /* 33 /wr */ { 0, BX_IA_XOR_GwEwR },
252 /* 34 /wr */ { BxImmediate_Ib, BX_IA_XOR_ALIb },
253 /* 35 /wr */ { BxImmediate_Iw, BX_IA_XOR_AXIw },
254 /* 36 /wr */ { 0, BX_IA_ERROR }, // SS:
255 /* 37 /wr */ { 0, BX_IA_AAA },
256 /* 38 /wr */ { BxArithDstRM, BX_IA_CMP_GbEbR },
257 /* 39 /wr */ { BxArithDstRM, BX_IA_CMP_GwEwR },
258 /* 3A /wr */ { 0, BX_IA_CMP_GbEbR },
259 /* 3B /wr */ { 0, BX_IA_CMP_GwEwR },
260 /* 3C /wr */ { BxImmediate_Ib, BX_IA_CMP_ALIb },
261 /* 3D /wr */ { BxImmediate_Iw, BX_IA_CMP_AXIw },
262 /* 3E /wr */ { 0, BX_IA_ERROR }, // DS:
263 /* 3F /wr */ { 0, BX_IA_AAS },
264 /* 40 /wr */ { 0, BX_IA_INC_RX },
265 /* 41 /wr */ { 0, BX_IA_INC_RX },
266 /* 42 /wr */ { 0, BX_IA_INC_RX },
267 /* 43 /wr */ { 0, BX_IA_INC_RX },
268 /* 44 /wr */ { 0, BX_IA_INC_RX },
269 /* 45 /wr */ { 0, BX_IA_INC_RX },
270 /* 46 /wr */ { 0, BX_IA_INC_RX },
271 /* 47 /wr */ { 0, BX_IA_INC_RX },
272 /* 48 /wr */ { 0, BX_IA_DEC_RX },
273 /* 49 /wr */ { 0, BX_IA_DEC_RX },
274 /* 4A /wr */ { 0, BX_IA_DEC_RX },
275 /* 4B /wr */ { 0, BX_IA_DEC_RX },
276 /* 4C /wr */ { 0, BX_IA_DEC_RX },
277 /* 4D /wr */ { 0, BX_IA_DEC_RX },
278 /* 4E /wr */ { 0, BX_IA_DEC_RX },
279 /* 4F /wr */ { 0, BX_IA_DEC_RX },
280 /* 50 /wr */ { 0, BX_IA_PUSH_RX },
281 /* 51 /wr */ { 0, BX_IA_PUSH_RX },
282 /* 52 /wr */ { 0, BX_IA_PUSH_RX },
283 /* 53 /wr */ { 0, BX_IA_PUSH_RX },
284 /* 54 /wr */ { 0, BX_IA_PUSH_RX },
285 /* 55 /wr */ { 0, BX_IA_PUSH_RX },
286 /* 56 /wr */ { 0, BX_IA_PUSH_RX },
287 /* 57 /wr */ { 0, BX_IA_PUSH_RX },
288 /* 58 /wr */ { 0, BX_IA_POP_RX },
289 /* 59 /wr */ { 0, BX_IA_POP_RX },
290 /* 5A /wr */ { 0, BX_IA_POP_RX },
291 /* 5B /wr */ { 0, BX_IA_POP_RX },
292 /* 5C /wr */ { 0, BX_IA_POP_RX },
293 /* 5D /wr */ { 0, BX_IA_POP_RX },
294 /* 5E /wr */ { 0, BX_IA_POP_RX },
295 /* 5F /wr */ { 0, BX_IA_POP_RX },
296 /* 60 /wr */ { 0, BX_IA_PUSHAD16 },
297 /* 61 /wr */ { 0, BX_IA_POPAD16 },
298 /* 62 /wr */ { 0, BX_IA_ERROR }, // BOUND
299 /* 63 /wr */ { 0, BX_IA_ARPL_EwGw },
300 /* 64 /wr */ { 0, BX_IA_ERROR }, // FS:
301 /* 65 /wr */ { 0, BX_IA_ERROR }, // GS:
302 /* 66 /wr */ { 0, BX_IA_ERROR }, // OS:
303 /* 67 /wr */ { 0, BX_IA_ERROR }, // AS:
304 /* 68 /wr */ { BxImmediate_Iw, BX_IA_PUSH_Iw },
305 /* 69 /wr */ { BxImmediate_Iw, BX_IA_IMUL_GwEwIwR },
306 /* 6A /wr */ { BxImmediate_Ib_SE, BX_IA_PUSH_Iw },
307 /* 6B /wr */ { BxImmediate_Ib_SE, BX_IA_IMUL_GwEwIwR },
308 /* 6C /wr */ { 0, BX_IA_REP_INSB_YbDX },
309 /* 6D /wr */ { 0, BX_IA_REP_INSW_YwDX },
310 /* 6E /wr */ { 0, BX_IA_REP_OUTSB_DXXb },
311 /* 6F /wr */ { 0, BX_IA_REP_OUTSW_DXXw },
312 /* 70 /wr */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JO_Jw },
313 /* 71 /wr */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JNO_Jw },
314 /* 72 /wr */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JB_Jw },
315 /* 73 /wr */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JNB_Jw },
316 /* 74 /wr */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JZ_Jw },
317 /* 75 /wr */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JNZ_Jw },
318 /* 76 /wr */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JBE_Jw },
319 /* 77 /wr */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JNBE_Jw },
320 /* 78 /wr */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JS_Jw },
321 /* 79 /wr */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JNS_Jw },
322 /* 7A /wr */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JP_Jw },
323 /* 7B /wr */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JNP_Jw },
324 /* 7C /wr */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JL_Jw },
325 /* 7D /wr */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JNL_Jw },
326 /* 7E /wr */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JLE_Jw },
327 /* 7F /wr */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JNLE_Jw },
328 /* 80 /wr */ { BxGroup1 | BxImmediate_Ib, BX_IA_ERROR, BxOpcodeInfoG1EbIbR },
329 /* 81 /wr */ { BxGroup1 | BxImmediate_Iw, BX_IA_ERROR, BxOpcodeInfoG1EwR },
330 /* 82 /wr */ { BxGroup1 | BxImmediate_Ib, BX_IA_ERROR, BxOpcodeInfoG1EbIbR },
331 /* 83 /wr */ { BxGroup1 | BxImmediate_Ib_SE, BX_IA_ERROR, BxOpcodeInfoG1EwR },
332 /* 84 /wr */ { 0, BX_IA_TEST_EbGbR },
333 /* 85 /wr */ { 0, BX_IA_TEST_EwGwR },
334 /* 86 /wr */ { 0, BX_IA_XCHG_EbGbR },
335 /* 87 /wr */ { 0, BX_IA_XCHG_EwGwR },
336 /* 88 /wr */ { BxArithDstRM, BX_IA_MOV_GbEbR },
337 /* 89 /wr */ { BxArithDstRM, BX_IA_MOV_GwEwR },
338 /* 8A /wr */ { 0, BX_IA_MOV_GbEbR },
339 /* 8B /wr */ { 0, BX_IA_MOV_GwEwR },
340 /* 8C /wr */ { 0, BX_IA_MOV_EwSwR },
341 /* 8D /wr */ { 0, BX_IA_ERROR }, // LEA
342 /* 8E /wr */ { 0, BX_IA_MOV_SwEw },
343 /* 8F /wr */ { BxGroup1A, BX_IA_ERROR, BxOpcodeInfoG1AEwR },
344 /* 90 /wr */ { 0, BX_IA_NOP },
345 /* 91 /wr */ { 0, BX_IA_XCHG_RXAX },
346 /* 92 /wr */ { 0, BX_IA_XCHG_RXAX },
347 /* 93 /wr */ { 0, BX_IA_XCHG_RXAX },
348 /* 94 /wr */ { 0, BX_IA_XCHG_RXAX },
349 /* 95 /wr */ { 0, BX_IA_XCHG_RXAX },
350 /* 96 /wr */ { 0, BX_IA_XCHG_RXAX },
351 /* 97 /wr */ { 0, BX_IA_XCHG_RXAX },
352 /* 98 /wr */ { 0, BX_IA_CBW },
353 /* 99 /wr */ { 0, BX_IA_CWD },
354 /* 9A /wr */ { BxImmediate_IwIw | BxTraceEnd, BX_IA_CALL16_Ap },
355 /* 9B /wr */ { 0, BX_IA_FWAIT },
356 /* 9C /wr */ { 0, BX_IA_PUSHF_Fw },
357 /* 9D /wr */ { 0, BX_IA_POPF_Fw },
358 /* 9E /wr */ { 0, BX_IA_SAHF },
359 /* 9F /wr */ { 0, BX_IA_LAHF },
360 /* A0 /wr */ { BxImmediate_O, BX_IA_MOV_ALOd },
361 /* A1 /wr */ { BxImmediate_O, BX_IA_MOV_AXOd },
362 /* A2 /wr */ { BxImmediate_O, BX_IA_MOV_OdAL },
363 /* A3 /wr */ { BxImmediate_O, BX_IA_MOV_OdAX },
364 /* A4 /wr */ { 0, BX_IA_REP_MOVSB_XbYb },
365 /* A5 /wr */ { 0, BX_IA_REP_MOVSW_XwYw },
366 /* A6 /wr */ { 0, BX_IA_REP_CMPSB_XbYb },
367 /* A7 /wr */ { 0, BX_IA_REP_CMPSW_XwYw },
368 /* A8 /wr */ { BxImmediate_Ib, BX_IA_TEST_ALIb },
369 /* A9 /wr */ { BxImmediate_Iw, BX_IA_TEST_AXIw },
370 /* AA /wr */ { 0, BX_IA_REP_STOSB_YbAL },
371 /* AB /wr */ { 0, BX_IA_REP_STOSW_YwAX },
372 /* AC /wr */ { 0, BX_IA_REP_LODSB_ALXb },
373 /* AD /wr */ { 0, BX_IA_REP_LODSW_AXXw },
374 /* AE /wr */ { 0, BX_IA_REP_SCASB_ALXb },
375 /* AF /wr */ { 0, BX_IA_REP_SCASW_AXXw },
376 /* B0 /wr */ { BxImmediate_Ib, BX_IA_MOV_RLIb },
377 /* B1 /wr */ { BxImmediate_Ib, BX_IA_MOV_RLIb },
378 /* B2 /wr */ { BxImmediate_Ib, BX_IA_MOV_RLIb },
379 /* B3 /wr */ { BxImmediate_Ib, BX_IA_MOV_RLIb },
380 /* B4 /wr */ { BxImmediate_Ib, BX_IA_MOV_RHIb },
381 /* B5 /wr */ { BxImmediate_Ib, BX_IA_MOV_RHIb },
382 /* B6 /wr */ { BxImmediate_Ib, BX_IA_MOV_RHIb },
383 /* B7 /wr */ { BxImmediate_Ib, BX_IA_MOV_RHIb },
384 /* B8 /wr */ { BxImmediate_Iw, BX_IA_MOV_RXIw },
385 /* B9 /wr */ { BxImmediate_Iw, BX_IA_MOV_RXIw },
386 /* BA /wr */ { BxImmediate_Iw, BX_IA_MOV_RXIw },
387 /* BB /wr */ { BxImmediate_Iw, BX_IA_MOV_RXIw },
388 /* BC /wr */ { BxImmediate_Iw, BX_IA_MOV_RXIw },
389 /* BD /wr */ { BxImmediate_Iw, BX_IA_MOV_RXIw },
390 /* BE /wr */ { BxImmediate_Iw, BX_IA_MOV_RXIw },
391 /* BF /wr */ { BxImmediate_Iw, BX_IA_MOV_RXIw },
392 /* C0 /wr */ { BxGroup2 | BxImmediate_Ib, BX_IA_ERROR, BxOpcodeInfoG2Eb },
393 /* C1 /wr */ { BxGroup2 | BxImmediate_Ib, BX_IA_ERROR, BxOpcodeInfoG2Ew },
394 /* C2 /wr */ { BxImmediate_Iw | BxTraceEnd, BX_IA_RETnear16_Iw },
395 /* C3 /wr */ { BxTraceEnd, BX_IA_RETnear16 },
396 /* C4 /wr */ { 0, BX_IA_ERROR }, // LES
397 /* C5 /wr */ { 0, BX_IA_ERROR }, // LDS
398 /* C6 /wr */ { BxGroup11, BX_IA_ERROR, BxOpcodeInfoG11EbR },
399 /* C7 /wr */ { BxGroup11, BX_IA_ERROR, BxOpcodeInfoG11EwR },
400 /* C8 /wr */ { BxImmediate_IwIb, BX_IA_ENTER16_IwIb },
401 /* C9 /wr */ { 0, BX_IA_LEAVE16 },
402 /* CA /wr */ { BxImmediate_Iw | BxTraceEnd, BX_IA_RETfar16_Iw },
403 /* CB /wr */ { BxTraceEnd, BX_IA_RETfar16 },
404 /* CC /wr */ { BxTraceEnd, BX_IA_INT3 },
405 /* CD /wr */ { BxImmediate_Ib | BxTraceEnd, BX_IA_INT_Ib },
406 /* CE /wr */ { BxTraceEnd, BX_IA_INTO },
407 /* CF /wr */ { BxTraceEnd, BX_IA_IRET16 },
408 /* D0 /wr */ { BxGroup2 | BxImmediate_I1, BX_IA_ERROR, BxOpcodeInfoG2Eb },
409 /* D1 /wr */ { BxGroup2 | BxImmediate_I1, BX_IA_ERROR, BxOpcodeInfoG2Ew },
410 /* D2 /wr */ { BxGroup2, BX_IA_ERROR, BxOpcodeInfoG2Eb },
411 /* D3 /wr */ { BxGroup2, BX_IA_ERROR, BxOpcodeInfoG2Ew },
412 /* D4 /wr */ { BxImmediate_Ib, BX_IA_AAM },
413 /* D5 /wr */ { BxImmediate_Ib, BX_IA_AAD },
414 /* D6 /wr */ { 0, BX_IA_SALC },
415 /* D7 /wr */ { 0, BX_IA_XLAT },
416 #if BX_SUPPORT_FPU
417 /* D8 /wr */ { BxFPEscape, BX_IA_ERROR, BxOpcodeInfo_FloatingPointD8 },
418 /* D9 /wr */ { BxFPEscape, BX_IA_ERROR, BxOpcodeInfo_FloatingPointD9 },
419 /* DA /wr */ { BxFPEscape, BX_IA_ERROR, BxOpcodeInfo_FloatingPointDA },
420 /* DB /wr */ { BxFPEscape, BX_IA_ERROR, BxOpcodeInfo_FloatingPointDB },
421 /* DC /wr */ { BxFPEscape, BX_IA_ERROR, BxOpcodeInfo_FloatingPointDC },
422 /* DD /wr */ { BxFPEscape, BX_IA_ERROR, BxOpcodeInfo_FloatingPointDD },
423 /* DE /wr */ { BxFPEscape, BX_IA_ERROR, BxOpcodeInfo_FloatingPointDE },
424 /* DF /wr */ { BxFPEscape, BX_IA_ERROR, BxOpcodeInfo_FloatingPointDF },
425 #else
426 /* D8 /wr */ { 0, BX_IA_FPU_ESC },
427 /* D9 /wr */ { 0, BX_IA_FPU_ESC },
428 /* DA /wr */ { 0, BX_IA_FPU_ESC },
429 /* DB /wr */ { 0, BX_IA_FPU_ESC },
430 /* DC /wr */ { 0, BX_IA_FPU_ESC },
431 /* DD /wr */ { 0, BX_IA_FPU_ESC },
432 /* DE /wr */ { 0, BX_IA_FPU_ESC },
433 /* DF /wr */ { 0, BX_IA_FPU_ESC },
434 #endif
435 /* E0 /wr */ { BxImmediate_BrOff8 | BxTraceEnd, BX_IA_LOOPNE16_Jb },
436 /* E1 /wr */ { BxImmediate_BrOff8 | BxTraceEnd, BX_IA_LOOPE16_Jb },
437 /* E2 /wr */ { BxImmediate_BrOff8 | BxTraceEnd, BX_IA_LOOP16_Jb },
438 /* E3 /wr */ { BxImmediate_BrOff8 | BxTraceEnd, BX_IA_JCXZ_Jb },
439 /* E4 /wr */ { BxImmediate_Ib, BX_IA_IN_ALIb },
440 /* E5 /wr */ { BxImmediate_Ib, BX_IA_IN_AXIb },
441 /* E6 /wr */ { BxImmediate_Ib, BX_IA_OUT_IbAL },
442 /* E7 /wr */ { BxImmediate_Ib, BX_IA_OUT_IbAX },
443 /* E8 /wr */ { BxImmediate_BrOff16 | BxTraceEnd, BX_IA_CALL_Jw },
444 /* E9 /wr */ { BxImmediate_BrOff16 | BxTraceEnd, BX_IA_JMP_Jw },
445 /* EA /wr */ { BxImmediate_IwIw | BxTraceEnd, BX_IA_JMP_Ap },
446 /* EB /wr */ { BxImmediate_BrOff8 | BxTraceEnd, BX_IA_JMP_Jw },
447 /* EC /wr */ { 0, BX_IA_IN_ALDX },
448 /* ED /wr */ { 0, BX_IA_IN_AXDX },
449 /* EE /wr */ { 0, BX_IA_OUT_DXAL },
450 /* EF /wr */ { 0, BX_IA_OUT_DXAX },
451 /* F0 /wr */ { 0, BX_IA_ERROR }, // LOCK
452 /* F1 /wr */ { BxTraceEnd, BX_IA_INT1 },
453 /* F2 /wr */ { 0, BX_IA_ERROR }, // REPNE/REPNZ
454 /* F3 /wr */ { 0, BX_IA_ERROR }, // REP, REPE/REPZ
455 /* F4 /wr */ { BxTraceEnd, BX_IA_HLT },
456 /* F5 /wr */ { 0, BX_IA_CMC },
457 /* F6 /wr */ { BxGroup3, BX_IA_ERROR, BxOpcodeInfoG3EbR },
458 /* F7 /wr */ { BxGroup3, BX_IA_ERROR, BxOpcodeInfoG3EwR },
459 /* F8 /wr */ { 0, BX_IA_CLC },
460 /* F9 /wr */ { 0, BX_IA_STC },
461 /* FA /wr */ { 0, BX_IA_CLI },
462 /* FB /wr */ { 0, BX_IA_STI },
463 /* FC /wr */ { 0, BX_IA_CLD },
464 /* FD /wr */ { 0, BX_IA_STD },
465 /* FE /wr */ { BxGroup4, BX_IA_ERROR, BxOpcodeInfoG4R },
466 /* FF /wr */ { BxGroup5, BX_IA_ERROR, BxOpcodeInfoG5wR },
468 /* 0F 00 /wr */ { BxGroup6, BX_IA_ERROR, BxOpcodeInfoG6 },
469 /* 0F 01 /wr */ { BxGroup7, BX_IA_ERROR, BxOpcodeInfoG7R },
470 /* 0F 02 /wr */ { 0, BX_IA_LAR_GvEw },
471 /* 0F 03 /wr */ { 0, BX_IA_LSL_GvEw },
472 /* 0F 04 /wr */ { 0, BX_IA_ERROR },
473 #if BX_SUPPORT_X86_64
474 /* 0F 05 /wr */ { BxTraceEnd, BX_IA_SYSCALL },
475 #elif BX_CPU_LEVEL == 2
476 /* 0F 05 /wr */ { BxTraceEnd, BX_IA_LOADALL },
477 #else
478 /* 0F 05 /wr */ { 0, BX_IA_ERROR },
479 #endif
480 /* 0F 06 /wr */ { 0, BX_IA_CLTS },
481 #if BX_SUPPORT_X86_64
482 /* 0F 07 /wr */ { BxTraceEnd, BX_IA_SYSRET },
483 #else
484 /* 0F 07 /wr */ { 0, BX_IA_ERROR },
485 #endif
486 /* 0F 08 /wr */ { BxTraceEnd, BX_IA_INVD },
487 /* 0F 09 /wr */ { BxTraceEnd, BX_IA_WBINVD },
488 /* 0F 0A /wr */ { 0, BX_IA_ERROR },
489 /* 0F 0B /wr */ { BxTraceEnd, BX_IA_UD2A },
490 /* 0F 0C /wr */ { 0, BX_IA_ERROR },
491 #if BX_SUPPORT_X86_64 || BX_SUPPORT_3DNOW
492 /* 0F 0D /wr */ { 0, BX_IA_NOP }, // 3DNow! PREFETCH on AMD, NOP on Intel
493 #else
494 /* 0F 0D /wr */ { 0, BX_IA_ERROR },
495 #endif
496 /* 0F 0E /wr */ { 0, BX_IA_FEMMS }, // 3DNow! FEMMS
497 #if BX_SUPPORT_3DNOW
498 /* 0F 0F /wr */ { BxImmediate_Ib, BX_IA_ERROR, Bx3DNowOpcodeInfo },
499 #else
500 /* 0F 0F /wr */ { 0, BX_IA_ERROR },
501 #endif
502 /* 0F 10 /wr */ { BxPrefixSSE, BX_IA_MOVUPS_VpsWps, BxOpcodeGroupSSE_0f10 },
503 /* 0F 11 /wr */ { BxPrefixSSE, BX_IA_MOVUPS_WpsVps, BxOpcodeGroupSSE_0f11 },
504 /* 0F 12 /wr */ { BxPrefixSSE, BX_IA_MOVLPS_VpsMq, BxOpcodeGroupSSE_0f12 },
505 /* 0F 13 /wr */ { 0, BX_IA_ERROR }, // MOVLPS/PD SSE group
506 /* 0F 14 /wr */ { BxPrefixSSE, BX_IA_UNPCKLPS_VpsWdq, BxOpcodeGroupSSE_0f14 },
507 /* 0F 15 /wr */ { BxPrefixSSE, BX_IA_UNPCKHPS_VpsWdq, BxOpcodeGroupSSE_0f15 },
508 /* 0F 16 /wr */ { BxPrefixSSE, BX_IA_MOVHPS_VpsMq, BxOpcodeGroupSSE_0f16 },
509 /* 0F 17 /wr */ { 0, BX_IA_ERROR }, // MOHLPS/PD SSE group
510 #if BX_CPU_LEVEL >= 6
511 /* 0F 18 /wr */ { 0, BX_IA_NOP }, // PREFETCH HINT
512 /* 0F 19 /wr */ { 0, BX_IA_NOP }, // multi-byte NOP
513 /* 0F 1A /wr */ { 0, BX_IA_NOP }, // multi-byte NOP
514 /* 0F 1B /wr */ { 0, BX_IA_NOP }, // multi-byte NOP
515 /* 0F 1C /wr */ { 0, BX_IA_NOP }, // multi-byte NOP
516 /* 0F 1D /wr */ { 0, BX_IA_NOP }, // multi-byte NOP
517 /* 0F 1E /wr */ { 0, BX_IA_NOP }, // multi-byte NOP
518 /* 0F 1F /wr */ { 0, BX_IA_NOP }, // multi-byte NOP
519 #else
520 /* 0F 18 /wr */ { 0, BX_IA_ERROR },
521 /* 0F 19 /wr */ { 0, BX_IA_ERROR },
522 /* 0F 1A /wr */ { 0, BX_IA_ERROR },
523 /* 0F 1B /wr */ { 0, BX_IA_ERROR },
524 /* 0F 1C /wr */ { 0, BX_IA_ERROR },
525 /* 0F 1D /wr */ { 0, BX_IA_ERROR },
526 /* 0F 1E /wr */ { 0, BX_IA_ERROR },
527 /* 0F 1F /wr */ { 0, BX_IA_ERROR },
528 #endif
529 /* 0F 20 /wr */ { 0, BX_IA_MOV_RdCd },
530 /* 0F 21 /wr */ { 0, BX_IA_MOV_RdDd },
531 /* 0F 22 /wr */ { BxTraceEnd, BX_IA_MOV_CdRd },
532 /* 0F 23 /wr */ { BxTraceEnd, BX_IA_MOV_DdRd },
533 /* 0F 24 /wr */ { BxTraceEnd, BX_IA_MOV_RdTd }, // not implemented
534 /* 0F 25 /wr */ { 0, BX_IA_ERROR },
535 /* 0F 26 /wr */ { BxTraceEnd, BX_IA_MOV_TdRd }, // not implemented
536 /* 0F 27 /wr */ { 0, BX_IA_ERROR },
537 /* 0F 28 /wr */ { BxPrefixSSE, BX_IA_MOVAPS_VpsWps, BxOpcodeGroupSSE_0f28 },
538 /* 0F 29 /wr */ { BxPrefixSSE, BX_IA_MOVAPS_WpsVps, BxOpcodeGroupSSE_0f29 },
539 /* 0F 2A /wr */ { BxPrefixSSE, BX_IA_CVTPI2PS_VpsQq, BxOpcodeGroupSSE_0f2a },
540 /* 0F 2B /wr */ { 0, BX_IA_ERROR }, // MOVNTPS/PD/SS/SD
541 /* 0F 2C /wr */ { BxPrefixSSE, BX_IA_CVTTPS2PI_PqWps, BxOpcodeGroupSSE_0f2c },
542 /* 0F 2D /wr */ { BxPrefixSSE, BX_IA_CVTPS2PI_PqWps, BxOpcodeGroupSSE_0f2d },
543 /* 0F 2E /wr */ { BxPrefixSSE, BX_IA_UCOMISS_VssWss, BxOpcodeGroupSSE_0f2e },
544 /* 0F 2F /wr */ { BxPrefixSSE, BX_IA_COMISS_VpsWps, BxOpcodeGroupSSE_0f2f },
545 /* 0F 30 /wr */ { 0, BX_IA_WRMSR },
546 /* 0F 31 /wr */ { 0, BX_IA_RDTSC },
547 /* 0F 32 /wr */ { 0, BX_IA_RDMSR },
548 /* 0F 33 /wr */ { 0, BX_IA_RDPMC },
549 /* 0F 34 /wr */ { BxTraceEnd, BX_IA_SYSENTER },
550 /* 0F 35 /wr */ { BxTraceEnd, BX_IA_SYSEXIT },
551 /* 0F 36 /wr */ { 0, BX_IA_ERROR },
552 /* 0F 37 /wr */ { 0, BX_IA_ERROR },
553 #if (BX_SUPPORT_SSE >= 4) || (BX_SUPPORT_SSE >= 3 && BX_SUPPORT_SSE_EXTENSION > 0)
554 /* 0F 38 /wr */ { Bx3ByteOp, BX_IA_ERROR, BxOpcode3ByteTable0f38 }, // 3-byte escape
555 #else
556 /* 0F 38 /wr */ { 0, BX_IA_ERROR },
557 #endif
558 /* 0F 39 /wr */ { 0, BX_IA_ERROR },
559 #if (BX_SUPPORT_SSE >= 4) || (BX_SUPPORT_SSE >= 3 && BX_SUPPORT_SSE_EXTENSION > 0)
560 /* 0F 3A /wr */ { Bx3ByteOp, BX_IA_ERROR, BxOpcode3ByteTable0f3a }, // 3-byte escape
561 #else
562 /* 0F 3A /wr */ { 0, BX_IA_ERROR },
563 #endif
564 /* 0F 3B /wr */ { 0, BX_IA_ERROR },
565 /* 0F 3C /wr */ { 0, BX_IA_ERROR },
566 /* 0F 3D /wr */ { 0, BX_IA_ERROR },
567 /* 0F 3E /wr */ { 0, BX_IA_ERROR },
568 /* 0F 3F /wr */ { 0, BX_IA_ERROR },
569 /* 0F 40 /wr */ { 0, BX_IA_CMOVO_GwEwR },
570 /* 0F 41 /wr */ { 0, BX_IA_CMOVNO_GwEwR },
571 /* 0F 42 /wr */ { 0, BX_IA_CMOVB_GwEwR },
572 /* 0F 43 /wr */ { 0, BX_IA_CMOVNB_GwEwR },
573 /* 0F 44 /wr */ { 0, BX_IA_CMOVZ_GwEwR },
574 /* 0F 45 /wr */ { 0, BX_IA_CMOVNZ_GwEwR },
575 /* 0F 46 /wr */ { 0, BX_IA_CMOVBE_GwEwR },
576 /* 0F 47 /wr */ { 0, BX_IA_CMOVNBE_GwEwR },
577 /* 0F 48 /wr */ { 0, BX_IA_CMOVS_GwEwR },
578 /* 0F 49 /wr */ { 0, BX_IA_CMOVNS_GwEwR },
579 /* 0F 4A /wr */ { 0, BX_IA_CMOVP_GwEwR },
580 /* 0F 4B /wr */ { 0, BX_IA_CMOVNP_GwEwR },
581 /* 0F 4C /wr */ { 0, BX_IA_CMOVL_GwEwR },
582 /* 0F 4D /wr */ { 0, BX_IA_CMOVNL_GwEwR },
583 /* 0F 4E /wr */ { 0, BX_IA_CMOVLE_GwEwR },
584 /* 0F 4F /wr */ { 0, BX_IA_CMOVNLE_GwEwR },
585 /* 0F 50 /wr */ { BxPrefixSSE, BX_IA_MOVMSKPS_GdVRps, BxOpcodeGroupSSE_0f50 },
586 /* 0F 51 /wr */ { BxPrefixSSE, BX_IA_SQRTPS_VpsWps, BxOpcodeGroupSSE_0f51 },
587 /* 0F 52 /wr */ { BxPrefixSSE, BX_IA_RSQRTPS_VpsWps, BxOpcodeGroupSSE_0f52 },
588 /* 0F 53 /wr */ { BxPrefixSSE, BX_IA_RCPPS_VpsWps, BxOpcodeGroupSSE_0f53 },
589 /* 0F 54 /wr */ { BxPrefixSSE, BX_IA_ANDPS_VpsWps, BxOpcodeGroupSSE_0f54 },
590 /* 0F 55 /wr */ { BxPrefixSSE, BX_IA_ANDNPS_VpsWps, BxOpcodeGroupSSE_0f55 },
591 /* 0F 56 /wr */ { BxPrefixSSE, BX_IA_ORPS_VpsWps, BxOpcodeGroupSSE_0f56 },
592 /* 0F 57 /wr */ { BxPrefixSSE, BX_IA_XORPS_VpsWps, BxOpcodeGroupSSE_0f57 },
593 /* 0F 58 /wr */ { BxPrefixSSE, BX_IA_ADDPS_VpsWps, BxOpcodeGroupSSE_0f58 },
594 /* 0F 59 /wr */ { BxPrefixSSE, BX_IA_MULPS_VpsWps, BxOpcodeGroupSSE_0f59 },
595 /* 0F 5A /wr */ { BxPrefixSSE, BX_IA_CVTPS2PD_VpsWps, BxOpcodeGroupSSE_0f5a },
596 /* 0F 5B /wr */ { BxPrefixSSE, BX_IA_CVTDQ2PS_VpsWdq, BxOpcodeGroupSSE_0f5b },
597 /* 0F 5C /wr */ { BxPrefixSSE, BX_IA_SUBPS_VpsWps, BxOpcodeGroupSSE_0f5c },
598 /* 0F 5D /wr */ { BxPrefixSSE, BX_IA_MINPS_VpsWps, BxOpcodeGroupSSE_0f5d },
599 /* 0F 5E /wr */ { BxPrefixSSE, BX_IA_DIVPS_VpsWps, BxOpcodeGroupSSE_0f5e },
600 /* 0F 5F /wr */ { BxPrefixSSE, BX_IA_MAXPS_VpsWps, BxOpcodeGroupSSE_0f5f },
601 /* 0F 60 /wr */ { BxPrefixSSE, BX_IA_PUNPCKLBW_PqQd, BxOpcodeGroupSSE_0f60 },
602 /* 0F 61 /wr */ { BxPrefixSSE, BX_IA_PUNPCKLWD_PqQd, BxOpcodeGroupSSE_0f61 },
603 /* 0F 62 /wr */ { BxPrefixSSE, BX_IA_PUNPCKLDQ_PqQd, BxOpcodeGroupSSE_0f62 },
604 /* 0F 63 /wr */ { BxPrefixSSE, BX_IA_PACKSSWB_PqQq, BxOpcodeGroupSSE_0f63 },
605 /* 0F 64 /wr */ { BxPrefixSSE, BX_IA_PCMPGTB_PqQq, BxOpcodeGroupSSE_0f64 },
606 /* 0F 65 /wr */ { BxPrefixSSE, BX_IA_PCMPGTW_PqQq, BxOpcodeGroupSSE_0f65 },
607 /* 0F 66 /wr */ { BxPrefixSSE, BX_IA_PCMPGTD_PqQq, BxOpcodeGroupSSE_0f66 },
608 /* 0F 67 /wr */ { BxPrefixSSE, BX_IA_PACKUSWB_PqQq, BxOpcodeGroupSSE_0f67 },
609 /* 0F 68 /wr */ { BxPrefixSSE, BX_IA_PUNPCKHBW_PqQq, BxOpcodeGroupSSE_0f68 },
610 /* 0F 69 /wr */ { BxPrefixSSE, BX_IA_PUNPCKHWD_PqQq, BxOpcodeGroupSSE_0f69 },
611 /* 0F 6A /wr */ { BxPrefixSSE, BX_IA_PUNPCKHDQ_PqQq, BxOpcodeGroupSSE_0f6a },
612 /* 0F 6B /wr */ { BxPrefixSSE, BX_IA_PACKSSDW_PqQq, BxOpcodeGroupSSE_0f6b },
613 /* 0F 6C /wr */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0f6c },
614 /* 0F 6D /wr */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0f6d },
615 /* 0F 6E /wr */ { BxPrefixSSE, BX_IA_MOVD_PqEd, BxOpcodeGroupSSE_0f6e },
616 /* 0F 6F /wr */ { BxPrefixSSE, BX_IA_MOVQ_PqQq, BxOpcodeGroupSSE_0f6f },
617 /* 0F 70 /wr */ { BxPrefixSSE | BxImmediate_Ib, BX_IA_PSHUFW_PqQqIb, BxOpcodeGroupSSE_0f70 },
618 /* 0F 71 /wr */ { BxGroup12, BX_IA_ERROR, BxOpcodeInfoG12R },
619 /* 0F 72 /wr */ { BxGroup13, BX_IA_ERROR, BxOpcodeInfoG13R },
620 /* 0F 73 /wr */ { BxGroup14, BX_IA_ERROR, BxOpcodeInfoG14R },
621 /* 0F 74 /wr */ { BxPrefixSSE, BX_IA_PCMPEQB_PqQq, BxOpcodeGroupSSE_0f74 },
622 /* 0F 75 /wr */ { BxPrefixSSE, BX_IA_PCMPEQW_PqQq, BxOpcodeGroupSSE_0f75 },
623 /* 0F 76 /wr */ { BxPrefixSSE, BX_IA_PCMPEQD_PqQq, BxOpcodeGroupSSE_0f76 },
624 /* 0F 77 /wr */ { BxPrefixSSE, BX_IA_EMMS, BxOpcodeGroupSSE_ERR },
625 /* 0F 78 /wr */ { 0, BX_IA_ERROR },
626 /* 0F 79 /wr */ { 0, BX_IA_ERROR },
627 /* 0F 7A /wr */ { 0, BX_IA_ERROR },
628 /* 0F 7B /wr */ { 0, BX_IA_ERROR },
629 /* 0F 7C /wr */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0f7c },
630 /* 0F 7D /wr */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0f7d },
631 /* 0F 7E /wr */ { BxPrefixSSE, BX_IA_MOVD_EdPd, BxOpcodeGroupSSE_0f7e },
632 /* 0F 7F /wr */ { BxPrefixSSE, BX_IA_MOVQ_QqPq, BxOpcodeGroupSSE_0f7f },
633 /* 0F 80 /wr */ { BxImmediate_BrOff16 | BxTraceJCC, BX_IA_JO_Jw },
634 /* 0F 81 /wr */ { BxImmediate_BrOff16 | BxTraceJCC, BX_IA_JNO_Jw },
635 /* 0F 82 /wr */ { BxImmediate_BrOff16 | BxTraceJCC, BX_IA_JB_Jw },
636 /* 0F 83 /wr */ { BxImmediate_BrOff16 | BxTraceJCC, BX_IA_JNB_Jw },
637 /* 0F 84 /wr */ { BxImmediate_BrOff16 | BxTraceJCC, BX_IA_JZ_Jw },
638 /* 0F 85 /wr */ { BxImmediate_BrOff16 | BxTraceJCC, BX_IA_JNZ_Jw },
639 /* 0F 86 /wr */ { BxImmediate_BrOff16 | BxTraceJCC, BX_IA_JBE_Jw },
640 /* 0F 87 /wr */ { BxImmediate_BrOff16 | BxTraceJCC, BX_IA_JNBE_Jw },
641 /* 0F 88 /wr */ { BxImmediate_BrOff16 | BxTraceJCC, BX_IA_JS_Jw },
642 /* 0F 89 /wr */ { BxImmediate_BrOff16 | BxTraceJCC, BX_IA_JNS_Jw },
643 /* 0F 8A /wr */ { BxImmediate_BrOff16 | BxTraceJCC, BX_IA_JP_Jw },
644 /* 0F 8B /wr */ { BxImmediate_BrOff16 | BxTraceJCC, BX_IA_JNP_Jw },
645 /* 0F 8C /wr */ { BxImmediate_BrOff16 | BxTraceJCC, BX_IA_JL_Jw },
646 /* 0F 8D /wr */ { BxImmediate_BrOff16 | BxTraceJCC, BX_IA_JNL_Jw },
647 /* 0F 8E /wr */ { BxImmediate_BrOff16 | BxTraceJCC, BX_IA_JLE_Jw },
648 /* 0F 8F /wr */ { BxImmediate_BrOff16 | BxTraceJCC, BX_IA_JNLE_Jw },
649 /* 0F 90 /wr */ { 0, BX_IA_SETO_EbR },
650 /* 0F 91 /wr */ { 0, BX_IA_SETNO_EbR },
651 /* 0F 92 /wr */ { 0, BX_IA_SETB_EbR },
652 /* 0F 93 /wr */ { 0, BX_IA_SETNB_EbR },
653 /* 0F 94 /wr */ { 0, BX_IA_SETZ_EbR },
654 /* 0F 95 /wr */ { 0, BX_IA_SETNZ_EbR },
655 /* 0F 96 /wr */ { 0, BX_IA_SETBE_EbR },
656 /* 0F 97 /wr */ { 0, BX_IA_SETNBE_EbR },
657 /* 0F 98 /wr */ { 0, BX_IA_SETS_EbR },
658 /* 0F 99 /wr */ { 0, BX_IA_SETNS_EbR },
659 /* 0F 9A /wr */ { 0, BX_IA_SETP_EbR },
660 /* 0F 9B /wr */ { 0, BX_IA_SETNP_EbR },
661 /* 0F 9C /wr */ { 0, BX_IA_SETL_EbR },
662 /* 0F 9D /wr */ { 0, BX_IA_SETNL_EbR },
663 /* 0F 9E /wr */ { 0, BX_IA_SETLE_EbR },
664 /* 0F 9F /wr */ { 0, BX_IA_SETNLE_EbR },
665 /* 0F A0 /wr */ { 0, BX_IA_PUSH16_FS },
666 /* 0F A1 /wr */ { 0, BX_IA_POP16_FS },
667 /* 0F A2 /wr */ { 0, BX_IA_CPUID },
668 /* 0F A3 /wr */ { 0, BX_IA_BT_EwGwR },
669 /* 0F A4 /wr */ { BxImmediate_Ib, BX_IA_SHLD_EwGwR },
670 /* 0F A5 /wr */ { 0, BX_IA_SHLD_EwGwR },
671 /* 0F A6 /wr */ { BxTraceEnd, BX_IA_CMPXCHG_XBTS }, // not implemented
672 /* 0F A7 /wr */ { BxTraceEnd, BX_IA_CMPXCHG_IBTS }, // not implemented
673 /* 0F A8 /wr */ { 0, BX_IA_PUSH16_GS },
674 /* 0F A9 /wr */ { 0, BX_IA_POP16_GS },
675 /* 0F AA /wr */ { BxTraceEnd, BX_IA_RSM },
676 /* 0F AB /wr */ { 0, BX_IA_BTS_EwGwR },
677 /* 0F AC /wr */ { BxImmediate_Ib, BX_IA_SHRD_EwGwR },
678 /* 0F AD /wr */ { 0, BX_IA_SHRD_EwGwR },
679 /* 0F AE /wr */ { BxGroup15, BX_IA_ERROR, BxOpcodeInfoG15R },
680 /* 0F AF /wr */ { 0, BX_IA_IMUL_GwEwR },
681 /* 0F B0 /wr */ { 0, BX_IA_CMPXCHG_EbGbR },
682 /* 0F B1 /wr */ { 0, BX_IA_CMPXCHG_EwGwR },
683 /* 0F B2 /wr */ { 0, BX_IA_ERROR }, // LSS
684 /* 0F B3 /wr */ { 0, BX_IA_BTR_EwGwR },
685 /* 0F B4 /wr */ { 0, BX_IA_ERROR }, // LFS
686 /* 0F B5 /wr */ { 0, BX_IA_ERROR }, // LGS
687 /* 0F B6 /wr */ { 0, BX_IA_MOVZX_GwEbR },
688 /* 0F B7 /wr */ { 0, BX_IA_MOV_GwEwR }, // MOVZX_GwEw
689 /* 0F B8 /wr */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0fb8wR },
690 /* 0F B9 /wr */ { 0, BX_IA_UD2B },
691 /* 0F BA /wr */ { BxGroup8, BX_IA_ERROR, BxOpcodeInfoG8EwIbR },
692 /* 0F BB /wr */ { 0, BX_IA_BTC_EwGwR },
693 /* 0F BC /wr */ { 0, BX_IA_BSF_GwEwR },
694 /* 0F BD /wr */ { 0, BX_IA_BSR_GwEwR },
695 /* 0F BE /wr */ { 0, BX_IA_MOVSX_GwEbR },
696 /* 0F BF /wr */ { 0, BX_IA_MOV_GwEwR }, // MOVSX_GwEw
697 /* 0F C0 /wr */ { 0, BX_IA_XADD_EbGbR },
698 /* 0F C1 /wr */ { 0, BX_IA_XADD_EwGwR },
699 /* 0F C2 /wr */ { BxPrefixSSE | BxImmediate_Ib, BX_IA_CMPPS_VpsWpsIb, BxOpcodeGroupSSE_0fc2 },
700 /* 0F C3 /wr */ { 0, BX_IA_ERROR }, // MOVNTI SSE group
701 /* 0F C4 /wr */ { BxPrefixSSE | BxImmediate_Ib, BX_IA_PINSRW_PqEwIb, BxOpcodeGroupSSE_0fc4 },
702 /* 0F C5 /wr */ { BxPrefixSSE | BxImmediate_Ib, BX_IA_PEXTRW_GdPqIb, BxOpcodeGroupSSE_0fc5R },
703 /* 0F C6 /wr */ { BxPrefixSSE | BxImmediate_Ib, BX_IA_SHUFPS_VpsWpsIb, BxOpcodeGroupSSE_0fc6 },
704 /* 0F C7 /wr */ { 0, BX_IA_ERROR }, // CMPXCHG8B G9 group
705 /* 0F C8 /wr */ { 0, BX_IA_BSWAP_ERX },
706 /* 0F C9 /wr */ { 0, BX_IA_BSWAP_ERX },
707 /* 0F CA /wr */ { 0, BX_IA_BSWAP_ERX },
708 /* 0F CB /wr */ { 0, BX_IA_BSWAP_ERX },
709 /* 0F CC /wr */ { 0, BX_IA_BSWAP_ERX },
710 /* 0F CD /wr */ { 0, BX_IA_BSWAP_ERX },
711 /* 0F CE /wr */ { 0, BX_IA_BSWAP_ERX },
712 /* 0F CF /wr */ { 0, BX_IA_BSWAP_ERX },
713 /* 0F D0 /wr */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0fd0 },
714 /* 0F D1 /wr */ { BxPrefixSSE, BX_IA_PSRLW_PqQq, BxOpcodeGroupSSE_0fd1 },
715 /* 0F D2 /wr */ { BxPrefixSSE, BX_IA_PSRLD_PqQq, BxOpcodeGroupSSE_0fd2 },
716 /* 0F D3 /wr */ { BxPrefixSSE, BX_IA_PSRLQ_PqQq, BxOpcodeGroupSSE_0fd3 },
717 /* 0F D4 /wr */ { BxPrefixSSE, BX_IA_PADDQ_PqQq, BxOpcodeGroupSSE_0fd4 },
718 /* 0F D5 /wr */ { BxPrefixSSE, BX_IA_PMULLW_PqQq, BxOpcodeGroupSSE_0fd5 },
719 /* 0F D6 /wr */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0fd6 },
720 /* 0F D7 /wr */ { BxPrefixSSE, BX_IA_PMOVMSKB_GdPRq, BxOpcodeGroupSSE_0fd7 },
721 /* 0F D8 /wr */ { BxPrefixSSE, BX_IA_PSUBUSB_PqQq, BxOpcodeGroupSSE_0fd8 },
722 /* 0F D9 /wr */ { BxPrefixSSE, BX_IA_PSUBUSW_PqQq, BxOpcodeGroupSSE_0fd9 },
723 /* 0F DA /wr */ { BxPrefixSSE, BX_IA_PMINUB_PqQq, BxOpcodeGroupSSE_0fda },
724 /* 0F DB /wr */ { BxPrefixSSE, BX_IA_PAND_PqQq, BxOpcodeGroupSSE_0fdb },
725 /* 0F DC /wr */ { BxPrefixSSE, BX_IA_PADDUSB_PqQq, BxOpcodeGroupSSE_0fdc },
726 /* 0F DD /wr */ { BxPrefixSSE, BX_IA_PADDUSW_PqQq, BxOpcodeGroupSSE_0fdd },
727 /* 0F DE /wr */ { BxPrefixSSE, BX_IA_PMAXUB_PqQq, BxOpcodeGroupSSE_0fde },
728 /* 0F DF /wr */ { BxPrefixSSE, BX_IA_PANDN_PqQq, BxOpcodeGroupSSE_0fdf },
729 /* 0F E0 /wr */ { BxPrefixSSE, BX_IA_PAVGB_PqQq, BxOpcodeGroupSSE_0fe0 },
730 /* 0F E1 /wr */ { BxPrefixSSE, BX_IA_PSRAW_PqQq, BxOpcodeGroupSSE_0fe1 },
731 /* 0F E2 /wr */ { BxPrefixSSE, BX_IA_PSRAD_PqQq, BxOpcodeGroupSSE_0fe2 },
732 /* 0F E3 /wr */ { BxPrefixSSE, BX_IA_PAVGW_PqQq, BxOpcodeGroupSSE_0fe3 },
733 /* 0F E4 /wr */ { BxPrefixSSE, BX_IA_PMULHUW_PqQq, BxOpcodeGroupSSE_0fe4 },
734 /* 0F E5 /wr */ { BxPrefixSSE, BX_IA_PMULHW_PqQq, BxOpcodeGroupSSE_0fe5 },
735 /* 0F E6 /wr */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0fe6 },
736 /* 0F E7 /wr */ { 0, BX_IA_ERROR }, // MOVNTQ/MOVNTDQ SSE group
737 /* 0F E8 /wr */ { BxPrefixSSE, BX_IA_PSUBSB_PqQq, BxOpcodeGroupSSE_0fe8 },
738 /* 0F E9 /wr */ { BxPrefixSSE, BX_IA_PSUBSW_PqQq, BxOpcodeGroupSSE_0fe9 },
739 /* 0F EA /wr */ { BxPrefixSSE, BX_IA_PMINSW_PqQq, BxOpcodeGroupSSE_0fea },
740 /* 0F EB /wr */ { BxPrefixSSE, BX_IA_POR_PqQq, BxOpcodeGroupSSE_0feb },
741 /* 0F EC /wr */ { BxPrefixSSE, BX_IA_PADDSB_PqQq, BxOpcodeGroupSSE_0fec },
742 /* 0F ED /wr */ { BxPrefixSSE, BX_IA_PADDSW_PqQq, BxOpcodeGroupSSE_0fed },
743 /* 0F EE /wr */ { BxPrefixSSE, BX_IA_PMAXSW_PqQq, BxOpcodeGroupSSE_0fee },
744 /* 0F EF /wr */ { BxPrefixSSE, BX_IA_PXOR_PqQq, BxOpcodeGroupSSE_0fef },
745 /* 0F F0 /wr */ { 0, BX_IA_ERROR }, // LDDQU SSE group
746 /* 0F F1 /wr */ { BxPrefixSSE, BX_IA_PSLLW_PqQq, BxOpcodeGroupSSE_0ff1 },
747 /* 0F F2 /wr */ { BxPrefixSSE, BX_IA_PSLLD_PqQq, BxOpcodeGroupSSE_0ff2 },
748 /* 0F F3 /wr */ { BxPrefixSSE, BX_IA_PSLLQ_PqQq, BxOpcodeGroupSSE_0ff3 },
749 /* 0F F4 /wr */ { BxPrefixSSE, BX_IA_PMULUDQ_PqQq, BxOpcodeGroupSSE_0ff4 },
750 /* 0F F5 /wr */ { BxPrefixSSE, BX_IA_PMADDWD_PqQq, BxOpcodeGroupSSE_0ff5 },
751 /* 0F F6 /wr */ { BxPrefixSSE, BX_IA_PSADBW_PqQq, BxOpcodeGroupSSE_0ff6 },
752 /* 0F F7 /wr */ { BxPrefixSSE, BX_IA_MASKMOVQ_PqPRq, BxOpcodeGroupSSE_0ff7R },
753 /* 0F F8 /wr */ { BxPrefixSSE, BX_IA_PSUBB_PqQq, BxOpcodeGroupSSE_0ff8 },
754 /* 0F F9 /wr */ { BxPrefixSSE, BX_IA_PSUBW_PqQq, BxOpcodeGroupSSE_0ff9 },
755 /* 0F FA /wr */ { BxPrefixSSE, BX_IA_PSUBD_PqQq, BxOpcodeGroupSSE_0ffa },
756 /* 0F FB /wr */ { BxPrefixSSE, BX_IA_PSUBQ_PqQq, BxOpcodeGroupSSE_0ffb },
757 /* 0F FC /wr */ { BxPrefixSSE, BX_IA_PADDB_PqQq, BxOpcodeGroupSSE_0ffc },
758 /* 0F FD /wr */ { BxPrefixSSE, BX_IA_PADDW_PqQq, BxOpcodeGroupSSE_0ffd },
759 /* 0F FE /wr */ { BxPrefixSSE, BX_IA_PADDD_PqQq, BxOpcodeGroupSSE_0ffe },
760 /* 0F FF /wr */ { 0, BX_IA_ERROR },
762 // 512 entries for 32bit mode
763 /* 00 /dr */ { BxArithDstRM, BX_IA_ADD_GbEbR },
764 /* 01 /dr */ { BxArithDstRM, BX_IA_ADD_GdEdR },
765 /* 02 /dr */ { 0, BX_IA_ADD_GbEbR },
766 /* 03 /dr */ { 0, BX_IA_ADD_GdEdR },
767 /* 04 /dr */ { BxImmediate_Ib, BX_IA_ADD_ALIb },
768 /* 05 /dr */ { BxImmediate_Id, BX_IA_ADD_EAXId },
769 /* 06 /dr */ { 0, BX_IA_PUSH32_ES },
770 /* 07 /dr */ { 0, BX_IA_POP32_ES },
771 /* 08 /dr */ { BxArithDstRM, BX_IA_OR_GbEbR },
772 /* 09 /dr */ { BxArithDstRM, BX_IA_OR_GdEdR },
773 /* 0A /dr */ { 0, BX_IA_OR_GbEbR },
774 /* 0B /dr */ { 0, BX_IA_OR_GdEdR },
775 /* 0C /dr */ { BxImmediate_Ib, BX_IA_OR_ALIb },
776 /* 0D /dr */ { BxImmediate_Id, BX_IA_OR_EAXId },
777 /* 0E /dr */ { 0, BX_IA_PUSH32_CS },
778 /* 0F /dr */ { 0, BX_IA_ERROR }, // 2-byte escape
779 /* 10 /dr */ { BxArithDstRM, BX_IA_ADC_GbEbR },
780 /* 11 /dr */ { BxArithDstRM, BX_IA_ADC_GdEdR },
781 /* 12 /dr */ { 0, BX_IA_ADC_GbEbR },
782 /* 13 /dr */ { 0, BX_IA_ADC_GdEdR },
783 /* 14 /dr */ { BxImmediate_Ib, BX_IA_ADC_ALIb },
784 /* 15 /dr */ { BxImmediate_Id, BX_IA_ADC_EAXId },
785 /* 16 /dr */ { 0, BX_IA_PUSH32_SS },
786 /* 17 /dr */ { BxTraceEnd, BX_IA_POP32_SS }, // async_event = 1
787 /* 18 /dr */ { BxArithDstRM, BX_IA_SBB_GbEbR },
788 /* 19 /dr */ { BxArithDstRM, BX_IA_SBB_GdEdR },
789 /* 1A /dr */ { 0, BX_IA_SBB_GbEbR },
790 /* 1B /dr */ { 0, BX_IA_SBB_GdEdR },
791 /* 1C /dr */ { BxImmediate_Ib, BX_IA_SBB_ALIb },
792 /* 1D /dr */ { BxImmediate_Id, BX_IA_SBB_EAXId },
793 /* 1E /dr */ { 0, BX_IA_PUSH32_DS },
794 /* 1F /dr */ { 0, BX_IA_POP32_DS },
795 /* 20 /dr */ { BxArithDstRM, BX_IA_AND_GbEbR },
796 /* 21 /dr */ { BxArithDstRM, BX_IA_AND_GdEdR },
797 /* 22 /dr */ { 0, BX_IA_AND_GbEbR },
798 /* 23 /dr */ { 0, BX_IA_AND_GdEdR },
799 /* 24 /dr */ { BxImmediate_Ib, BX_IA_AND_ALIb },
800 /* 25 /dr */ { BxImmediate_Id, BX_IA_AND_EAXId },
801 /* 26 /dr */ { 0, BX_IA_ERROR }, // ES:
802 /* 27 /dr */ { 0, BX_IA_DAA },
803 /* 28 /dr */ { BxArithDstRM, BX_IA_SUB_GbEbR },
804 /* 29 /dr */ { BxArithDstRM, BX_IA_SUB_GdEdR },
805 /* 2A /dr */ { 0, BX_IA_SUB_GbEbR },
806 /* 2B /dr */ { 0, BX_IA_SUB_GdEdR },
807 /* 2C /dr */ { BxImmediate_Ib, BX_IA_SUB_ALIb },
808 /* 2D /dr */ { BxImmediate_Id, BX_IA_SUB_EAXId },
809 /* 2E /dr */ { 0, BX_IA_ERROR }, // CS:
810 /* 2F /dr */ { 0, BX_IA_DAS },
811 /* 30 /dr */ { BxArithDstRM, BX_IA_XOR_GbEbR },
812 /* 31 /dr */ { BxArithDstRM, BX_IA_XOR_GdEdR },
813 /* 32 /dr */ { 0, BX_IA_XOR_GbEbR },
814 /* 33 /dr */ { 0, BX_IA_XOR_GdEdR },
815 /* 34 /dr */ { BxImmediate_Ib, BX_IA_XOR_ALIb },
816 /* 35 /dr */ { BxImmediate_Id, BX_IA_XOR_EAXId },
817 /* 36 /dr */ { 0, BX_IA_ERROR }, // SS:
818 /* 37 /dr */ { 0, BX_IA_AAA },
819 /* 38 /dr */ { BxArithDstRM, BX_IA_CMP_GbEbR },
820 /* 39 /dr */ { BxArithDstRM, BX_IA_CMP_GdEdR },
821 /* 3A /dr */ { 0, BX_IA_CMP_GbEbR },
822 /* 3B /dr */ { 0, BX_IA_CMP_GdEdR },
823 /* 3C /dr */ { BxImmediate_Ib, BX_IA_CMP_ALIb },
824 /* 3D /dr */ { BxImmediate_Id, BX_IA_CMP_EAXId },
825 /* 3E /dr */ { 0, BX_IA_ERROR }, // DS:
826 /* 3F /dr */ { 0, BX_IA_AAS },
827 /* 40 /dr */ { 0, BX_IA_INC_ERX },
828 /* 41 /dr */ { 0, BX_IA_INC_ERX },
829 /* 42 /dr */ { 0, BX_IA_INC_ERX },
830 /* 43 /dr */ { 0, BX_IA_INC_ERX },
831 /* 44 /dr */ { 0, BX_IA_INC_ERX },
832 /* 45 /dr */ { 0, BX_IA_INC_ERX },
833 /* 46 /dr */ { 0, BX_IA_INC_ERX },
834 /* 47 /dr */ { 0, BX_IA_INC_ERX },
835 /* 48 /dr */ { 0, BX_IA_DEC_ERX },
836 /* 49 /dr */ { 0, BX_IA_DEC_ERX },
837 /* 4A /dr */ { 0, BX_IA_DEC_ERX },
838 /* 4B /dr */ { 0, BX_IA_DEC_ERX },
839 /* 4C /dr */ { 0, BX_IA_DEC_ERX },
840 /* 4D /dr */ { 0, BX_IA_DEC_ERX },
841 /* 4E /dr */ { 0, BX_IA_DEC_ERX },
842 /* 4F /dr */ { 0, BX_IA_DEC_ERX },
843 /* 50 /dr */ { 0, BX_IA_PUSH_ERX },
844 /* 51 /dr */ { 0, BX_IA_PUSH_ERX },
845 /* 52 /dr */ { 0, BX_IA_PUSH_ERX },
846 /* 53 /dr */ { 0, BX_IA_PUSH_ERX },
847 /* 54 /dr */ { 0, BX_IA_PUSH_ERX },
848 /* 55 /dr */ { 0, BX_IA_PUSH_ERX },
849 /* 56 /dr */ { 0, BX_IA_PUSH_ERX },
850 /* 57 /dr */ { 0, BX_IA_PUSH_ERX },
851 /* 58 /dr */ { 0, BX_IA_POP_ERX },
852 /* 59 /dr */ { 0, BX_IA_POP_ERX },
853 /* 5A /dr */ { 0, BX_IA_POP_ERX },
854 /* 5B /dr */ { 0, BX_IA_POP_ERX },
855 /* 5C /dr */ { 0, BX_IA_POP_ERX },
856 /* 5D /dr */ { 0, BX_IA_POP_ERX },
857 /* 5E /dr */ { 0, BX_IA_POP_ERX },
858 /* 5F /dr */ { 0, BX_IA_POP_ERX },
859 /* 60 /dr */ { 0, BX_IA_PUSHAD32 },
860 /* 61 /dr */ { 0, BX_IA_POPAD32 },
861 /* 62 /dr */ { 0, BX_IA_ERROR }, // BOUND
862 /* 63 /dr */ { 0, BX_IA_ARPL_EwGw },
863 /* 64 /dr */ { 0, BX_IA_ERROR }, // FS:
864 /* 65 /dr */ { 0, BX_IA_ERROR }, // GS:
865 /* 66 /dr */ { 0, BX_IA_ERROR }, // OS:
866 /* 67 /dr */ { 0, BX_IA_ERROR }, // AS:
867 /* 68 /dr */ { BxImmediate_Id, BX_IA_PUSH_Id },
868 /* 69 /dr */ { BxImmediate_Id, BX_IA_IMUL_GdEdIdR },
869 /* 6A /dr */ { BxImmediate_Ib_SE, BX_IA_PUSH_Id },
870 /* 6B /dr */ { BxImmediate_Ib_SE, BX_IA_IMUL_GdEdIdR },
871 /* 6C /dr */ { 0, BX_IA_REP_INSB_YbDX },
872 /* 6D /dr */ { 0, BX_IA_REP_INSD_YdDX },
873 /* 6E /dr */ { 0, BX_IA_REP_OUTSB_DXXb },
874 /* 6F /dr */ { 0, BX_IA_REP_OUTSD_DXXd },
875 /* 70 /dr */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JO_Jd },
876 /* 71 /dr */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JNO_Jd },
877 /* 72 /dr */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JB_Jd },
878 /* 73 /dr */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JNB_Jd },
879 /* 74 /dr */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JZ_Jd },
880 /* 75 /dr */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JNZ_Jd },
881 /* 76 /dr */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JBE_Jd },
882 /* 77 /dr */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JNBE_Jd },
883 /* 78 /dr */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JS_Jd },
884 /* 79 /dr */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JNS_Jd },
885 /* 7A /dr */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JP_Jd },
886 /* 7B /dr */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JNP_Jd },
887 /* 7C /dr */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JL_Jd },
888 /* 7D /dr */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JNL_Jd },
889 /* 7E /dr */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JLE_Jd },
890 /* 7F /dr */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JNLE_Jd },
891 /* 80 /dr */ { BxGroup1 | BxImmediate_Ib, BX_IA_ERROR, BxOpcodeInfoG1EbIbR },
892 /* 81 /dr */ { BxGroup1 | BxImmediate_Id, BX_IA_ERROR, BxOpcodeInfoG1EdR },
893 /* 82 /dr */ { BxGroup1 | BxImmediate_Ib, BX_IA_ERROR, BxOpcodeInfoG1EbIbR },
894 /* 83 /dr */ { BxGroup1 | BxImmediate_Ib_SE, BX_IA_ERROR, BxOpcodeInfoG1EdR },
895 /* 84 /dr */ { 0, BX_IA_TEST_EbGbR },
896 /* 85 /dr */ { 0, BX_IA_TEST_EdGdR },
897 /* 86 /dr */ { 0, BX_IA_XCHG_EbGbR },
898 /* 87 /dr */ { 0, BX_IA_XCHG_EdGdR },
899 /* 88 /dr */ { BxArithDstRM, BX_IA_MOV_GbEbR },
900 /* 89 /dr */ { BxArithDstRM, BX_IA_MOV_GdEdR },
901 /* 8A /dr */ { 0, BX_IA_MOV_GbEbR },
902 /* 8B /dr */ { 0, BX_IA_MOV_GdEdR },
903 /* 8C /dr */ { 0, BX_IA_MOV_EwSwR },
904 /* 8D /dr */ { 0, BX_IA_ERROR }, // LEA
905 /* 8E /dr */ { 0, BX_IA_MOV_SwEw },
906 /* 8F /dr */ { BxGroup1A, BX_IA_ERROR, BxOpcodeInfoG1AEdR },
907 /* 90 /dr */ { 0, BX_IA_NOP },
908 /* 91 /dr */ { 0, BX_IA_XCHG_ERXEAX },
909 /* 92 /dr */ { 0, BX_IA_XCHG_ERXEAX },
910 /* 93 /dr */ { 0, BX_IA_XCHG_ERXEAX },
911 /* 94 /dr */ { 0, BX_IA_XCHG_ERXEAX },
912 /* 95 /dr */ { 0, BX_IA_XCHG_ERXEAX },
913 /* 96 /dr */ { 0, BX_IA_XCHG_ERXEAX },
914 /* 97 /dr */ { 0, BX_IA_XCHG_ERXEAX },
915 /* 98 /dr */ { 0, BX_IA_CWDE },
916 /* 99 /dr */ { 0, BX_IA_CDQ },
917 /* 9A /dr */ { BxImmediate_IdIw | BxTraceEnd, BX_IA_CALL32_Ap },
918 /* 9B /dr */ { 0, BX_IA_FWAIT },
919 /* 9C /dr */ { 0, BX_IA_PUSHF_Fd },
920 /* 9D /dr */ { 0, BX_IA_POPF_Fd },
921 /* 9E /dr */ { 0, BX_IA_SAHF },
922 /* 9F /dr */ { 0, BX_IA_LAHF },
923 /* A0 /dr */ { BxImmediate_O, BX_IA_MOV_ALOd },
924 /* A1 /dr */ { BxImmediate_O, BX_IA_MOV_EAXOd },
925 /* A2 /dr */ { BxImmediate_O, BX_IA_MOV_OdAL },
926 /* A3 /dr */ { BxImmediate_O, BX_IA_MOV_OdEAX },
927 /* A4 /dr */ { 0, BX_IA_REP_MOVSB_XbYb },
928 /* A5 /dr */ { 0, BX_IA_REP_MOVSD_XdYd },
929 /* A6 /dr */ { 0, BX_IA_REP_CMPSB_XbYb },
930 /* A7 /dr */ { 0, BX_IA_REP_CMPSD_XdYd },
931 /* A8 /dr */ { BxImmediate_Ib, BX_IA_TEST_ALIb },
932 /* A9 /dr */ { BxImmediate_Id, BX_IA_TEST_EAXId },
933 /* AA /dr */ { 0, BX_IA_REP_STOSB_YbAL },
934 /* AB /dr */ { 0, BX_IA_REP_STOSD_YdEAX },
935 /* AC /dr */ { 0, BX_IA_REP_LODSB_ALXb },
936 /* AD /dr */ { 0, BX_IA_REP_LODSD_EAXXd },
937 /* AE /dr */ { 0, BX_IA_REP_SCASB_ALXb },
938 /* AF /dr */ { 0, BX_IA_REP_SCASD_EAXXd },
939 /* B0 /dr */ { BxImmediate_Ib, BX_IA_MOV_RLIb },
940 /* B1 /dr */ { BxImmediate_Ib, BX_IA_MOV_RLIb },
941 /* B2 /dr */ { BxImmediate_Ib, BX_IA_MOV_RLIb },
942 /* B3 /dr */ { BxImmediate_Ib, BX_IA_MOV_RLIb },
943 /* B4 /dr */ { BxImmediate_Ib, BX_IA_MOV_RHIb },
944 /* B5 /dr */ { BxImmediate_Ib, BX_IA_MOV_RHIb },
945 /* B6 /dr */ { BxImmediate_Ib, BX_IA_MOV_RHIb },
946 /* B7 /dr */ { BxImmediate_Ib, BX_IA_MOV_RHIb },
947 /* B8 /dr */ { BxImmediate_Id, BX_IA_MOV_ERXId },
948 /* B9 /dr */ { BxImmediate_Id, BX_IA_MOV_ERXId },
949 /* BA /dr */ { BxImmediate_Id, BX_IA_MOV_ERXId },
950 /* BB /dr */ { BxImmediate_Id, BX_IA_MOV_ERXId },
951 /* BC /dr */ { BxImmediate_Id, BX_IA_MOV_ERXId },
952 /* BD /dr */ { BxImmediate_Id, BX_IA_MOV_ERXId },
953 /* BE /dr */ { BxImmediate_Id, BX_IA_MOV_ERXId },
954 /* BF /dr */ { BxImmediate_Id, BX_IA_MOV_ERXId },
955 /* C0 /dr */ { BxGroup2 | BxImmediate_Ib, BX_IA_ERROR, BxOpcodeInfoG2Eb },
956 /* C1 /dr */ { BxGroup2 | BxImmediate_Ib, BX_IA_ERROR, BxOpcodeInfoG2EdR },
957 /* C2 /dr */ { BxImmediate_Iw | BxTraceEnd, BX_IA_RETnear32_Iw },
958 /* C3 /dr */ { BxTraceEnd, BX_IA_RETnear32 },
959 /* C4 /dr */ { 0, BX_IA_ERROR }, // LES
960 /* C5 /dr */ { 0, BX_IA_ERROR }, // LDS
961 /* C6 /dr */ { BxGroup11, BX_IA_ERROR, BxOpcodeInfoG11EbR },
962 /* C7 /dr */ { BxGroup11, BX_IA_ERROR, BxOpcodeInfoG11EdR },
963 /* C8 /dr */ { BxImmediate_IwIb, BX_IA_ENTER32_IwIb },
964 /* C9 /dr */ { 0, BX_IA_LEAVE32 },
965 /* CA /dr */ { BxImmediate_Iw | BxTraceEnd, BX_IA_RETfar32_Iw },
966 /* CB /dr */ { BxTraceEnd, BX_IA_RETfar32 },
967 /* CC /dr */ { BxTraceEnd, BX_IA_INT3 },
968 /* CD /dr */ { BxImmediate_Ib | BxTraceEnd, BX_IA_INT_Ib },
969 /* CE /dr */ { BxTraceEnd, BX_IA_INTO },
970 /* CF /dr */ { BxTraceEnd, BX_IA_IRET32 },
971 /* D0 /dr */ { BxGroup2 | BxImmediate_I1, BX_IA_ERROR, BxOpcodeInfoG2Eb },
972 /* D1 /dr */ { BxGroup2 | BxImmediate_I1, BX_IA_ERROR, BxOpcodeInfoG2EdR },
973 /* D2 /dr */ { BxGroup2, BX_IA_ERROR, BxOpcodeInfoG2Eb },
974 /* D3 /dr */ { BxGroup2, BX_IA_ERROR, BxOpcodeInfoG2EdR },
975 /* D4 /dr */ { BxImmediate_Ib, BX_IA_AAM },
976 /* D5 /dr */ { BxImmediate_Ib, BX_IA_AAD },
977 /* D6 /dr */ { 0, BX_IA_SALC },
978 /* D7 /dr */ { 0, BX_IA_XLAT },
979 #if BX_SUPPORT_FPU
980 /* D8 /dr */ { BxFPEscape, BX_IA_ERROR, BxOpcodeInfo_FloatingPointD8 },
981 /* D9 /dr */ { BxFPEscape, BX_IA_ERROR, BxOpcodeInfo_FloatingPointD9 },
982 /* DA /dr */ { BxFPEscape, BX_IA_ERROR, BxOpcodeInfo_FloatingPointDA },
983 /* DB /dr */ { BxFPEscape, BX_IA_ERROR, BxOpcodeInfo_FloatingPointDB },
984 /* DC /dr */ { BxFPEscape, BX_IA_ERROR, BxOpcodeInfo_FloatingPointDC },
985 /* DD /dr */ { BxFPEscape, BX_IA_ERROR, BxOpcodeInfo_FloatingPointDD },
986 /* DE /dr */ { BxFPEscape, BX_IA_ERROR, BxOpcodeInfo_FloatingPointDE },
987 /* DF /dr */ { BxFPEscape, BX_IA_ERROR, BxOpcodeInfo_FloatingPointDF },
988 #else
989 /* D8 /dr */ { 0, BX_IA_FPU_ESC },
990 /* D9 /dr */ { 0, BX_IA_FPU_ESC },
991 /* DA /dr */ { 0, BX_IA_FPU_ESC },
992 /* DB /dr */ { 0, BX_IA_FPU_ESC },
993 /* DC /dr */ { 0, BX_IA_FPU_ESC },
994 /* DD /dr */ { 0, BX_IA_FPU_ESC },
995 /* DE /dr */ { 0, BX_IA_FPU_ESC },
996 /* DF /dr */ { 0, BX_IA_FPU_ESC },
997 #endif
998 /* E0 /dr */ { BxImmediate_BrOff8 | BxTraceEnd, BX_IA_LOOPNE32_Jb },
999 /* E1 /dr */ { BxImmediate_BrOff8 | BxTraceEnd, BX_IA_LOOPE32_Jb },
1000 /* E2 /dr */ { BxImmediate_BrOff8 | BxTraceEnd, BX_IA_LOOP32_Jb },
1001 /* E3 /dr */ { BxImmediate_BrOff8 | BxTraceEnd, BX_IA_JECXZ_Jb },
1002 /* E4 /dr */ { BxImmediate_Ib, BX_IA_IN_ALIb },
1003 /* E5 /dr */ { BxImmediate_Ib, BX_IA_IN_EAXIb },
1004 /* E6 /dr */ { BxImmediate_Ib, BX_IA_OUT_IbAL },
1005 /* E7 /dr */ { BxImmediate_Ib, BX_IA_OUT_IbEAX },
1006 /* E8 /dr */ { BxImmediate_BrOff32 | BxTraceEnd, BX_IA_CALL_Jd },
1007 /* E9 /dr */ { BxImmediate_BrOff32 | BxTraceEnd, BX_IA_JMP_Jd },
1008 /* EA /dr */ { BxImmediate_IdIw | BxTraceEnd, BX_IA_JMP_Ap },
1009 /* EB /dr */ { BxImmediate_BrOff8 | BxTraceEnd, BX_IA_JMP_Jd },
1010 /* EC /dr */ { 0, BX_IA_IN_ALDX },
1011 /* ED /dr */ { 0, BX_IA_IN_EAXDX },
1012 /* EE /dr */ { 0, BX_IA_OUT_DXAL },
1013 /* EF /dr */ { 0, BX_IA_OUT_DXEAX },
1014 /* F0 /dr */ { 0, BX_IA_ERROR }, // LOCK:
1015 /* F1 /dr */ { BxTraceEnd, BX_IA_INT1 },
1016 /* F2 /dr */ { 0, BX_IA_ERROR }, // REPNE/REPNZ
1017 /* F3 /dr */ { 0, BX_IA_ERROR }, // REP,REPE/REPZ
1018 /* F4 /dr */ { BxTraceEnd, BX_IA_HLT },
1019 /* F5 /dr */ { 0, BX_IA_CMC },
1020 /* F6 /dr */ { BxGroup3, BX_IA_ERROR, BxOpcodeInfoG3EbR },
1021 /* F7 /dr */ { BxGroup3, BX_IA_ERROR, BxOpcodeInfoG3EdR },
1022 /* F8 /dr */ { 0, BX_IA_CLC },
1023 /* F9 /dr */ { 0, BX_IA_STC },
1024 /* FA /dr */ { 0, BX_IA_CLI },
1025 /* FB /dr */ { 0, BX_IA_STI },
1026 /* FC /dr */ { 0, BX_IA_CLD },
1027 /* FD /dr */ { 0, BX_IA_STD },
1028 /* FE /dr */ { BxGroup5, BX_IA_ERROR, BxOpcodeInfoG4R },
1029 /* FF /dr */ { BxGroup5, BX_IA_ERROR, BxOpcodeInfoG5dR },
1031 /* 0F 00 /dr */ { BxGroup6, BX_IA_ERROR, BxOpcodeInfoG6 },
1032 /* 0F 01 /dr */ { BxGroup7, BX_IA_ERROR, BxOpcodeInfoG7R },
1033 /* 0F 02 /dr */ { 0, BX_IA_LAR_GvEw },
1034 /* 0F 03 /dr */ { 0, BX_IA_LSL_GvEw },
1035 /* 0F 04 /dr */ { 0, BX_IA_ERROR },
1036 #if BX_SUPPORT_X86_64
1037 /* 0F 05 /dr */ { BxTraceEnd, BX_IA_SYSCALL },
1038 #elif BX_CPU_LEVEL == 2
1039 /* 0F 05 /dr */ { BxTraceEnd, BX_IA_LOADALL },
1040 #else
1041 /* 0F 05 /dr */ { 0, BX_IA_ERROR },
1042 #endif
1043 /* 0F 06 /dr */ { 0, BX_IA_CLTS },
1044 #if BX_SUPPORT_X86_64
1045 /* 0F 07 /dr */ { BxTraceEnd, BX_IA_SYSRET },
1046 #else
1047 /* 0F 07 /dr */ { 0, BX_IA_ERROR },
1048 #endif
1049 /* 0F 08 /dr */ { BxTraceEnd, BX_IA_INVD },
1050 /* 0F 09 /dr */ { BxTraceEnd, BX_IA_WBINVD },
1051 /* 0F 0A /dr */ { 0, BX_IA_ERROR },
1052 /* 0F 0B /dr */ { BxTraceEnd, BX_IA_UD2A },
1053 /* 0F 0C /dr */ { 0, BX_IA_ERROR },
1054 #if BX_SUPPORT_X86_64 || BX_SUPPORT_3DNOW
1055 /* 0F 0D /dr */ { 0, BX_IA_NOP }, // 3DNow! PREFETCH on AMD, NOP on Intel
1056 #else
1057 /* 0F 0D /dr */ { 0, BX_IA_ERROR },
1058 #endif
1059 /* 0F 0E /dr */ { 0, BX_IA_FEMMS }, // 3DNow! FEMMS
1060 #if BX_SUPPORT_3DNOW
1061 /* 0F 0F /dr */ { BxImmediate_Ib, BX_IA_ERROR, Bx3DNowOpcodeInfo },
1062 #else
1063 /* 0F 0F /dr */ { 0, BX_IA_ERROR },
1064 #endif
1065 /* 0F 10 /dr */ { BxPrefixSSE, BX_IA_MOVUPS_VpsWps, BxOpcodeGroupSSE_0f10 },
1066 /* 0F 11 /dr */ { BxPrefixSSE, BX_IA_MOVUPS_WpsVps, BxOpcodeGroupSSE_0f11 },
1067 /* 0F 12 /dr */ { BxPrefixSSE, BX_IA_MOVLPS_VpsMq, BxOpcodeGroupSSE_0f12 },
1068 /* 0F 13 /dr */ { 0, BX_IA_ERROR }, // MOVLPS/PD SSE group
1069 /* 0F 14 /dr */ { BxPrefixSSE, BX_IA_UNPCKLPS_VpsWdq, BxOpcodeGroupSSE_0f14 },
1070 /* 0F 15 /dr */ { BxPrefixSSE, BX_IA_UNPCKHPS_VpsWdq, BxOpcodeGroupSSE_0f15 },
1071 /* 0F 16 /dr */ { BxPrefixSSE, BX_IA_MOVHPS_VpsMq, BxOpcodeGroupSSE_0f16 },
1072 /* 0F 17 /dr */ { 0, BX_IA_ERROR }, // MOHLPS/PD SSE group
1073 #if BX_CPU_LEVEL >= 6
1074 /* 0F 18 /dr */ { 0, BX_IA_NOP }, // PREFETCH HINT
1075 /* 0F 19 /dr */ { 0, BX_IA_NOP }, // multi-byte NOP
1076 /* 0F 1A /dr */ { 0, BX_IA_NOP }, // multi-byte NOP
1077 /* 0F 1B /dr */ { 0, BX_IA_NOP }, // multi-byte NOP
1078 /* 0F 1C /dr */ { 0, BX_IA_NOP }, // multi-byte NOP
1079 /* 0F 1D /dr */ { 0, BX_IA_NOP }, // multi-byte NOP
1080 /* 0F 1E /dr */ { 0, BX_IA_NOP }, // multi-byte NOP
1081 /* 0F 1F /dr */ { 0, BX_IA_NOP }, // multi-byte NOP
1082 #else
1083 /* 0F 18 /dr */ { 0, BX_IA_ERROR },
1084 /* 0F 19 /dr */ { 0, BX_IA_ERROR },
1085 /* 0F 1A /dr */ { 0, BX_IA_ERROR },
1086 /* 0F 1B /dr */ { 0, BX_IA_ERROR },
1087 /* 0F 1C /dr */ { 0, BX_IA_ERROR },
1088 /* 0F 1D /dr */ { 0, BX_IA_ERROR },
1089 /* 0F 1E /dr */ { 0, BX_IA_ERROR },
1090 /* 0F 1F /dr */ { 0, BX_IA_ERROR },
1091 #endif
1092 /* 0F 20 /dr */ { 0, BX_IA_MOV_RdCd },
1093 /* 0F 21 /dr */ { 0, BX_IA_MOV_RdDd },
1094 /* 0F 22 /dr */ { BxTraceEnd, BX_IA_MOV_CdRd },
1095 /* 0F 23 /dr */ { BxTraceEnd, BX_IA_MOV_DdRd },
1096 /* 0F 24 /dr */ { BxTraceEnd, BX_IA_MOV_RdTd }, // not implemented
1097 /* 0F 25 /dr */ { 0, BX_IA_ERROR },
1098 /* 0F 26 /dr */ { BxTraceEnd, BX_IA_MOV_TdRd }, // not implemented
1099 /* 0F 27 /dr */ { 0, BX_IA_ERROR },
1100 /* 0F 28 /dr */ { BxPrefixSSE, BX_IA_MOVAPS_VpsWps, BxOpcodeGroupSSE_0f28 },
1101 /* 0F 29 /dr */ { BxPrefixSSE, BX_IA_MOVAPS_WpsVps, BxOpcodeGroupSSE_0f29 },
1102 /* 0F 2A /dr */ { BxPrefixSSE, BX_IA_CVTPI2PS_VpsQq, BxOpcodeGroupSSE_0f2a },
1103 /* 0F 2B /dr */ { 0, BX_IA_ERROR }, // MOVNTPS/PD/SS/SD
1104 /* 0F 2C /dr */ { BxPrefixSSE, BX_IA_CVTTPS2PI_PqWps, BxOpcodeGroupSSE_0f2c },
1105 /* 0F 2D /dr */ { BxPrefixSSE, BX_IA_CVTPS2PI_PqWps, BxOpcodeGroupSSE_0f2d },
1106 /* 0F 2E /dr */ { BxPrefixSSE, BX_IA_UCOMISS_VssWss, BxOpcodeGroupSSE_0f2e },
1107 /* 0F 2F /dr */ { BxPrefixSSE, BX_IA_COMISS_VpsWps, BxOpcodeGroupSSE_0f2f },
1108 /* 0F 30 /dr */ { 0, BX_IA_WRMSR },
1109 /* 0F 31 /dr */ { 0, BX_IA_RDTSC },
1110 /* 0F 32 /dr */ { 0, BX_IA_RDMSR },
1111 /* 0F 33 /dr */ { 0, BX_IA_RDPMC },
1112 /* 0F 34 /dr */ { BxTraceEnd, BX_IA_SYSENTER },
1113 /* 0F 35 /dr */ { BxTraceEnd, BX_IA_SYSEXIT },
1114 /* 0F 36 /dr */ { 0, BX_IA_ERROR },
1115 /* 0F 37 /dr */ { 0, BX_IA_ERROR },
1116 #if (BX_SUPPORT_SSE >= 4) || (BX_SUPPORT_SSE >= 3 && BX_SUPPORT_SSE_EXTENSION > 0)
1117 /* 0F 38 /dr */ { Bx3ByteOp, BX_IA_ERROR, BxOpcode3ByteTable0f38 }, // 3-byte escape
1118 #else
1119 /* 0F 38 /dr */ { 0, BX_IA_ERROR },
1120 #endif
1121 /* 0F 39 /dr */ { 0, BX_IA_ERROR },
1122 #if (BX_SUPPORT_SSE >= 4) || (BX_SUPPORT_SSE >= 3 && BX_SUPPORT_SSE_EXTENSION > 0)
1123 /* 0F 3A /dr */ { Bx3ByteOp, BX_IA_ERROR, BxOpcode3ByteTable0f3a }, // 3-byte escape
1124 #else
1125 /* 0F 3A /dr */ { 0, BX_IA_ERROR },
1126 #endif
1127 /* 0F 3B /dr */ { 0, BX_IA_ERROR },
1128 /* 0F 3C /dr */ { 0, BX_IA_ERROR },
1129 /* 0F 3D /dr */ { 0, BX_IA_ERROR },
1130 /* 0F 3E /dr */ { 0, BX_IA_ERROR },
1131 /* 0F 3F /dr */ { 0, BX_IA_ERROR },
1132 /* 0F 40 /dr */ { 0, BX_IA_CMOVO_GdEdR },
1133 /* 0F 41 /dr */ { 0, BX_IA_CMOVNO_GdEdR },
1134 /* 0F 42 /dr */ { 0, BX_IA_CMOVB_GdEdR },
1135 /* 0F 43 /dr */ { 0, BX_IA_CMOVNB_GdEdR },
1136 /* 0F 44 /dr */ { 0, BX_IA_CMOVZ_GdEdR },
1137 /* 0F 45 /dr */ { 0, BX_IA_CMOVNZ_GdEdR },
1138 /* 0F 46 /dr */ { 0, BX_IA_CMOVBE_GdEdR },
1139 /* 0F 47 /dr */ { 0, BX_IA_CMOVNBE_GdEdR },
1140 /* 0F 48 /dr */ { 0, BX_IA_CMOVS_GdEdR },
1141 /* 0F 49 /dr */ { 0, BX_IA_CMOVNS_GdEdR },
1142 /* 0F 4A /dr */ { 0, BX_IA_CMOVP_GdEdR },
1143 /* 0F 4B /dr */ { 0, BX_IA_CMOVNP_GdEdR },
1144 /* 0F 4C /dr */ { 0, BX_IA_CMOVL_GdEdR },
1145 /* 0F 4D /dr */ { 0, BX_IA_CMOVNL_GdEdR },
1146 /* 0F 4E /dr */ { 0, BX_IA_CMOVLE_GdEdR },
1147 /* 0F 4F /dr */ { 0, BX_IA_CMOVNLE_GdEdR },
1148 /* 0F 50 /dr */ { BxPrefixSSE, BX_IA_MOVMSKPS_GdVRps, BxOpcodeGroupSSE_0f50 },
1149 /* 0F 51 /dr */ { BxPrefixSSE, BX_IA_SQRTPS_VpsWps, BxOpcodeGroupSSE_0f51 },
1150 /* 0F 52 /dr */ { BxPrefixSSE, BX_IA_RSQRTPS_VpsWps, BxOpcodeGroupSSE_0f52 },
1151 /* 0F 53 /dr */ { BxPrefixSSE, BX_IA_RCPPS_VpsWps, BxOpcodeGroupSSE_0f53 },
1152 /* 0F 54 /dr */ { BxPrefixSSE, BX_IA_ANDPS_VpsWps, BxOpcodeGroupSSE_0f54 },
1153 /* 0F 55 /dr */ { BxPrefixSSE, BX_IA_ANDNPS_VpsWps, BxOpcodeGroupSSE_0f55 },
1154 /* 0F 56 /dr */ { BxPrefixSSE, BX_IA_ORPS_VpsWps, BxOpcodeGroupSSE_0f56 },
1155 /* 0F 57 /dr */ { BxPrefixSSE, BX_IA_XORPS_VpsWps, BxOpcodeGroupSSE_0f57 },
1156 /* 0F 58 /dr */ { BxPrefixSSE, BX_IA_ADDPS_VpsWps, BxOpcodeGroupSSE_0f58 },
1157 /* 0F 59 /dr */ { BxPrefixSSE, BX_IA_MULPS_VpsWps, BxOpcodeGroupSSE_0f59 },
1158 /* 0F 5A /dr */ { BxPrefixSSE, BX_IA_CVTPS2PD_VpsWps, BxOpcodeGroupSSE_0f5a },
1159 /* 0F 5B /dr */ { BxPrefixSSE, BX_IA_CVTDQ2PS_VpsWdq, BxOpcodeGroupSSE_0f5b },
1160 /* 0F 5C /dr */ { BxPrefixSSE, BX_IA_SUBPS_VpsWps, BxOpcodeGroupSSE_0f5c },
1161 /* 0F 5D /dr */ { BxPrefixSSE, BX_IA_MINPS_VpsWps, BxOpcodeGroupSSE_0f5d },
1162 /* 0F 5E /dr */ { BxPrefixSSE, BX_IA_DIVPS_VpsWps, BxOpcodeGroupSSE_0f5e },
1163 /* 0F 5F /dr */ { BxPrefixSSE, BX_IA_MAXPS_VpsWps, BxOpcodeGroupSSE_0f5f },
1164 /* 0F 60 /dr */ { BxPrefixSSE, BX_IA_PUNPCKLBW_PqQd, BxOpcodeGroupSSE_0f60 },
1165 /* 0F 61 /dr */ { BxPrefixSSE, BX_IA_PUNPCKLWD_PqQd, BxOpcodeGroupSSE_0f61 },
1166 /* 0F 62 /dr */ { BxPrefixSSE, BX_IA_PUNPCKLDQ_PqQd, BxOpcodeGroupSSE_0f62 },
1167 /* 0F 63 /dr */ { BxPrefixSSE, BX_IA_PACKSSWB_PqQq, BxOpcodeGroupSSE_0f63 },
1168 /* 0F 64 /dr */ { BxPrefixSSE, BX_IA_PCMPGTB_PqQq, BxOpcodeGroupSSE_0f64 },
1169 /* 0F 65 /dr */ { BxPrefixSSE, BX_IA_PCMPGTW_PqQq, BxOpcodeGroupSSE_0f65 },
1170 /* 0F 66 /dr */ { BxPrefixSSE, BX_IA_PCMPGTD_PqQq, BxOpcodeGroupSSE_0f66 },
1171 /* 0F 67 /dr */ { BxPrefixSSE, BX_IA_PACKUSWB_PqQq, BxOpcodeGroupSSE_0f67 },
1172 /* 0F 68 /dr */ { BxPrefixSSE, BX_IA_PUNPCKHBW_PqQq, BxOpcodeGroupSSE_0f68 },
1173 /* 0F 69 /dr */ { BxPrefixSSE, BX_IA_PUNPCKHWD_PqQq, BxOpcodeGroupSSE_0f69 },
1174 /* 0F 6A /dr */ { BxPrefixSSE, BX_IA_PUNPCKHDQ_PqQq, BxOpcodeGroupSSE_0f6a },
1175 /* 0F 6B /dr */ { BxPrefixSSE, BX_IA_PACKSSDW_PqQq, BxOpcodeGroupSSE_0f6b },
1176 /* 0F 6C /dr */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0f6c },
1177 /* 0F 6D /dr */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0f6d },
1178 /* 0F 6E /dr */ { BxPrefixSSE, BX_IA_MOVD_PqEd, BxOpcodeGroupSSE_0f6e },
1179 /* 0F 6F /dr */ { BxPrefixSSE, BX_IA_MOVQ_PqQq, BxOpcodeGroupSSE_0f6f },
1180 /* 0F 70 /dr */ { BxPrefixSSE | BxImmediate_Ib, BX_IA_PSHUFW_PqQqIb, BxOpcodeGroupSSE_0f70 },
1181 /* 0F 71 /dr */ { BxGroup12, BX_IA_ERROR, BxOpcodeInfoG12R },
1182 /* 0F 72 /dr */ { BxGroup13, BX_IA_ERROR, BxOpcodeInfoG13R },
1183 /* 0F 73 /dr */ { BxGroup14, BX_IA_ERROR, BxOpcodeInfoG14R },
1184 /* 0F 74 /dr */ { BxPrefixSSE, BX_IA_PCMPEQB_PqQq, BxOpcodeGroupSSE_0f74 },
1185 /* 0F 75 /dr */ { BxPrefixSSE, BX_IA_PCMPEQW_PqQq, BxOpcodeGroupSSE_0f75 },
1186 /* 0F 76 /dr */ { BxPrefixSSE, BX_IA_PCMPEQD_PqQq, BxOpcodeGroupSSE_0f76 },
1187 /* 0F 77 /dr */ { BxPrefixSSE, BX_IA_EMMS, BxOpcodeGroupSSE_ERR },
1188 /* 0F 78 /dr */ { 0, BX_IA_ERROR },
1189 /* 0F 79 /dr */ { 0, BX_IA_ERROR },
1190 /* 0F 7A /dr */ { 0, BX_IA_ERROR },
1191 /* 0F 7B /dr */ { 0, BX_IA_ERROR },
1192 /* 0F 7C /dr */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0f7c },
1193 /* 0F 7D /dr */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0f7d },
1194 /* 0F 7E /dr */ { BxPrefixSSE, BX_IA_MOVD_EdPd, BxOpcodeGroupSSE_0f7e },
1195 /* 0F 7F /dr */ { BxPrefixSSE, BX_IA_MOVQ_QqPq, BxOpcodeGroupSSE_0f7f },
1196 /* 0F 80 /dr */ { BxImmediate_BrOff32 | BxTraceJCC, BX_IA_JO_Jd },
1197 /* 0F 81 /dr */ { BxImmediate_BrOff32 | BxTraceJCC, BX_IA_JNO_Jd },
1198 /* 0F 82 /dr */ { BxImmediate_BrOff32 | BxTraceJCC, BX_IA_JB_Jd },
1199 /* 0F 83 /dr */ { BxImmediate_BrOff32 | BxTraceJCC, BX_IA_JNB_Jd },
1200 /* 0F 84 /dr */ { BxImmediate_BrOff32 | BxTraceJCC, BX_IA_JZ_Jd },
1201 /* 0F 85 /dr */ { BxImmediate_BrOff32 | BxTraceJCC, BX_IA_JNZ_Jd },
1202 /* 0F 86 /dr */ { BxImmediate_BrOff32 | BxTraceJCC, BX_IA_JBE_Jd },
1203 /* 0F 87 /dr */ { BxImmediate_BrOff32 | BxTraceJCC, BX_IA_JNBE_Jd },
1204 /* 0F 88 /dr */ { BxImmediate_BrOff32 | BxTraceJCC, BX_IA_JS_Jd },
1205 /* 0F 89 /dr */ { BxImmediate_BrOff32 | BxTraceJCC, BX_IA_JNS_Jd },
1206 /* 0F 8A /dr */ { BxImmediate_BrOff32 | BxTraceJCC, BX_IA_JP_Jd },
1207 /* 0F 8B /dr */ { BxImmediate_BrOff32 | BxTraceJCC, BX_IA_JNP_Jd },
1208 /* 0F 8C /dr */ { BxImmediate_BrOff32 | BxTraceJCC, BX_IA_JL_Jd },
1209 /* 0F 8D /dr */ { BxImmediate_BrOff32 | BxTraceJCC, BX_IA_JNL_Jd },
1210 /* 0F 8E /dr */ { BxImmediate_BrOff32 | BxTraceJCC, BX_IA_JLE_Jd },
1211 /* 0F 8F /dr */ { BxImmediate_BrOff32 | BxTraceJCC, BX_IA_JNLE_Jd },
1212 /* 0F 90 /dr */ { 0, BX_IA_SETO_EbR },
1213 /* 0F 91 /dr */ { 0, BX_IA_SETNO_EbR },
1214 /* 0F 92 /dr */ { 0, BX_IA_SETB_EbR },
1215 /* 0F 93 /dr */ { 0, BX_IA_SETNB_EbR },
1216 /* 0F 94 /dr */ { 0, BX_IA_SETZ_EbR },
1217 /* 0F 95 /dr */ { 0, BX_IA_SETNZ_EbR },
1218 /* 0F 96 /dr */ { 0, BX_IA_SETBE_EbR },
1219 /* 0F 97 /dr */ { 0, BX_IA_SETNBE_EbR },
1220 /* 0F 98 /dr */ { 0, BX_IA_SETS_EbR },
1221 /* 0F 99 /dr */ { 0, BX_IA_SETNS_EbR },
1222 /* 0F 9A /dr */ { 0, BX_IA_SETP_EbR },
1223 /* 0F 9B /dr */ { 0, BX_IA_SETNP_EbR },
1224 /* 0F 9C /dr */ { 0, BX_IA_SETL_EbR },
1225 /* 0F 9D /dr */ { 0, BX_IA_SETNL_EbR },
1226 /* 0F 9E /dr */ { 0, BX_IA_SETLE_EbR },
1227 /* 0F 9F /dr */ { 0, BX_IA_SETNLE_EbR },
1228 /* 0F A0 /dr */ { 0, BX_IA_PUSH32_FS },
1229 /* 0F A1 /dr */ { 0, BX_IA_POP32_FS },
1230 /* 0F A2 /dr */ { 0, BX_IA_CPUID },
1231 /* 0F A3 /dr */ { 0, BX_IA_BT_EdGdR },
1232 /* 0F A4 /dr */ { BxImmediate_Ib, BX_IA_SHLD_EdGdR },
1233 /* 0F A5 /dr */ { 0, BX_IA_SHLD_EdGdR },
1234 /* 0F A6 /dr */ { BxTraceEnd, BX_IA_CMPXCHG_XBTS }, // not implemented
1235 /* 0F A7 /dr */ { BxTraceEnd, BX_IA_CMPXCHG_IBTS }, // not implemented
1236 /* 0F A8 /dr */ { 0, BX_IA_PUSH32_GS },
1237 /* 0F A9 /dr */ { 0, BX_IA_POP32_GS },
1238 /* 0F AA /dr */ { BxTraceEnd, BX_IA_RSM },
1239 /* 0F AB /dr */ { 0, BX_IA_BTS_EdGdR },
1240 /* 0F AC /dr */ { BxImmediate_Ib, BX_IA_SHRD_EdGdR },
1241 /* 0F AD /dr */ { 0, BX_IA_SHRD_EdGdR },
1242 /* 0F AE /dr */ { BxGroup15, BX_IA_ERROR, BxOpcodeInfoG15R },
1243 /* 0F AF /dr */ { 0, BX_IA_IMUL_GdEdR },
1244 /* 0F B0 /dr */ { 0, BX_IA_CMPXCHG_EbGbR },
1245 /* 0F B1 /dr */ { 0, BX_IA_CMPXCHG_EdGdR },
1246 /* 0F B2 /dr */ { 0, BX_IA_ERROR }, // LSS
1247 /* 0F B3 /dr */ { 0, BX_IA_BTR_EdGdR },
1248 /* 0F B4 /dr */ { 0, BX_IA_ERROR }, // LFS
1249 /* 0F B5 /dr */ { 0, BX_IA_ERROR }, // LGS
1250 /* 0F B6 /dr */ { 0, BX_IA_MOVZX_GdEbR },
1251 /* 0F B7 /dr */ { 0, BX_IA_MOVZX_GdEwR },
1252 /* 0F B8 /dr */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0fb8dR },
1253 /* 0F B9 /dr */ { BxTraceEnd, BX_IA_UD2B },
1254 /* 0F BA /dr */ { BxGroup8, BX_IA_ERROR, BxOpcodeInfoG8EdIbR },
1255 /* 0F BB /dr */ { 0, BX_IA_BTC_EdGdR },
1256 /* 0F BC /dr */ { 0, BX_IA_BSF_GdEdR },
1257 /* 0F BD /dr */ { 0, BX_IA_BSR_GdEdR },
1258 /* 0F BE /dr */ { 0, BX_IA_MOVSX_GdEbR },
1259 /* 0F BF /dr */ { 0, BX_IA_MOVSX_GdEwR },
1260 /* 0F C0 /dr */ { 0, BX_IA_XADD_EbGbR },
1261 /* 0F C1 /dr */ { 0, BX_IA_XADD_EdGdR },
1262 /* 0F C2 /dr */ { BxPrefixSSE | BxImmediate_Ib, BX_IA_CMPPS_VpsWpsIb, BxOpcodeGroupSSE_0fc2 },
1263 /* 0F C3 /dr */ { 0, BX_IA_ERROR }, // MOVNTI SSE group
1264 /* 0F C4 /dr */ { BxPrefixSSE | BxImmediate_Ib, BX_IA_PINSRW_PqEwIb, BxOpcodeGroupSSE_0fc4 },
1265 /* 0F C5 /dr */ { BxPrefixSSE | BxImmediate_Ib, BX_IA_PEXTRW_GdPqIb, BxOpcodeGroupSSE_0fc5R },
1266 /* 0F C6 /dr */ { BxPrefixSSE | BxImmediate_Ib, BX_IA_SHUFPS_VpsWpsIb, BxOpcodeGroupSSE_0fc6 },
1267 /* 0F C7 /dr */ { 0, BX_IA_ERROR }, // CMPXCHG8B G9 group
1268 /* 0F C8 /dr */ { 0, BX_IA_BSWAP_ERX },
1269 /* 0F C9 /dr */ { 0, BX_IA_BSWAP_ERX },
1270 /* 0F CA /dr */ { 0, BX_IA_BSWAP_ERX },
1271 /* 0F CB /dr */ { 0, BX_IA_BSWAP_ERX },
1272 /* 0F CC /dr */ { 0, BX_IA_BSWAP_ERX },
1273 /* 0F CD /dr */ { 0, BX_IA_BSWAP_ERX },
1274 /* 0F CE /dr */ { 0, BX_IA_BSWAP_ERX },
1275 /* 0F CF /dr */ { 0, BX_IA_BSWAP_ERX },
1276 /* 0F D0 /dr */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0fd0 },
1277 /* 0F D1 /dr */ { BxPrefixSSE, BX_IA_PSRLW_PqQq, BxOpcodeGroupSSE_0fd1 },
1278 /* 0F D2 /dr */ { BxPrefixSSE, BX_IA_PSRLD_PqQq, BxOpcodeGroupSSE_0fd2 },
1279 /* 0F D3 /dr */ { BxPrefixSSE, BX_IA_PSRLQ_PqQq, BxOpcodeGroupSSE_0fd3 },
1280 /* 0F D4 /dr */ { BxPrefixSSE, BX_IA_PADDQ_PqQq, BxOpcodeGroupSSE_0fd4 },
1281 /* 0F D5 /dr */ { BxPrefixSSE, BX_IA_PMULLW_PqQq, BxOpcodeGroupSSE_0fd5 },
1282 /* 0F D6 /dr */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0fd6 },
1283 /* 0F D7 /dr */ { BxPrefixSSE, BX_IA_PMOVMSKB_GdPRq, BxOpcodeGroupSSE_0fd7 },
1284 /* 0F D8 /dr */ { BxPrefixSSE, BX_IA_PSUBUSB_PqQq, BxOpcodeGroupSSE_0fd8 },
1285 /* 0F D9 /dr */ { BxPrefixSSE, BX_IA_PSUBUSW_PqQq, BxOpcodeGroupSSE_0fd9 },
1286 /* 0F DA /dr */ { BxPrefixSSE, BX_IA_PMINUB_PqQq, BxOpcodeGroupSSE_0fda },
1287 /* 0F DB /dr */ { BxPrefixSSE, BX_IA_PAND_PqQq, BxOpcodeGroupSSE_0fdb },
1288 /* 0F DC /dr */ { BxPrefixSSE, BX_IA_PADDUSB_PqQq, BxOpcodeGroupSSE_0fdc },
1289 /* 0F DD /dr */ { BxPrefixSSE, BX_IA_PADDUSW_PqQq, BxOpcodeGroupSSE_0fdd },
1290 /* 0F DE /dr */ { BxPrefixSSE, BX_IA_PMAXUB_PqQq, BxOpcodeGroupSSE_0fde },
1291 /* 0F DF /dr */ { BxPrefixSSE, BX_IA_PANDN_PqQq, BxOpcodeGroupSSE_0fdf },
1292 /* 0F E0 /dr */ { BxPrefixSSE, BX_IA_PAVGB_PqQq, BxOpcodeGroupSSE_0fe0 },
1293 /* 0F E1 /dr */ { BxPrefixSSE, BX_IA_PSRAW_PqQq, BxOpcodeGroupSSE_0fe1 },
1294 /* 0F E2 /dr */ { BxPrefixSSE, BX_IA_PSRAD_PqQq, BxOpcodeGroupSSE_0fe2 },
1295 /* 0F E3 /dr */ { BxPrefixSSE, BX_IA_PAVGW_PqQq, BxOpcodeGroupSSE_0fe3 },
1296 /* 0F E4 /dr */ { BxPrefixSSE, BX_IA_PMULHUW_PqQq, BxOpcodeGroupSSE_0fe4 },
1297 /* 0F E5 /dr */ { BxPrefixSSE, BX_IA_PMULHW_PqQq, BxOpcodeGroupSSE_0fe5 },
1298 /* 0F E6 /dr */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0fe6 },
1299 /* 0F E7 /dr */ { 0, BX_IA_ERROR }, // MOVNTQ/MOVNTDQ SSE group
1300 /* 0F E8 /dr */ { BxPrefixSSE, BX_IA_PSUBSB_PqQq, BxOpcodeGroupSSE_0fe8 },
1301 /* 0F E9 /dr */ { BxPrefixSSE, BX_IA_PSUBSW_PqQq, BxOpcodeGroupSSE_0fe9 },
1302 /* 0F EA /dr */ { BxPrefixSSE, BX_IA_PMINSW_PqQq, BxOpcodeGroupSSE_0fea },
1303 /* 0F EB /dr */ { BxPrefixSSE, BX_IA_POR_PqQq, BxOpcodeGroupSSE_0feb },
1304 /* 0F EC /dr */ { BxPrefixSSE, BX_IA_PADDSB_PqQq, BxOpcodeGroupSSE_0fec },
1305 /* 0F ED /dr */ { BxPrefixSSE, BX_IA_PADDSW_PqQq, BxOpcodeGroupSSE_0fed },
1306 /* 0F EE /dr */ { BxPrefixSSE, BX_IA_PMAXSW_PqQq, BxOpcodeGroupSSE_0fee },
1307 /* 0F EF /dr */ { BxPrefixSSE, BX_IA_PXOR_PqQq, BxOpcodeGroupSSE_0fef },
1308 /* 0F F0 /dr */ { 0, BX_IA_ERROR }, // LDDQU SSE group
1309 /* 0F F1 /dr */ { BxPrefixSSE, BX_IA_PSLLW_PqQq, BxOpcodeGroupSSE_0ff1 },
1310 /* 0F F2 /dr */ { BxPrefixSSE, BX_IA_PSLLD_PqQq, BxOpcodeGroupSSE_0ff2 },
1311 /* 0F F3 /dr */ { BxPrefixSSE, BX_IA_PSLLQ_PqQq, BxOpcodeGroupSSE_0ff3 },
1312 /* 0F F4 /dr */ { BxPrefixSSE, BX_IA_PMULUDQ_PqQq, BxOpcodeGroupSSE_0ff4 },
1313 /* 0F F5 /dr */ { BxPrefixSSE, BX_IA_PMADDWD_PqQq, BxOpcodeGroupSSE_0ff5 },
1314 /* 0F F6 /dr */ { BxPrefixSSE, BX_IA_PSADBW_PqQq, BxOpcodeGroupSSE_0ff6 },
1315 /* 0F F7 /dr */ { BxPrefixSSE, BX_IA_MASKMOVQ_PqPRq, BxOpcodeGroupSSE_0ff7R },
1316 /* 0F F8 /dr */ { BxPrefixSSE, BX_IA_PSUBB_PqQq, BxOpcodeGroupSSE_0ff8 },
1317 /* 0F F9 /dr */ { BxPrefixSSE, BX_IA_PSUBW_PqQq, BxOpcodeGroupSSE_0ff9 },
1318 /* 0F FA /dr */ { BxPrefixSSE, BX_IA_PSUBD_PqQq, BxOpcodeGroupSSE_0ffa },
1319 /* 0F FB /dr */ { BxPrefixSSE, BX_IA_PSUBQ_PqQq, BxOpcodeGroupSSE_0ffb },
1320 /* 0F FC /dr */ { BxPrefixSSE, BX_IA_PADDB_PqQq, BxOpcodeGroupSSE_0ffc },
1321 /* 0F FD /dr */ { BxPrefixSSE, BX_IA_PADDW_PqQq, BxOpcodeGroupSSE_0ffd },
1322 /* 0F FE /dr */ { BxPrefixSSE, BX_IA_PADDD_PqQq, BxOpcodeGroupSSE_0ffe },
1323 /* 0F FF /dr */ { 0, BX_IA_ERROR }
1326 /* ************************** */
1327 /* 512 entries for 16bit mode */
1328 /* 512 entries for 32bit mode */
1329 /* ************************** */
1331 static const BxOpcodeInfo_t BxOpcodeInfo32M[512*2] = {
1332 // 512 entries for 16bit mode
1333 /* 00 /wm */ { BxLockable, BX_IA_ADD_EbGbM },
1334 /* 01 /wm */ { BxLockable, BX_IA_ADD_EwGwM },
1335 /* 02 /wm */ { 0, BX_IA_ADD_GbEbM },
1336 /* 03 /wm */ { 0, BX_IA_ADD_GwEwM },
1337 /* 04 /wm */ { BxImmediate_Ib, BX_IA_ADD_ALIb },
1338 /* 05 /wm */ { BxImmediate_Iw, BX_IA_ADD_AXIw },
1339 /* 06 /wm */ { 0, BX_IA_PUSH16_ES },
1340 /* 07 /wm */ { 0, BX_IA_POP16_ES },
1341 /* 08 /wm */ { BxLockable, BX_IA_OR_EbGbM },
1342 /* 09 /wm */ { BxLockable, BX_IA_OR_EwGwM },
1343 /* 0A /wm */ { 0, BX_IA_OR_GbEbM },
1344 /* 0B /wm */ { 0, BX_IA_OR_GwEwM },
1345 /* 0C /wm */ { BxImmediate_Ib, BX_IA_OR_ALIb },
1346 /* 0D /wm */ { BxImmediate_Iw, BX_IA_OR_AXIw },
1347 /* 0E /wm */ { 0, BX_IA_PUSH16_CS },
1348 /* 0F /wm */ { 0, BX_IA_ERROR }, // 2-byte escape
1349 /* 10 /wm */ { BxLockable, BX_IA_ADC_EbGbM },
1350 /* 11 /wm */ { BxLockable, BX_IA_ADC_EwGwM },
1351 /* 12 /wm */ { 0, BX_IA_ADC_GbEbM },
1352 /* 13 /wm */ { 0, BX_IA_ADC_GwEwM },
1353 /* 14 /wm */ { BxImmediate_Ib, BX_IA_ADC_ALIb },
1354 /* 15 /wm */ { BxImmediate_Iw, BX_IA_ADC_AXIw },
1355 /* 16 /wm */ { 0, BX_IA_PUSH16_SS },
1356 /* 17 /wm */ { BxTraceEnd, BX_IA_POP16_SS }, // async_event = 1
1357 /* 18 /wm */ { BxLockable, BX_IA_SBB_EbGbM },
1358 /* 19 /wm */ { BxLockable, BX_IA_SBB_EwGwM },
1359 /* 1A /wm */ { 0, BX_IA_SBB_GbEbM },
1360 /* 1B /wm */ { 0, BX_IA_SBB_GwEwM },
1361 /* 1C /wm */ { BxImmediate_Ib, BX_IA_SBB_ALIb },
1362 /* 1D /wm */ { BxImmediate_Iw, BX_IA_SBB_AXIw },
1363 /* 1E /wm */ { 0, BX_IA_PUSH16_DS },
1364 /* 1F /wm */ { 0, BX_IA_POP16_DS },
1365 /* 20 /wm */ { BxLockable, BX_IA_AND_EbGbM },
1366 /* 21 /wm */ { BxLockable, BX_IA_AND_EwGwM },
1367 /* 22 /wm */ { 0, BX_IA_AND_GbEbM },
1368 /* 23 /wm */ { 0, BX_IA_AND_GwEwM },
1369 /* 24 /wm */ { BxImmediate_Ib, BX_IA_AND_ALIb },
1370 /* 25 /wm */ { BxImmediate_Iw, BX_IA_AND_AXIw },
1371 /* 26 /wm */ { 0, BX_IA_ERROR }, // ES:
1372 /* 27 /wm */ { 0, BX_IA_DAA },
1373 /* 28 /wm */ { BxLockable, BX_IA_SUB_EbGbM },
1374 /* 29 /wm */ { BxLockable, BX_IA_SUB_EwGwM },
1375 /* 2A /wm */ { 0, BX_IA_SUB_GbEbM },
1376 /* 2B /wm */ { 0, BX_IA_SUB_GwEwM },
1377 /* 2C /wm */ { BxImmediate_Ib, BX_IA_SUB_ALIb },
1378 /* 2D /wm */ { BxImmediate_Iw, BX_IA_SUB_AXIw },
1379 /* 2E /wm */ { 0, BX_IA_ERROR }, // CS:
1380 /* 2F /wm */ { 0, BX_IA_DAS },
1381 /* 30 /wm */ { BxLockable, BX_IA_XOR_EbGbM },
1382 /* 31 /wm */ { BxLockable, BX_IA_XOR_EwGwM },
1383 /* 32 /wm */ { 0, BX_IA_XOR_GbEbM },
1384 /* 33 /wm */ { 0, BX_IA_XOR_GwEwM },
1385 /* 34 /wm */ { BxImmediate_Ib, BX_IA_XOR_ALIb },
1386 /* 35 /wm */ { BxImmediate_Iw, BX_IA_XOR_AXIw },
1387 /* 36 /wm */ { 0, BX_IA_ERROR }, // SS:
1388 /* 37 /wm */ { 0, BX_IA_AAA },
1389 /* 38 /wm */ { 0, BX_IA_CMP_EbGbM },
1390 /* 39 /wm */ { 0, BX_IA_CMP_EwGwM },
1391 /* 3A /wm */ { 0, BX_IA_CMP_GbEbM },
1392 /* 3B /wm */ { 0, BX_IA_CMP_GwEwM },
1393 /* 3C /wm */ { BxImmediate_Ib, BX_IA_CMP_ALIb },
1394 /* 3D /wm */ { BxImmediate_Iw, BX_IA_CMP_AXIw },
1395 /* 3E /wm */ { 0, BX_IA_ERROR }, // DS:
1396 /* 3F /wm */ { 0, BX_IA_AAS },
1397 /* 40 /wm */ { 0, BX_IA_INC_RX },
1398 /* 41 /wm */ { 0, BX_IA_INC_RX },
1399 /* 42 /wm */ { 0, BX_IA_INC_RX },
1400 /* 43 /wm */ { 0, BX_IA_INC_RX },
1401 /* 44 /wm */ { 0, BX_IA_INC_RX },
1402 /* 45 /wm */ { 0, BX_IA_INC_RX },
1403 /* 46 /wm */ { 0, BX_IA_INC_RX },
1404 /* 47 /wm */ { 0, BX_IA_INC_RX },
1405 /* 48 /wm */ { 0, BX_IA_DEC_RX },
1406 /* 49 /wm */ { 0, BX_IA_DEC_RX },
1407 /* 4A /wm */ { 0, BX_IA_DEC_RX },
1408 /* 4B /wm */ { 0, BX_IA_DEC_RX },
1409 /* 4C /wm */ { 0, BX_IA_DEC_RX },
1410 /* 4D /wm */ { 0, BX_IA_DEC_RX },
1411 /* 4E /wm */ { 0, BX_IA_DEC_RX },
1412 /* 4F /wm */ { 0, BX_IA_DEC_RX },
1413 /* 50 /wm */ { 0, BX_IA_PUSH_RX },
1414 /* 51 /wm */ { 0, BX_IA_PUSH_RX },
1415 /* 52 /wm */ { 0, BX_IA_PUSH_RX },
1416 /* 53 /wm */ { 0, BX_IA_PUSH_RX },
1417 /* 54 /wm */ { 0, BX_IA_PUSH_RX },
1418 /* 55 /wm */ { 0, BX_IA_PUSH_RX },
1419 /* 56 /wm */ { 0, BX_IA_PUSH_RX },
1420 /* 57 /wm */ { 0, BX_IA_PUSH_RX },
1421 /* 58 /wm */ { 0, BX_IA_POP_RX },
1422 /* 59 /wm */ { 0, BX_IA_POP_RX },
1423 /* 5A /wm */ { 0, BX_IA_POP_RX },
1424 /* 5B /wm */ { 0, BX_IA_POP_RX },
1425 /* 5C /wm */ { 0, BX_IA_POP_RX },
1426 /* 5D /wm */ { 0, BX_IA_POP_RX },
1427 /* 5E /wm */ { 0, BX_IA_POP_RX },
1428 /* 5F /wm */ { 0, BX_IA_POP_RX },
1429 /* 60 /wm */ { 0, BX_IA_PUSHAD16 },
1430 /* 61 /wm */ { 0, BX_IA_POPAD16 },
1431 /* 62 /wm */ { 0, BX_IA_BOUND_GwMa },
1432 /* 63 /wm */ { 0, BX_IA_ARPL_EwGw },
1433 /* 64 /wm */ { 0, BX_IA_ERROR }, // FS:
1434 /* 65 /wm */ { 0, BX_IA_ERROR }, // GS:
1435 /* 66 /wm */ { 0, BX_IA_ERROR }, // OS:
1436 /* 67 /wm */ { 0, BX_IA_ERROR }, // AS:
1437 /* 68 /wm */ { BxImmediate_Iw, BX_IA_PUSH_Iw },
1438 /* 69 /wm */ { BxImmediate_Iw, BX_IA_IMUL_GwEwIwM },
1439 /* 6A /wm */ { BxImmediate_Ib_SE, BX_IA_PUSH_Iw },
1440 /* 6B /wm */ { BxImmediate_Ib_SE, BX_IA_IMUL_GwEwIwM },
1441 /* 6C /wm */ { 0, BX_IA_REP_INSB_YbDX },
1442 /* 6D /wm */ { 0, BX_IA_REP_INSW_YwDX },
1443 /* 6E /wm */ { 0, BX_IA_REP_OUTSB_DXXb },
1444 /* 6F /wm */ { 0, BX_IA_REP_OUTSW_DXXw },
1445 /* 70 /wm */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JO_Jw },
1446 /* 71 /wm */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JNO_Jw },
1447 /* 72 /wm */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JB_Jw },
1448 /* 73 /wm */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JNB_Jw },
1449 /* 74 /wm */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JZ_Jw },
1450 /* 75 /wm */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JNZ_Jw },
1451 /* 76 /wm */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JBE_Jw },
1452 /* 77 /wm */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JNBE_Jw },
1453 /* 78 /wm */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JS_Jw },
1454 /* 79 /wm */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JNS_Jw },
1455 /* 7A /wm */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JP_Jw },
1456 /* 7B /wm */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JNP_Jw },
1457 /* 7C /wm */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JL_Jw },
1458 /* 7D /wm */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JNL_Jw },
1459 /* 7E /wm */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JLE_Jw },
1460 /* 7F /wm */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JNLE_Jw },
1461 /* 80 /wm */ { BxGroup1 | BxImmediate_Ib, BX_IA_ERROR, BxOpcodeInfoG1EbIbM },
1462 /* 81 /wm */ { BxGroup1 | BxImmediate_Iw, BX_IA_ERROR, BxOpcodeInfoG1EwM },
1463 /* 82 /wm */ { BxGroup1 | BxImmediate_Ib, BX_IA_ERROR, BxOpcodeInfoG1EbIbM },
1464 /* 83 /wm */ { BxGroup1 | BxImmediate_Ib_SE, BX_IA_ERROR, BxOpcodeInfoG1EwM },
1465 /* 84 /wm */ { 0, BX_IA_TEST_EbGbM },
1466 /* 85 /wm */ { 0, BX_IA_TEST_EwGwM },
1467 /* 86 /wm */ { BxLockable, BX_IA_XCHG_EbGbM },
1468 /* 87 /wm */ { BxLockable, BX_IA_XCHG_EwGwM },
1469 /* 88 /wm */ { 0, BX_IA_MOV_EbGbM },
1470 /* 89 /wm */ { 0, BX_IA_MOV_EwGwM },
1471 /* 8A /wm */ { 0, BX_IA_MOV_GbEbM },
1472 /* 8B /wm */ { 0, BX_IA_MOV_GwEwM },
1473 /* 8C /wm */ { 0, BX_IA_MOV_EwSwM },
1474 /* 8D /wm */ { 0, BX_IA_LEA_GwM },
1475 /* 8E /wm */ { 0, BX_IA_MOV_SwEw },
1476 /* 8F /wm */ { BxGroup1A, BX_IA_ERROR, BxOpcodeInfoG1AEwM },
1477 /* 90 /wm */ { 0, BX_IA_NOP },
1478 /* 91 /wm */ { 0, BX_IA_XCHG_RXAX },
1479 /* 92 /wm */ { 0, BX_IA_XCHG_RXAX },
1480 /* 93 /wm */ { 0, BX_IA_XCHG_RXAX },
1481 /* 94 /wm */ { 0, BX_IA_XCHG_RXAX },
1482 /* 95 /wm */ { 0, BX_IA_XCHG_RXAX },
1483 /* 96 /wm */ { 0, BX_IA_XCHG_RXAX },
1484 /* 97 /wm */ { 0, BX_IA_XCHG_RXAX },
1485 /* 98 /wm */ { 0, BX_IA_CBW },
1486 /* 99 /wm */ { 0, BX_IA_CWD },
1487 /* 9A /wm */ { BxImmediate_IwIw | BxTraceEnd, BX_IA_CALL16_Ap },
1488 /* 9B /wm */ { 0, BX_IA_FWAIT },
1489 /* 9C /wm */ { 0, BX_IA_PUSHF_Fw },
1490 /* 9D /wm */ { 0, BX_IA_POPF_Fw },
1491 /* 9E /wm */ { 0, BX_IA_SAHF },
1492 /* 9F /wm */ { 0, BX_IA_LAHF },
1493 /* A0 /wm */ { BxImmediate_O, BX_IA_MOV_ALOd },
1494 /* A1 /wm */ { BxImmediate_O, BX_IA_MOV_AXOd },
1495 /* A2 /wm */ { BxImmediate_O, BX_IA_MOV_OdAL },
1496 /* A3 /wm */ { BxImmediate_O, BX_IA_MOV_OdAX },
1497 /* A4 /wm */ { 0, BX_IA_REP_MOVSB_XbYb },
1498 /* A5 /wm */ { 0, BX_IA_REP_MOVSW_XwYw },
1499 /* A6 /wm */ { 0, BX_IA_REP_CMPSB_XbYb },
1500 /* A7 /wm */ { 0, BX_IA_REP_CMPSW_XwYw },
1501 /* A8 /wm */ { BxImmediate_Ib, BX_IA_TEST_ALIb },
1502 /* A9 /wm */ { BxImmediate_Iw, BX_IA_TEST_AXIw },
1503 /* AA /wm */ { 0, BX_IA_REP_STOSB_YbAL },
1504 /* AB /wm */ { 0, BX_IA_REP_STOSW_YwAX },
1505 /* AC /wm */ { 0, BX_IA_REP_LODSB_ALXb },
1506 /* AD /wm */ { 0, BX_IA_REP_LODSW_AXXw },
1507 /* AE /wm */ { 0, BX_IA_REP_SCASB_ALXb },
1508 /* AF /wm */ { 0, BX_IA_REP_SCASW_AXXw },
1509 /* B0 /wm */ { BxImmediate_Ib, BX_IA_MOV_RLIb },
1510 /* B1 /wm */ { BxImmediate_Ib, BX_IA_MOV_RLIb },
1511 /* B2 /wm */ { BxImmediate_Ib, BX_IA_MOV_RLIb },
1512 /* B3 /wm */ { BxImmediate_Ib, BX_IA_MOV_RLIb },
1513 /* B4 /wm */ { BxImmediate_Ib, BX_IA_MOV_RHIb },
1514 /* B5 /wm */ { BxImmediate_Ib, BX_IA_MOV_RHIb },
1515 /* B6 /wm */ { BxImmediate_Ib, BX_IA_MOV_RHIb },
1516 /* B7 /wm */ { BxImmediate_Ib, BX_IA_MOV_RHIb },
1517 /* B8 /wm */ { BxImmediate_Iw, BX_IA_MOV_RXIw },
1518 /* B9 /wm */ { BxImmediate_Iw, BX_IA_MOV_RXIw },
1519 /* BA /wm */ { BxImmediate_Iw, BX_IA_MOV_RXIw },
1520 /* BB /wm */ { BxImmediate_Iw, BX_IA_MOV_RXIw },
1521 /* BC /wm */ { BxImmediate_Iw, BX_IA_MOV_RXIw },
1522 /* BD /wm */ { BxImmediate_Iw, BX_IA_MOV_RXIw },
1523 /* BE /wm */ { BxImmediate_Iw, BX_IA_MOV_RXIw },
1524 /* BF /wm */ { BxImmediate_Iw, BX_IA_MOV_RXIw },
1525 /* C0 /wm */ { BxGroup2 | BxImmediate_Ib, BX_IA_ERROR, BxOpcodeInfoG2Eb },
1526 /* C1 /wm */ { BxGroup2 | BxImmediate_Ib, BX_IA_ERROR, BxOpcodeInfoG2Ew },
1527 /* C2 /wm */ { BxImmediate_Iw | BxTraceEnd, BX_IA_RETnear16_Iw },
1528 /* C3 /wm */ { BxTraceEnd, BX_IA_RETnear16 },
1529 /* C4 /wm */ { 0, BX_IA_LES_GwMp },
1530 /* C5 /wm */ { 0, BX_IA_LDS_GwMp },
1531 /* C6 /wm */ { BxGroup11, BX_IA_ERROR, BxOpcodeInfoG11EbM },
1532 /* C7 /wm */ { BxGroup11, BX_IA_ERROR, BxOpcodeInfoG11EwM },
1533 /* C8 /wm */ { BxImmediate_IwIb, BX_IA_ENTER16_IwIb },
1534 /* C9 /wm */ { 0, BX_IA_LEAVE16 },
1535 /* CA /wm */ { BxImmediate_Iw | BxTraceEnd, BX_IA_RETfar16_Iw },
1536 /* CB /wm */ { BxTraceEnd, BX_IA_RETfar16 },
1537 /* CC /wm */ { BxTraceEnd, BX_IA_INT3 },
1538 /* CD /wm */ { BxImmediate_Ib | BxTraceEnd, BX_IA_INT_Ib },
1539 /* CE /wm */ { BxTraceEnd, BX_IA_INTO },
1540 /* CF /wm */ { BxTraceEnd, BX_IA_IRET16 },
1541 /* D0 /wm */ { BxGroup2 | BxImmediate_I1, BX_IA_ERROR, BxOpcodeInfoG2Eb },
1542 /* D1 /wm */ { BxGroup2 | BxImmediate_I1, BX_IA_ERROR, BxOpcodeInfoG2Ew },
1543 /* D2 /wm */ { BxGroup2, BX_IA_ERROR, BxOpcodeInfoG2Eb },
1544 /* D3 /wm */ { BxGroup2, BX_IA_ERROR, BxOpcodeInfoG2Ew },
1545 /* D4 /wm */ { BxImmediate_Ib, BX_IA_AAM },
1546 /* D5 /wm */ { BxImmediate_Ib, BX_IA_AAD },
1547 /* D6 /wm */ { 0, BX_IA_SALC },
1548 /* D7 /wm */ { 0, BX_IA_XLAT },
1549 #if BX_SUPPORT_FPU
1550 /* D8 /wm */ { BxGroupFP, BX_IA_ERROR, BxOpcodeInfo_FPGroupD8 },
1551 /* D9 /wm */ { BxGroupFP, BX_IA_ERROR, BxOpcodeInfo_FPGroupD9 },
1552 /* DA /wm */ { BxGroupFP, BX_IA_ERROR, BxOpcodeInfo_FPGroupDA },
1553 /* DB /wm */ { BxGroupFP, BX_IA_ERROR, BxOpcodeInfo_FPGroupDB },
1554 /* DC /wm */ { BxGroupFP, BX_IA_ERROR, BxOpcodeInfo_FPGroupDC },
1555 /* DD /wm */ { BxGroupFP, BX_IA_ERROR, BxOpcodeInfo_FPGroupDD },
1556 /* DE /wm */ { BxGroupFP, BX_IA_ERROR, BxOpcodeInfo_FPGroupDE },
1557 /* DF /wm */ { BxGroupFP, BX_IA_ERROR, BxOpcodeInfo_FPGroupDF },
1558 #else
1559 /* D8 /wm */ { 0, BX_IA_FPU_ESC },
1560 /* D9 /wm */ { 0, BX_IA_FPU_ESC },
1561 /* DA /wm */ { 0, BX_IA_FPU_ESC },
1562 /* DB /wm */ { 0, BX_IA_FPU_ESC },
1563 /* DC /wm */ { 0, BX_IA_FPU_ESC },
1564 /* DD /wm */ { 0, BX_IA_FPU_ESC },
1565 /* DE /wm */ { 0, BX_IA_FPU_ESC },
1566 /* DF /wm */ { 0, BX_IA_FPU_ESC },
1567 #endif
1568 /* E0 /wm */ { BxImmediate_BrOff8 | BxTraceEnd, BX_IA_LOOPNE16_Jb },
1569 /* E1 /wm */ { BxImmediate_BrOff8 | BxTraceEnd, BX_IA_LOOPE16_Jb },
1570 /* E2 /wm */ { BxImmediate_BrOff8 | BxTraceEnd, BX_IA_LOOP16_Jb },
1571 /* E3 /wm */ { BxImmediate_BrOff8 | BxTraceEnd, BX_IA_JCXZ_Jb },
1572 /* E4 /wm */ { BxImmediate_Ib, BX_IA_IN_ALIb },
1573 /* E5 /wm */ { BxImmediate_Ib, BX_IA_IN_AXIb },
1574 /* E6 /wm */ { BxImmediate_Ib, BX_IA_OUT_IbAL },
1575 /* E7 /wm */ { BxImmediate_Ib, BX_IA_OUT_IbAX },
1576 /* E8 /wm */ { BxImmediate_BrOff16 | BxTraceEnd, BX_IA_CALL_Jw },
1577 /* E9 /wm */ { BxImmediate_BrOff16 | BxTraceEnd, BX_IA_JMP_Jw },
1578 /* EA /wm */ { BxImmediate_IwIw | BxTraceEnd, BX_IA_JMP_Ap },
1579 /* EB /wm */ { BxImmediate_BrOff8 | BxTraceEnd, BX_IA_JMP_Jw },
1580 /* EC /wm */ { 0, BX_IA_IN_ALDX },
1581 /* ED /wm */ { 0, BX_IA_IN_AXDX },
1582 /* EE /wm */ { 0, BX_IA_OUT_DXAL },
1583 /* EF /wm */ { 0, BX_IA_OUT_DXAX },
1584 /* F0 /wm */ { 0, BX_IA_ERROR }, // LOCK
1585 /* F1 /wm */ { BxTraceEnd, BX_IA_INT1 },
1586 /* F2 /wm */ { 0, BX_IA_ERROR }, // REPNE/REPNZ
1587 /* F3 /wm */ { 0, BX_IA_ERROR }, // REP, REPE/REPZ
1588 /* F4 /wm */ { BxTraceEnd, BX_IA_HLT },
1589 /* F5 /wm */ { 0, BX_IA_CMC },
1590 /* F6 /wm */ { BxGroup3, BX_IA_ERROR, BxOpcodeInfoG3EbM },
1591 /* F7 /wm */ { BxGroup3, BX_IA_ERROR, BxOpcodeInfoG3EwM },
1592 /* F8 /wm */ { 0, BX_IA_CLC },
1593 /* F9 /wm */ { 0, BX_IA_STC },
1594 /* FA /wm */ { 0, BX_IA_CLI },
1595 /* FB /wm */ { 0, BX_IA_STI },
1596 /* FC /wm */ { 0, BX_IA_CLD },
1597 /* FD /wm */ { 0, BX_IA_STD },
1598 /* FE /wm */ { BxGroup4, BX_IA_ERROR, BxOpcodeInfoG4M },
1599 /* FF /wm */ { BxGroup5, BX_IA_ERROR, BxOpcodeInfoG5wM },
1601 /* 0F 00 /wm */ { BxGroup6, BX_IA_ERROR, BxOpcodeInfoG6 },
1602 /* 0F 01 /wm */ { BxGroup7, BX_IA_ERROR, BxOpcodeInfoG7M },
1603 /* 0F 02 /wm */ { 0, BX_IA_LAR_GvEw },
1604 /* 0F 03 /wm */ { 0, BX_IA_LSL_GvEw },
1605 /* 0F 04 /wm */ { 0, BX_IA_ERROR },
1606 #if BX_SUPPORT_X86_64
1607 /* 0F 05 /wm */ { BxTraceEnd, BX_IA_SYSCALL },
1608 #elif BX_CPU_LEVEL == 2
1609 /* 0F 05 /wm */ { BxTraceEnd, BX_IA_LOADALL },
1610 #else
1611 /* 0F 05 /wm */ { 0, BX_IA_ERROR },
1612 #endif
1613 /* 0F 06 /wm */ { 0, BX_IA_CLTS },
1614 #if BX_SUPPORT_X86_64
1615 /* 0F 07 /wm */ { BxTraceEnd, BX_IA_SYSRET },
1616 #else
1617 /* 0F 07 /wm */ { 0, BX_IA_ERROR },
1618 #endif
1619 /* 0F 08 /wm */ { BxTraceEnd, BX_IA_INVD },
1620 /* 0F 09 /wm */ { BxTraceEnd, BX_IA_WBINVD },
1621 /* 0F 0A /wm */ { 0, BX_IA_ERROR },
1622 /* 0F 0B /wm */ { BxTraceEnd, BX_IA_UD2A },
1623 /* 0F 0C /wm */ { 0, BX_IA_ERROR },
1624 #if BX_SUPPORT_X86_64 || BX_SUPPORT_3DNOW
1625 /* 0F 0D /wm */ { 0, BX_IA_NOP }, // 3DNow! PREFETCH on AMD, NOP on Intel
1626 #else
1627 /* 0F 0D /wm */ { 0, BX_IA_ERROR },
1628 #endif
1629 /* 0F 0E /wm */ { 0, BX_IA_FEMMS }, // 3DNow! FEMMS
1630 #if BX_SUPPORT_3DNOW
1631 /* 0F 0F /wm */ { BxImmediate_Ib, BX_IA_ERROR, Bx3DNowOpcodeInfo },
1632 #else
1633 /* 0F 0F /wm */ { 0, BX_IA_ERROR },
1634 #endif
1635 /* 0F 10 /wm */ { BxPrefixSSE, BX_IA_MOVUPS_VpsWps, BxOpcodeGroupSSE_0f10 },
1636 /* 0F 11 /wm */ { BxPrefixSSE, BX_IA_MOVUPS_WpsVps, BxOpcodeGroupSSE_0f11 },
1637 /* 0F 12 /wm */ { BxPrefixSSE, BX_IA_MOVLPS_VpsMq, BxOpcodeGroupSSE_0f12 },
1638 /* 0F 13 /wm */ { BxPrefixSSE, BX_IA_MOVLPS_MqVps, BxOpcodeGroupSSE_0f13M },
1639 /* 0F 14 /wm */ { BxPrefixSSE, BX_IA_UNPCKLPS_VpsWdq, BxOpcodeGroupSSE_0f14 },
1640 /* 0F 15 /wm */ { BxPrefixSSE, BX_IA_UNPCKHPS_VpsWdq, BxOpcodeGroupSSE_0f15 },
1641 /* 0F 16 /wm */ { BxPrefixSSE, BX_IA_MOVHPS_VpsMq, BxOpcodeGroupSSE_0f16 },
1642 /* 0F 17 /wm */ { BxPrefixSSE, BX_IA_MOVHPS_MqVps, BxOpcodeGroupSSE_0f17M },
1643 # if BX_CPU_LEVEL >= 6
1644 /* 0F 18 /wm */ { 0, BX_IA_PREFETCH }, // opcode group G16, PREFETCH hints
1645 /* 0F 19 /wm */ { 0, BX_IA_NOP }, // multi-byte NOP
1646 /* 0F 1A /wm */ { 0, BX_IA_NOP }, // multi-byte NOP
1647 /* 0F 1B /wm */ { 0, BX_IA_NOP }, // multi-byte NOP
1648 /* 0F 1C /wm */ { 0, BX_IA_NOP }, // multi-byte NOP
1649 /* 0F 1D /wm */ { 0, BX_IA_NOP }, // multi-byte NOP
1650 /* 0F 1E /wm */ { 0, BX_IA_NOP }, // multi-byte NOP
1651 /* 0F 1F /wm */ { 0, BX_IA_NOP }, // multi-byte NOP
1652 #else
1653 /* 0F 18 /wm */ { 0, BX_IA_ERROR },
1654 /* 0F 19 /wm */ { 0, BX_IA_ERROR },
1655 /* 0F 1A /wm */ { 0, BX_IA_ERROR },
1656 /* 0F 1B /wm */ { 0, BX_IA_ERROR },
1657 /* 0F 1C /wm */ { 0, BX_IA_ERROR },
1658 /* 0F 1D /wm */ { 0, BX_IA_ERROR },
1659 /* 0F 1E /wm */ { 0, BX_IA_ERROR },
1660 /* 0F 1F /wm */ { 0, BX_IA_ERROR },
1661 #endif
1662 /* 0F 20 /wm */ { 0, BX_IA_MOV_RdCd },
1663 /* 0F 21 /wm */ { 0, BX_IA_MOV_RdDd },
1664 /* 0F 22 /wm */ { BxTraceEnd, BX_IA_MOV_CdRd },
1665 /* 0F 23 /wm */ { BxTraceEnd, BX_IA_MOV_DdRd },
1666 /* 0F 24 /wm */ { BxTraceEnd, BX_IA_MOV_RdTd }, // not implemented
1667 /* 0F 25 /wm */ { 0, BX_IA_ERROR },
1668 /* 0F 26 /wm */ { BxTraceEnd, BX_IA_MOV_TdRd }, // not implemented
1669 /* 0F 27 /wm */ { 0, BX_IA_ERROR },
1670 /* 0F 28 /wm */ { BxPrefixSSE, BX_IA_MOVAPS_VpsWps, BxOpcodeGroupSSE_0f28 },
1671 /* 0F 29 /wm */ { BxPrefixSSE, BX_IA_MOVAPS_WpsVps, BxOpcodeGroupSSE_0f29 },
1672 /* 0F 2A /wm */ { BxPrefixSSE, BX_IA_CVTPI2PS_VpsQq, BxOpcodeGroupSSE_0f2a },
1673 /* 0F 2B /wm */ { BxPrefixSSE, BX_IA_MOVNTPS_MpsVps, BxOpcodeGroupSSE_0f2bM },
1674 /* 0F 2C /wm */ { BxPrefixSSE, BX_IA_CVTTPS2PI_PqWps, BxOpcodeGroupSSE_0f2c },
1675 /* 0F 2D /wm */ { BxPrefixSSE, BX_IA_CVTPS2PI_PqWps, BxOpcodeGroupSSE_0f2d },
1676 /* 0F 2E /wm */ { BxPrefixSSE, BX_IA_UCOMISS_VssWss, BxOpcodeGroupSSE_0f2e },
1677 /* 0F 2F /wm */ { BxPrefixSSE, BX_IA_COMISS_VpsWps, BxOpcodeGroupSSE_0f2f },
1678 /* 0F 30 /wm */ { 0, BX_IA_WRMSR },
1679 /* 0F 31 /wm */ { 0, BX_IA_RDTSC },
1680 /* 0F 32 /wm */ { 0, BX_IA_RDMSR },
1681 /* 0F 33 /wm */ { 0, BX_IA_RDPMC },
1682 /* 0F 34 /wm */ { BxTraceEnd, BX_IA_SYSENTER },
1683 /* 0F 35 /wm */ { BxTraceEnd, BX_IA_SYSEXIT },
1684 /* 0F 36 /wm */ { 0, BX_IA_ERROR },
1685 /* 0F 37 /wm */ { 0, BX_IA_ERROR },
1686 #if (BX_SUPPORT_SSE >= 4) || (BX_SUPPORT_SSE >= 3 && BX_SUPPORT_SSE_EXTENSION > 0)
1687 /* 0F 38 /wm */ { Bx3ByteOp, BX_IA_ERROR, BxOpcode3ByteTable0f38 }, // 3-byte escape
1688 #else
1689 /* 0F 38 /wm */ { 0, BX_IA_ERROR },
1690 #endif
1691 /* 0F 39 /wm */ { 0, BX_IA_ERROR },
1692 #if (BX_SUPPORT_SSE >= 4) || (BX_SUPPORT_SSE >= 3 && BX_SUPPORT_SSE_EXTENSION > 0)
1693 /* 0F 3A /wm */ { Bx3ByteOp, BX_IA_ERROR, BxOpcode3ByteTable0f3a }, // 3-byte escape
1694 #else
1695 /* 0F 3A /wm */ { 0, BX_IA_ERROR },
1696 #endif
1697 /* 0F 3B /wm */ { 0, BX_IA_ERROR },
1698 /* 0F 3C /wm */ { 0, BX_IA_ERROR },
1699 /* 0F 3D /wm */ { 0, BX_IA_ERROR },
1700 /* 0F 3E /wm */ { 0, BX_IA_ERROR },
1701 /* 0F 3F /wm */ { 0, BX_IA_ERROR },
1702 /* 0F 40 /wm */ { 0, BX_IA_CMOVO_GwEwM },
1703 /* 0F 41 /wm */ { 0, BX_IA_CMOVNO_GwEwM },
1704 /* 0F 42 /wm */ { 0, BX_IA_CMOVB_GwEwM },
1705 /* 0F 43 /wm */ { 0, BX_IA_CMOVNB_GwEwM },
1706 /* 0F 44 /wm */ { 0, BX_IA_CMOVZ_GwEwM },
1707 /* 0F 45 /wm */ { 0, BX_IA_CMOVNZ_GwEwM },
1708 /* 0F 46 /wm */ { 0, BX_IA_CMOVBE_GwEwM },
1709 /* 0F 47 /wm */ { 0, BX_IA_CMOVNBE_GwEwM },
1710 /* 0F 48 /wm */ { 0, BX_IA_CMOVS_GwEwM },
1711 /* 0F 49 /wm */ { 0, BX_IA_CMOVNS_GwEwM },
1712 /* 0F 4A /wm */ { 0, BX_IA_CMOVP_GwEwM },
1713 /* 0F 4B /wm */ { 0, BX_IA_CMOVNP_GwEwM },
1714 /* 0F 4C /wm */ { 0, BX_IA_CMOVL_GwEwM },
1715 /* 0F 4D /wm */ { 0, BX_IA_CMOVNL_GwEwM },
1716 /* 0F 4E /wm */ { 0, BX_IA_CMOVLE_GwEwM },
1717 /* 0F 4F /wm */ { 0, BX_IA_CMOVNLE_GwEwM },
1718 /* 0F 50 /wm */ { BxPrefixSSE, BX_IA_MOVMSKPS_GdVRps, BxOpcodeGroupSSE_0f50 },
1719 /* 0F 51 /wm */ { BxPrefixSSE, BX_IA_SQRTPS_VpsWps, BxOpcodeGroupSSE_0f51 },
1720 /* 0F 52 /wm */ { BxPrefixSSE, BX_IA_RSQRTPS_VpsWps, BxOpcodeGroupSSE_0f52 },
1721 /* 0F 53 /wm */ { BxPrefixSSE, BX_IA_RCPPS_VpsWps, BxOpcodeGroupSSE_0f53 },
1722 /* 0F 54 /wm */ { BxPrefixSSE, BX_IA_ANDPS_VpsWps, BxOpcodeGroupSSE_0f54 },
1723 /* 0F 55 /wm */ { BxPrefixSSE, BX_IA_ANDNPS_VpsWps, BxOpcodeGroupSSE_0f55 },
1724 /* 0F 56 /wm */ { BxPrefixSSE, BX_IA_ORPS_VpsWps, BxOpcodeGroupSSE_0f56 },
1725 /* 0F 57 /wm */ { BxPrefixSSE, BX_IA_XORPS_VpsWps, BxOpcodeGroupSSE_0f57 },
1726 /* 0F 58 /wm */ { BxPrefixSSE, BX_IA_ADDPS_VpsWps, BxOpcodeGroupSSE_0f58 },
1727 /* 0F 59 /wm */ { BxPrefixSSE, BX_IA_MULPS_VpsWps, BxOpcodeGroupSSE_0f59 },
1728 /* 0F 5A /wm */ { BxPrefixSSE, BX_IA_CVTPS2PD_VpsWps, BxOpcodeGroupSSE_0f5a },
1729 /* 0F 5B /wm */ { BxPrefixSSE, BX_IA_CVTDQ2PS_VpsWdq, BxOpcodeGroupSSE_0f5b },
1730 /* 0F 5C /wm */ { BxPrefixSSE, BX_IA_SUBPS_VpsWps, BxOpcodeGroupSSE_0f5c },
1731 /* 0F 5D /wm */ { BxPrefixSSE, BX_IA_MINPS_VpsWps, BxOpcodeGroupSSE_0f5d },
1732 /* 0F 5E /wm */ { BxPrefixSSE, BX_IA_DIVPS_VpsWps, BxOpcodeGroupSSE_0f5e },
1733 /* 0F 5F /wm */ { BxPrefixSSE, BX_IA_MAXPS_VpsWps, BxOpcodeGroupSSE_0f5f },
1734 /* 0F 60 /wm */ { BxPrefixSSE, BX_IA_PUNPCKLBW_PqQd, BxOpcodeGroupSSE_0f60 },
1735 /* 0F 61 /wm */ { BxPrefixSSE, BX_IA_PUNPCKLWD_PqQd, BxOpcodeGroupSSE_0f61 },
1736 /* 0F 62 /wm */ { BxPrefixSSE, BX_IA_PUNPCKLDQ_PqQd, BxOpcodeGroupSSE_0f62 },
1737 /* 0F 63 /wm */ { BxPrefixSSE, BX_IA_PACKSSWB_PqQq, BxOpcodeGroupSSE_0f63 },
1738 /* 0F 64 /wm */ { BxPrefixSSE, BX_IA_PCMPGTB_PqQq, BxOpcodeGroupSSE_0f64 },
1739 /* 0F 65 /wm */ { BxPrefixSSE, BX_IA_PCMPGTW_PqQq, BxOpcodeGroupSSE_0f65 },
1740 /* 0F 66 /wm */ { BxPrefixSSE, BX_IA_PCMPGTD_PqQq, BxOpcodeGroupSSE_0f66 },
1741 /* 0F 67 /wm */ { BxPrefixSSE, BX_IA_PACKUSWB_PqQq, BxOpcodeGroupSSE_0f67 },
1742 /* 0F 68 /wm */ { BxPrefixSSE, BX_IA_PUNPCKHBW_PqQq, BxOpcodeGroupSSE_0f68 },
1743 /* 0F 69 /wm */ { BxPrefixSSE, BX_IA_PUNPCKHWD_PqQq, BxOpcodeGroupSSE_0f69 },
1744 /* 0F 6A /wm */ { BxPrefixSSE, BX_IA_PUNPCKHDQ_PqQq, BxOpcodeGroupSSE_0f6a },
1745 /* 0F 6B /wm */ { BxPrefixSSE, BX_IA_PACKSSDW_PqQq, BxOpcodeGroupSSE_0f6b },
1746 /* 0F 6C /wm */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0f6c },
1747 /* 0F 6D /wm */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0f6d },
1748 /* 0F 6E /wm */ { BxPrefixSSE, BX_IA_MOVD_PqEd, BxOpcodeGroupSSE_0f6e },
1749 /* 0F 6F /wm */ { BxPrefixSSE, BX_IA_MOVQ_PqQq, BxOpcodeGroupSSE_0f6f },
1750 /* 0F 70 /wm */ { BxPrefixSSE | BxImmediate_Ib, BX_IA_PSHUFW_PqQqIb, BxOpcodeGroupSSE_0f70 },
1751 /* 0F 71 /wm */ { 0, BX_IA_ERROR }, // SSE Group G12
1752 /* 0F 72 /wm */ { 0, BX_IA_ERROR }, // SSE Group G13
1753 /* 0F 73 /wm */ { 0, BX_IA_ERROR }, // SSE Group G14
1754 /* 0F 74 /wm */ { BxPrefixSSE, BX_IA_PCMPEQB_PqQq, BxOpcodeGroupSSE_0f74 },
1755 /* 0F 75 /wm */ { BxPrefixSSE, BX_IA_PCMPEQW_PqQq, BxOpcodeGroupSSE_0f75 },
1756 /* 0F 76 /wm */ { BxPrefixSSE, BX_IA_PCMPEQD_PqQq, BxOpcodeGroupSSE_0f76 },
1757 /* 0F 77 /wm */ { BxPrefixSSE, BX_IA_EMMS, BxOpcodeGroupSSE_ERR },
1758 /* 0F 78 /wm */ { 0, BX_IA_ERROR },
1759 /* 0F 79 /wm */ { 0, BX_IA_ERROR },
1760 /* 0F 7A /wm */ { 0, BX_IA_ERROR },
1761 /* 0F 7B /wm */ { 0, BX_IA_ERROR },
1762 /* 0F 7C /wm */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0f7c },
1763 /* 0F 7D /wm */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0f7d },
1764 /* 0F 7E /wm */ { BxPrefixSSE, BX_IA_MOVD_EdPd, BxOpcodeGroupSSE_0f7e },
1765 /* 0F 7F /wm */ { BxPrefixSSE, BX_IA_MOVQ_QqPq, BxOpcodeGroupSSE_0f7f },
1766 /* 0F 80 /wm */ { BxImmediate_BrOff16 | BxTraceJCC, BX_IA_JO_Jw },
1767 /* 0F 81 /wm */ { BxImmediate_BrOff16 | BxTraceJCC, BX_IA_JNO_Jw },
1768 /* 0F 82 /wm */ { BxImmediate_BrOff16 | BxTraceJCC, BX_IA_JB_Jw },
1769 /* 0F 83 /wm */ { BxImmediate_BrOff16 | BxTraceJCC, BX_IA_JNB_Jw },
1770 /* 0F 84 /wm */ { BxImmediate_BrOff16 | BxTraceJCC, BX_IA_JZ_Jw },
1771 /* 0F 85 /wm */ { BxImmediate_BrOff16 | BxTraceJCC, BX_IA_JNZ_Jw },
1772 /* 0F 86 /wm */ { BxImmediate_BrOff16 | BxTraceJCC, BX_IA_JBE_Jw },
1773 /* 0F 87 /wm */ { BxImmediate_BrOff16 | BxTraceJCC, BX_IA_JNBE_Jw },
1774 /* 0F 88 /wm */ { BxImmediate_BrOff16 | BxTraceJCC, BX_IA_JS_Jw },
1775 /* 0F 89 /wm */ { BxImmediate_BrOff16 | BxTraceJCC, BX_IA_JNS_Jw },
1776 /* 0F 8A /wm */ { BxImmediate_BrOff16 | BxTraceJCC, BX_IA_JP_Jw },
1777 /* 0F 8B /wm */ { BxImmediate_BrOff16 | BxTraceJCC, BX_IA_JNP_Jw },
1778 /* 0F 8C /wm */ { BxImmediate_BrOff16 | BxTraceJCC, BX_IA_JL_Jw },
1779 /* 0F 8D /wm */ { BxImmediate_BrOff16 | BxTraceJCC, BX_IA_JNL_Jw },
1780 /* 0F 8E /wm */ { BxImmediate_BrOff16 | BxTraceJCC, BX_IA_JLE_Jw },
1781 /* 0F 8F /wm */ { BxImmediate_BrOff16 | BxTraceJCC, BX_IA_JNLE_Jw },
1782 /* 0F 90 /wm */ { 0, BX_IA_SETO_EbM },
1783 /* 0F 91 /wm */ { 0, BX_IA_SETNO_EbM },
1784 /* 0F 92 /wm */ { 0, BX_IA_SETB_EbM },
1785 /* 0F 93 /wm */ { 0, BX_IA_SETNB_EbM },
1786 /* 0F 94 /wm */ { 0, BX_IA_SETZ_EbM },
1787 /* 0F 95 /wm */ { 0, BX_IA_SETNZ_EbM },
1788 /* 0F 96 /wm */ { 0, BX_IA_SETBE_EbM },
1789 /* 0F 97 /wm */ { 0, BX_IA_SETNBE_EbM },
1790 /* 0F 98 /wm */ { 0, BX_IA_SETS_EbM },
1791 /* 0F 99 /wm */ { 0, BX_IA_SETNS_EbM },
1792 /* 0F 9A /wm */ { 0, BX_IA_SETP_EbM },
1793 /* 0F 9B /wm */ { 0, BX_IA_SETNP_EbM },
1794 /* 0F 9C /wm */ { 0, BX_IA_SETL_EbM },
1795 /* 0F 9D /wm */ { 0, BX_IA_SETNL_EbM },
1796 /* 0F 9E /wm */ { 0, BX_IA_SETLE_EbM },
1797 /* 0F 9F /wm */ { 0, BX_IA_SETNLE_EbM },
1798 /* 0F A0 /wm */ { 0, BX_IA_PUSH16_FS },
1799 /* 0F A1 /wm */ { 0, BX_IA_POP16_FS },
1800 /* 0F A2 /wm */ { 0, BX_IA_CPUID },
1801 /* 0F A3 /wm */ { 0, BX_IA_BT_EwGwM },
1802 /* 0F A4 /wm */ { BxImmediate_Ib, BX_IA_SHLD_EwGwM },
1803 /* 0F A5 /wm */ { 0, BX_IA_SHLD_EwGwM },
1804 /* 0F A6 /wm */ { BxTraceEnd, BX_IA_CMPXCHG_XBTS }, // not implemented
1805 /* 0F A7 /wm */ { BxTraceEnd, BX_IA_CMPXCHG_IBTS }, // not implemented
1806 /* 0F A8 /wm */ { 0, BX_IA_PUSH16_GS },
1807 /* 0F A9 /wm */ { 0, BX_IA_POP16_GS },
1808 /* 0F AA /wm */ { BxTraceEnd, BX_IA_RSM },
1809 /* 0F AB /wm */ { BxLockable, BX_IA_BTS_EwGwM },
1810 /* 0F AC /wm */ { BxImmediate_Ib, BX_IA_SHRD_EwGwM },
1811 /* 0F AD /wm */ { 0, BX_IA_SHRD_EwGwM },
1812 /* 0F AE /wm */ { BxGroup15, BX_IA_ERROR, BxOpcodeInfoG15M },
1813 /* 0F AF /wm */ { 0, BX_IA_IMUL_GwEwM },
1814 /* 0F B0 /wm */ { BxLockable, BX_IA_CMPXCHG_EbGbM },
1815 /* 0F B1 /wm */ { BxLockable, BX_IA_CMPXCHG_EwGwM },
1816 /* 0F B2 /wm */ { 0, BX_IA_LSS_GwMp },
1817 /* 0F B3 /wm */ { BxLockable, BX_IA_BTR_EwGwM },
1818 /* 0F B4 /wm */ { 0, BX_IA_LFS_GwMp },
1819 /* 0F B5 /wm */ { 0, BX_IA_LGS_GwMp },
1820 /* 0F B6 /wm */ { 0, BX_IA_MOVZX_GwEbM },
1821 /* 0F B7 /wm */ { 0, BX_IA_MOV_GwEwM }, // MOVZX_GwEw
1822 /* 0F B8 /wm */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0fb8wM },
1823 /* 0F B9 /wm */ { BxTraceEnd, BX_IA_UD2B },
1824 /* 0F BA /wm */ { BxGroup8, BX_IA_ERROR, BxOpcodeInfoG8EwIbM },
1825 /* 0F BB /wm */ { BxLockable, BX_IA_BTC_EwGwM },
1826 /* 0F BC /wm */ { 0, BX_IA_BSF_GwEwM },
1827 /* 0F BD /wm */ { 0, BX_IA_BSR_GwEwM },
1828 /* 0F BE /wm */ { 0, BX_IA_MOVSX_GwEbM },
1829 /* 0F BF /wm */ { 0, BX_IA_MOV_GwEwM }, // MOVSX_GwEw
1830 /* 0F C0 /wm */ { BxLockable, BX_IA_XADD_EbGbM },
1831 /* 0F C1 /wm */ { BxLockable, BX_IA_XADD_EwGwM },
1832 /* 0F C2 /wm */ { BxPrefixSSE | BxImmediate_Ib, BX_IA_CMPPS_VpsWpsIb, BxOpcodeGroupSSE_0fc2 },
1833 /* 0F C3 /wm */ { BxPrefixSSE, BX_IA_MOVNTI_MdGd, BxOpcodeGroupSSE_ERR },
1834 /* 0F C4 /wm */ { BxPrefixSSE | BxImmediate_Ib, BX_IA_PINSRW_PqEwIb, BxOpcodeGroupSSE_0fc4 },
1835 /* 0F C5 /wm */ { 0, BX_IA_ERROR }, // PEXTRW SSE group
1836 /* 0F C6 /wm */ { BxPrefixSSE | BxImmediate_Ib, BX_IA_SHUFPS_VpsWpsIb, BxOpcodeGroupSSE_0fc6 },
1837 /* 0F C7 /wm */ { BxGroup9, BX_IA_ERROR, BxOpcodeInfoG9M },
1838 /* 0F C8 /wm */ { 0, BX_IA_BSWAP_ERX },
1839 /* 0F C9 /wm */ { 0, BX_IA_BSWAP_ERX },
1840 /* 0F CA /wm */ { 0, BX_IA_BSWAP_ERX },
1841 /* 0F CB /wm */ { 0, BX_IA_BSWAP_ERX },
1842 /* 0F CC /wm */ { 0, BX_IA_BSWAP_ERX },
1843 /* 0F CD /wm */ { 0, BX_IA_BSWAP_ERX },
1844 /* 0F CE /wm */ { 0, BX_IA_BSWAP_ERX },
1845 /* 0F CF /wm */ { 0, BX_IA_BSWAP_ERX },
1846 /* 0F D0 /wm */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0fd0 },
1847 /* 0F D1 /wm */ { BxPrefixSSE, BX_IA_PSRLW_PqQq, BxOpcodeGroupSSE_0fd1 },
1848 /* 0F D2 /wm */ { BxPrefixSSE, BX_IA_PSRLD_PqQq, BxOpcodeGroupSSE_0fd2 },
1849 /* 0F D3 /wm */ { BxPrefixSSE, BX_IA_PSRLQ_PqQq, BxOpcodeGroupSSE_0fd3 },
1850 /* 0F D4 /wm */ { BxPrefixSSE, BX_IA_PADDQ_PqQq, BxOpcodeGroupSSE_0fd4 },
1851 /* 0F D5 /wm */ { BxPrefixSSE, BX_IA_PMULLW_PqQq, BxOpcodeGroupSSE_0fd5 },
1852 /* 0F D6 /wm */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0fd6 },
1853 /* 0F D7 /wm */ { BxPrefixSSE, BX_IA_PMOVMSKB_GdPRq, BxOpcodeGroupSSE_0fd7 },
1854 /* 0F D8 /wm */ { BxPrefixSSE, BX_IA_PSUBUSB_PqQq, BxOpcodeGroupSSE_0fd8 },
1855 /* 0F D9 /wm */ { BxPrefixSSE, BX_IA_PSUBUSW_PqQq, BxOpcodeGroupSSE_0fd9 },
1856 /* 0F DA /wm */ { BxPrefixSSE, BX_IA_PMINUB_PqQq, BxOpcodeGroupSSE_0fda },
1857 /* 0F DB /wm */ { BxPrefixSSE, BX_IA_PAND_PqQq, BxOpcodeGroupSSE_0fdb },
1858 /* 0F DC /wm */ { BxPrefixSSE, BX_IA_PADDUSB_PqQq, BxOpcodeGroupSSE_0fdc },
1859 /* 0F DD /wm */ { BxPrefixSSE, BX_IA_PADDUSW_PqQq, BxOpcodeGroupSSE_0fdd },
1860 /* 0F DE /wm */ { BxPrefixSSE, BX_IA_PMAXUB_PqQq, BxOpcodeGroupSSE_0fde },
1861 /* 0F DF /wm */ { BxPrefixSSE, BX_IA_PANDN_PqQq, BxOpcodeGroupSSE_0fdf },
1862 /* 0F E0 /wm */ { BxPrefixSSE, BX_IA_PAVGB_PqQq, BxOpcodeGroupSSE_0fe0 },
1863 /* 0F E1 /wm */ { BxPrefixSSE, BX_IA_PSRAW_PqQq, BxOpcodeGroupSSE_0fe1 },
1864 /* 0F E2 /wm */ { BxPrefixSSE, BX_IA_PSRAD_PqQq, BxOpcodeGroupSSE_0fe2 },
1865 /* 0F E3 /wm */ { BxPrefixSSE, BX_IA_PAVGW_PqQq, BxOpcodeGroupSSE_0fe3 },
1866 /* 0F E4 /wm */ { BxPrefixSSE, BX_IA_PMULHUW_PqQq, BxOpcodeGroupSSE_0fe4 },
1867 /* 0F E5 /wm */ { BxPrefixSSE, BX_IA_PMULHW_PqQq, BxOpcodeGroupSSE_0fe5 },
1868 /* 0F E6 /wm */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0fe6 },
1869 /* 0F E7 /wm */ { BxPrefixSSE, BX_IA_MOVNTQ_MqPq, BxOpcodeGroupSSE_0fe7M },
1870 /* 0F E8 /wm */ { BxPrefixSSE, BX_IA_PSUBSB_PqQq, BxOpcodeGroupSSE_0fe8 },
1871 /* 0F E9 /wm */ { BxPrefixSSE, BX_IA_PSUBSW_PqQq, BxOpcodeGroupSSE_0fe9 },
1872 /* 0F EA /wm */ { BxPrefixSSE, BX_IA_PMINSW_PqQq, BxOpcodeGroupSSE_0fea },
1873 /* 0F EB /wm */ { BxPrefixSSE, BX_IA_POR_PqQq, BxOpcodeGroupSSE_0feb },
1874 /* 0F EC /wm */ { BxPrefixSSE, BX_IA_PADDSB_PqQq, BxOpcodeGroupSSE_0fec },
1875 /* 0F ED /wm */ { BxPrefixSSE, BX_IA_PADDSW_PqQq, BxOpcodeGroupSSE_0fed },
1876 /* 0F EE /wm */ { BxPrefixSSE, BX_IA_PMAXSW_PqQq, BxOpcodeGroupSSE_0fee },
1877 /* 0F EF /wm */ { BxPrefixSSE, BX_IA_PXOR_PqQq, BxOpcodeGroupSSE_0fef },
1878 /* 0F F0 /wm */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0ff0M },
1879 /* 0F F1 /wm */ { BxPrefixSSE, BX_IA_PSLLW_PqQq, BxOpcodeGroupSSE_0ff1 },
1880 /* 0F F2 /wm */ { BxPrefixSSE, BX_IA_PSLLD_PqQq, BxOpcodeGroupSSE_0ff2 },
1881 /* 0F F3 /wm */ { BxPrefixSSE, BX_IA_PSLLQ_PqQq, BxOpcodeGroupSSE_0ff3 },
1882 /* 0F F4 /wm */ { BxPrefixSSE, BX_IA_PMULUDQ_PqQq, BxOpcodeGroupSSE_0ff4 },
1883 /* 0F F5 /wm */ { BxPrefixSSE, BX_IA_PMADDWD_PqQq, BxOpcodeGroupSSE_0ff5 },
1884 /* 0F F6 /wm */ { BxPrefixSSE, BX_IA_PSADBW_PqQq, BxOpcodeGroupSSE_0ff6 },
1885 /* 0F F7 /wm */ { 0, BX_IA_ERROR }, // MASKMOV SSE group
1886 /* 0F F8 /wm */ { BxPrefixSSE, BX_IA_PSUBB_PqQq, BxOpcodeGroupSSE_0ff8 },
1887 /* 0F F9 /wm */ { BxPrefixSSE, BX_IA_PSUBW_PqQq, BxOpcodeGroupSSE_0ff9 },
1888 /* 0F FA /wm */ { BxPrefixSSE, BX_IA_PSUBD_PqQq, BxOpcodeGroupSSE_0ffa },
1889 /* 0F FB /wm */ { BxPrefixSSE, BX_IA_PSUBQ_PqQq, BxOpcodeGroupSSE_0ffb },
1890 /* 0F FC /wm */ { BxPrefixSSE, BX_IA_PADDB_PqQq, BxOpcodeGroupSSE_0ffc },
1891 /* 0F FD /wm */ { BxPrefixSSE, BX_IA_PADDW_PqQq, BxOpcodeGroupSSE_0ffd },
1892 /* 0F FE /wm */ { BxPrefixSSE, BX_IA_PADDD_PqQq, BxOpcodeGroupSSE_0ffe },
1893 /* 0F FF /wm */ { 0, BX_IA_ERROR },
1895 // 512 entries for 32bit mode
1896 /* 00 /dm */ { BxLockable, BX_IA_ADD_EbGbM },
1897 /* 01 /dm */ { BxLockable, BX_IA_ADD_EdGdM },
1898 /* 02 /dm */ { 0, BX_IA_ADD_GbEbM },
1899 /* 03 /dm */ { 0, BX_IA_ADD_GdEdM },
1900 /* 04 /dm */ { BxImmediate_Ib, BX_IA_ADD_ALIb },
1901 /* 05 /dm */ { BxImmediate_Id, BX_IA_ADD_EAXId },
1902 /* 06 /dm */ { 0, BX_IA_PUSH32_ES },
1903 /* 07 /dm */ { 0, BX_IA_POP32_ES },
1904 /* 08 /dm */ { BxLockable, BX_IA_OR_EbGbM },
1905 /* 09 /dm */ { BxLockable, BX_IA_OR_EdGdM },
1906 /* 0A /dm */ { 0, BX_IA_OR_GbEbM },
1907 /* 0B /dm */ { 0, BX_IA_OR_GdEdM },
1908 /* 0C /dm */ { BxImmediate_Ib, BX_IA_OR_ALIb },
1909 /* 0D /dm */ { BxImmediate_Id, BX_IA_OR_EAXId },
1910 /* 0E /dm */ { 0, BX_IA_PUSH32_CS },
1911 /* 0F /dm */ { 0, BX_IA_ERROR }, // 2-byte escape
1912 /* 10 /dm */ { BxLockable, BX_IA_ADC_EbGbM },
1913 /* 11 /dm */ { BxLockable, BX_IA_ADC_EdGdM },
1914 /* 12 /dm */ { 0, BX_IA_ADC_GbEbM },
1915 /* 13 /dm */ { 0, BX_IA_ADC_GdEdM },
1916 /* 14 /dm */ { BxImmediate_Ib, BX_IA_ADC_ALIb },
1917 /* 15 /dm */ { BxImmediate_Id, BX_IA_ADC_EAXId },
1918 /* 16 /dm */ { 0, BX_IA_PUSH32_SS },
1919 /* 17 /dm */ { BxTraceEnd, BX_IA_POP32_SS }, // async_event = 1
1920 /* 18 /dm */ { BxLockable, BX_IA_SBB_EbGbM },
1921 /* 19 /dm */ { BxLockable, BX_IA_SBB_EdGdM },
1922 /* 1A /dm */ { 0, BX_IA_SBB_GbEbM },
1923 /* 1B /dm */ { 0, BX_IA_SBB_GdEdM },
1924 /* 1C /dm */ { BxImmediate_Ib, BX_IA_SBB_ALIb },
1925 /* 1D /dm */ { BxImmediate_Id, BX_IA_SBB_EAXId },
1926 /* 1E /dm */ { 0, BX_IA_PUSH32_DS },
1927 /* 1F /dm */ { 0, BX_IA_POP32_DS },
1928 /* 20 /dm */ { BxLockable, BX_IA_AND_EbGbM },
1929 /* 21 /dm */ { BxLockable, BX_IA_AND_EdGdM },
1930 /* 22 /dm */ { 0, BX_IA_AND_GbEbM },
1931 /* 23 /dm */ { 0, BX_IA_AND_GdEdM },
1932 /* 24 /dm */ { BxImmediate_Ib, BX_IA_AND_ALIb },
1933 /* 25 /dm */ { BxImmediate_Id, BX_IA_AND_EAXId },
1934 /* 26 /dm */ { 0, BX_IA_ERROR }, // ES:
1935 /* 27 /dm */ { 0, BX_IA_DAA },
1936 /* 28 /dm */ { BxLockable, BX_IA_SUB_EbGbM },
1937 /* 29 /dm */ { BxLockable, BX_IA_SUB_EdGdM },
1938 /* 2A /dm */ { 0, BX_IA_SUB_GbEbM },
1939 /* 2B /dm */ { 0, BX_IA_SUB_GdEdM },
1940 /* 2C /dm */ { BxImmediate_Ib, BX_IA_SUB_ALIb },
1941 /* 2D /dm */ { BxImmediate_Id, BX_IA_SUB_EAXId },
1942 /* 2E /dm */ { 0, BX_IA_ERROR }, // CS:
1943 /* 2F /dm */ { 0, BX_IA_DAS },
1944 /* 30 /dm */ { BxLockable, BX_IA_XOR_EbGbM },
1945 /* 31 /dm */ { BxLockable, BX_IA_XOR_EdGdM },
1946 /* 32 /dm */ { 0, BX_IA_XOR_GbEbM },
1947 /* 33 /dm */ { 0, BX_IA_XOR_GdEdM },
1948 /* 34 /dm */ { BxImmediate_Ib, BX_IA_XOR_ALIb },
1949 /* 35 /dm */ { BxImmediate_Id, BX_IA_XOR_EAXId },
1950 /* 36 /dm */ { 0, BX_IA_ERROR }, // SS:
1951 /* 37 /dm */ { 0, BX_IA_AAA },
1952 /* 38 /dm */ { 0, BX_IA_CMP_EbGbM },
1953 /* 39 /dm */ { 0, BX_IA_CMP_EdGdM },
1954 /* 3A /dm */ { 0, BX_IA_CMP_GbEbM },
1955 /* 3B /dm */ { 0, BX_IA_CMP_GdEdM },
1956 /* 3C /dm */ { BxImmediate_Ib, BX_IA_CMP_ALIb },
1957 /* 3D /dm */ { BxImmediate_Id, BX_IA_CMP_EAXId },
1958 /* 3E /dm */ { 0, BX_IA_ERROR }, // DS:
1959 /* 3F /dm */ { 0, BX_IA_AAS },
1960 /* 40 /dm */ { 0, BX_IA_INC_ERX },
1961 /* 41 /dm */ { 0, BX_IA_INC_ERX },
1962 /* 42 /dm */ { 0, BX_IA_INC_ERX },
1963 /* 43 /dm */ { 0, BX_IA_INC_ERX },
1964 /* 44 /dm */ { 0, BX_IA_INC_ERX },
1965 /* 45 /dm */ { 0, BX_IA_INC_ERX },
1966 /* 46 /dm */ { 0, BX_IA_INC_ERX },
1967 /* 47 /dm */ { 0, BX_IA_INC_ERX },
1968 /* 48 /dm */ { 0, BX_IA_DEC_ERX },
1969 /* 49 /dm */ { 0, BX_IA_DEC_ERX },
1970 /* 4A /dm */ { 0, BX_IA_DEC_ERX },
1971 /* 4B /dm */ { 0, BX_IA_DEC_ERX },
1972 /* 4C /dm */ { 0, BX_IA_DEC_ERX },
1973 /* 4D /dm */ { 0, BX_IA_DEC_ERX },
1974 /* 4E /dm */ { 0, BX_IA_DEC_ERX },
1975 /* 4F /dm */ { 0, BX_IA_DEC_ERX },
1976 /* 50 /dm */ { 0, BX_IA_PUSH_ERX },
1977 /* 51 /dm */ { 0, BX_IA_PUSH_ERX },
1978 /* 52 /dm */ { 0, BX_IA_PUSH_ERX },
1979 /* 53 /dm */ { 0, BX_IA_PUSH_ERX },
1980 /* 54 /dm */ { 0, BX_IA_PUSH_ERX },
1981 /* 55 /dm */ { 0, BX_IA_PUSH_ERX },
1982 /* 56 /dm */ { 0, BX_IA_PUSH_ERX },
1983 /* 57 /dm */ { 0, BX_IA_PUSH_ERX },
1984 /* 58 /dm */ { 0, BX_IA_POP_ERX },
1985 /* 59 /dm */ { 0, BX_IA_POP_ERX },
1986 /* 5A /dm */ { 0, BX_IA_POP_ERX },
1987 /* 5B /dm */ { 0, BX_IA_POP_ERX },
1988 /* 5C /dm */ { 0, BX_IA_POP_ERX },
1989 /* 5D /dm */ { 0, BX_IA_POP_ERX },
1990 /* 5E /dm */ { 0, BX_IA_POP_ERX },
1991 /* 5F /dm */ { 0, BX_IA_POP_ERX },
1992 /* 60 /dm */ { 0, BX_IA_PUSHAD32 },
1993 /* 61 /dm */ { 0, BX_IA_POPAD32 },
1994 /* 62 /dm */ { 0, BX_IA_BOUND_GdMa },
1995 /* 63 /dm */ { 0, BX_IA_ARPL_EwGw },
1996 /* 64 /dm */ { 0, BX_IA_ERROR }, // FS:
1997 /* 65 /dm */ { 0, BX_IA_ERROR }, // GS:
1998 /* 66 /dm */ { 0, BX_IA_ERROR }, // OS:
1999 /* 67 /dm */ { 0, BX_IA_ERROR }, // AS:
2000 /* 68 /dm */ { BxImmediate_Id, BX_IA_PUSH_Id },
2001 /* 69 /dm */ { BxImmediate_Id, BX_IA_IMUL_GdEdIdM },
2002 /* 6A /dm */ { BxImmediate_Ib_SE, BX_IA_PUSH_Id },
2003 /* 6B /dm */ { BxImmediate_Ib_SE, BX_IA_IMUL_GdEdIdM },
2004 /* 6C /dm */ { 0, BX_IA_REP_INSB_YbDX },
2005 /* 6D /dm */ { 0, BX_IA_REP_INSD_YdDX },
2006 /* 6E /dm */ { 0, BX_IA_REP_OUTSB_DXXb },
2007 /* 6F /dm */ { 0, BX_IA_REP_OUTSD_DXXd },
2008 /* 70 /dm */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JO_Jd },
2009 /* 71 /dm */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JNO_Jd },
2010 /* 72 /dm */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JB_Jd },
2011 /* 73 /dm */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JNB_Jd },
2012 /* 74 /dm */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JZ_Jd },
2013 /* 75 /dm */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JNZ_Jd },
2014 /* 76 /dm */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JBE_Jd },
2015 /* 77 /dm */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JNBE_Jd },
2016 /* 78 /dm */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JS_Jd },
2017 /* 79 /dm */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JNS_Jd },
2018 /* 7A /dm */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JP_Jd },
2019 /* 7B /dm */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JNP_Jd },
2020 /* 7C /dm */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JL_Jd },
2021 /* 7D /dm */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JNL_Jd },
2022 /* 7E /dm */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JLE_Jd },
2023 /* 7F /dm */ { BxImmediate_BrOff8 | BxTraceJCC, BX_IA_JNLE_Jd },
2024 /* 80 /dm */ { BxGroup1 | BxImmediate_Ib, BX_IA_ERROR, BxOpcodeInfoG1EbIbM },
2025 /* 81 /dm */ { BxGroup1 | BxImmediate_Id, BX_IA_ERROR, BxOpcodeInfoG1EdM },
2026 /* 82 /dm */ { BxGroup1 | BxImmediate_Ib, BX_IA_ERROR, BxOpcodeInfoG1EbIbM },
2027 /* 83 /dm */ { BxGroup1 | BxImmediate_Ib_SE, BX_IA_ERROR, BxOpcodeInfoG1EdM },
2028 /* 84 /dm */ { 0, BX_IA_TEST_EbGbM },
2029 /* 85 /dm */ { 0, BX_IA_TEST_EdGdM },
2030 /* 86 /dm */ { BxLockable, BX_IA_XCHG_EbGbM },
2031 /* 87 /dm */ { BxLockable, BX_IA_XCHG_EdGdM },
2032 /* 88 /dm */ { 0, BX_IA_MOV_EbGbM },
2033 /* 89 /dm */ { 0, BX_IA_MOV_EdGdM },
2034 /* 8A /dm */ { 0, BX_IA_MOV_GbEbM },
2035 /* 8B /dm */ { 0, BX_IA_MOV32_GdEdM },
2036 /* 8C /dm */ { 0, BX_IA_MOV_EwSwM },
2037 /* 8D /dm */ { 0, BX_IA_LEA_GdM },
2038 /* 8E /dm */ { 0, BX_IA_MOV_SwEw },
2039 /* 8F /dm */ { BxGroup1A, BX_IA_ERROR, BxOpcodeInfoG1AEdM },
2040 /* 90 /dm */ { 0, BX_IA_NOP },
2041 /* 91 /dm */ { 0, BX_IA_XCHG_ERXEAX },
2042 /* 92 /dm */ { 0, BX_IA_XCHG_ERXEAX },
2043 /* 93 /dm */ { 0, BX_IA_XCHG_ERXEAX },
2044 /* 94 /dm */ { 0, BX_IA_XCHG_ERXEAX },
2045 /* 95 /dm */ { 0, BX_IA_XCHG_ERXEAX },
2046 /* 96 /dm */ { 0, BX_IA_XCHG_ERXEAX },
2047 /* 97 /dm */ { 0, BX_IA_XCHG_ERXEAX },
2048 /* 98 /dm */ { 0, BX_IA_CWDE },
2049 /* 99 /dm */ { 0, BX_IA_CDQ },
2050 /* 9A /dm */ { BxImmediate_IdIw | BxTraceEnd, BX_IA_CALL32_Ap },
2051 /* 9B /dm */ { 0, BX_IA_FWAIT },
2052 /* 9C /dm */ { 0, BX_IA_PUSHF_Fd },
2053 /* 9D /dm */ { 0, BX_IA_POPF_Fd },
2054 /* 9E /dm */ { 0, BX_IA_SAHF },
2055 /* 9F /dm */ { 0, BX_IA_LAHF },
2056 /* A0 /dm */ { BxImmediate_O, BX_IA_MOV_ALOd },
2057 /* A1 /dm */ { BxImmediate_O, BX_IA_MOV_EAXOd },
2058 /* A2 /dm */ { BxImmediate_O, BX_IA_MOV_OdAL },
2059 /* A3 /dm */ { BxImmediate_O, BX_IA_MOV_OdEAX },
2060 /* A4 /dm */ { 0, BX_IA_REP_MOVSB_XbYb },
2061 /* A5 /dm */ { 0, BX_IA_REP_MOVSD_XdYd },
2062 /* A6 /dm */ { 0, BX_IA_REP_CMPSB_XbYb },
2063 /* A7 /dm */ { 0, BX_IA_REP_CMPSD_XdYd },
2064 /* A8 /dm */ { BxImmediate_Ib, BX_IA_TEST_ALIb },
2065 /* A9 /dm */ { BxImmediate_Id, BX_IA_TEST_EAXId },
2066 /* AA /dm */ { 0, BX_IA_REP_STOSB_YbAL },
2067 /* AB /dm */ { 0, BX_IA_REP_STOSD_YdEAX },
2068 /* AC /dm */ { 0, BX_IA_REP_LODSB_ALXb },
2069 /* AD /dm */ { 0, BX_IA_REP_LODSD_EAXXd },
2070 /* AE /dm */ { 0, BX_IA_REP_SCASB_ALXb },
2071 /* AF /dm */ { 0, BX_IA_REP_SCASD_EAXXd },
2072 /* B0 /dm */ { BxImmediate_Ib, BX_IA_MOV_RLIb },
2073 /* B1 /dm */ { BxImmediate_Ib, BX_IA_MOV_RLIb },
2074 /* B2 /dm */ { BxImmediate_Ib, BX_IA_MOV_RLIb },
2075 /* B3 /dm */ { BxImmediate_Ib, BX_IA_MOV_RLIb },
2076 /* B4 /dm */ { BxImmediate_Ib, BX_IA_MOV_RHIb },
2077 /* B5 /dm */ { BxImmediate_Ib, BX_IA_MOV_RHIb },
2078 /* B6 /dm */ { BxImmediate_Ib, BX_IA_MOV_RHIb },
2079 /* B7 /dm */ { BxImmediate_Ib, BX_IA_MOV_RHIb },
2080 /* B8 /dm */ { BxImmediate_Id, BX_IA_MOV_ERXId },
2081 /* B9 /dm */ { BxImmediate_Id, BX_IA_MOV_ERXId },
2082 /* BA /dm */ { BxImmediate_Id, BX_IA_MOV_ERXId },
2083 /* BB /dm */ { BxImmediate_Id, BX_IA_MOV_ERXId },
2084 /* BC /dm */ { BxImmediate_Id, BX_IA_MOV_ERXId },
2085 /* BD /dm */ { BxImmediate_Id, BX_IA_MOV_ERXId },
2086 /* BE /dm */ { BxImmediate_Id, BX_IA_MOV_ERXId },
2087 /* BF /dm */ { BxImmediate_Id, BX_IA_MOV_ERXId },
2088 /* C0 /dm */ { BxGroup2 | BxImmediate_Ib, BX_IA_ERROR, BxOpcodeInfoG2Eb },
2089 /* C1 /dm */ { BxGroup2 | BxImmediate_Ib, BX_IA_ERROR, BxOpcodeInfoG2EdM },
2090 /* C2 /dm */ { BxImmediate_Iw | BxTraceEnd, BX_IA_RETnear32_Iw },
2091 /* C3 /dm */ { BxTraceEnd, BX_IA_RETnear32 },
2092 /* C4 /dm */ { 0, BX_IA_LES_GdMp },
2093 /* C5 /dm */ { 0, BX_IA_LDS_GdMp },
2094 /* C6 /dm */ { BxGroup11, BX_IA_ERROR, BxOpcodeInfoG11EbM },
2095 /* C7 /dm */ { BxGroup11, BX_IA_ERROR, BxOpcodeInfoG11EdM },
2096 /* C8 /dm */ { BxImmediate_IwIb, BX_IA_ENTER32_IwIb },
2097 /* C9 /dm */ { 0, BX_IA_LEAVE32 },
2098 /* CA /dm */ { BxImmediate_Iw | BxTraceEnd, BX_IA_RETfar32_Iw },
2099 /* CB /dm */ { BxTraceEnd, BX_IA_RETfar32 },
2100 /* CC /dm */ { BxTraceEnd, BX_IA_INT3 },
2101 /* CD /dm */ { BxImmediate_Ib | BxTraceEnd, BX_IA_INT_Ib },
2102 /* CE /dm */ { BxTraceEnd, BX_IA_INTO },
2103 /* CF /dm */ { BxTraceEnd, BX_IA_IRET32 },
2104 /* D0 /dm */ { BxGroup2 | BxImmediate_I1, BX_IA_ERROR, BxOpcodeInfoG2Eb },
2105 /* D1 /dm */ { BxGroup2 | BxImmediate_I1, BX_IA_ERROR, BxOpcodeInfoG2EdM },
2106 /* D2 /dm */ { BxGroup2, BX_IA_ERROR, BxOpcodeInfoG2Eb },
2107 /* D3 /dm */ { BxGroup2, BX_IA_ERROR, BxOpcodeInfoG2EdM },
2108 /* D4 /dm */ { BxImmediate_Ib, BX_IA_AAM },
2109 /* D5 /dm */ { BxImmediate_Ib, BX_IA_AAD },
2110 /* D6 /dm */ { 0, BX_IA_SALC },
2111 /* D7 /dm */ { 0, BX_IA_XLAT },
2112 #if BX_SUPPORT_FPU
2113 /* D8 /dm */ { BxGroupFP, BX_IA_ERROR, BxOpcodeInfo_FPGroupD8 },
2114 /* D9 /dm */ { BxGroupFP, BX_IA_ERROR, BxOpcodeInfo_FPGroupD9 },
2115 /* DA /dm */ { BxGroupFP, BX_IA_ERROR, BxOpcodeInfo_FPGroupDA },
2116 /* DB /dm */ { BxGroupFP, BX_IA_ERROR, BxOpcodeInfo_FPGroupDB },
2117 /* DC /dm */ { BxGroupFP, BX_IA_ERROR, BxOpcodeInfo_FPGroupDC },
2118 /* DD /dm */ { BxGroupFP, BX_IA_ERROR, BxOpcodeInfo_FPGroupDD },
2119 /* DE /dm */ { BxGroupFP, BX_IA_ERROR, BxOpcodeInfo_FPGroupDE },
2120 /* DF /dm */ { BxGroupFP, BX_IA_ERROR, BxOpcodeInfo_FPGroupDF },
2121 #else
2122 /* D8 /dm */ { 0, BX_IA_FPU_ESC },
2123 /* D9 /dm */ { 0, BX_IA_FPU_ESC },
2124 /* DA /dm */ { 0, BX_IA_FPU_ESC },
2125 /* DB /dm */ { 0, BX_IA_FPU_ESC },
2126 /* DC /dm */ { 0, BX_IA_FPU_ESC },
2127 /* DD /dm */ { 0, BX_IA_FPU_ESC },
2128 /* DE /dm */ { 0, BX_IA_FPU_ESC },
2129 /* DF /dm */ { 0, BX_IA_FPU_ESC },
2130 #endif
2131 /* E0 /dm */ { BxImmediate_BrOff8 | BxTraceEnd, BX_IA_LOOPNE32_Jb },
2132 /* E1 /dm */ { BxImmediate_BrOff8 | BxTraceEnd, BX_IA_LOOPE32_Jb },
2133 /* E2 /dm */ { BxImmediate_BrOff8 | BxTraceEnd, BX_IA_LOOP32_Jb },
2134 /* E3 /dm */ { BxImmediate_BrOff8 | BxTraceEnd, BX_IA_JECXZ_Jb },
2135 /* E4 /dm */ { BxImmediate_Ib, BX_IA_IN_ALIb },
2136 /* E5 /dm */ { BxImmediate_Ib, BX_IA_IN_EAXIb },
2137 /* E6 /dm */ { BxImmediate_Ib, BX_IA_OUT_IbAL },
2138 /* E7 /dm */ { BxImmediate_Ib, BX_IA_OUT_IbEAX },
2139 /* E8 /dm */ { BxImmediate_BrOff32 | BxTraceEnd, BX_IA_CALL_Jd },
2140 /* E9 /dm */ { BxImmediate_BrOff32 | BxTraceEnd, BX_IA_JMP_Jd },
2141 /* EA /dm */ { BxImmediate_IdIw | BxTraceEnd, BX_IA_JMP_Ap },
2142 /* EB /dm */ { BxImmediate_BrOff8 | BxTraceEnd, BX_IA_JMP_Jd },
2143 /* EC /dm */ { 0, BX_IA_IN_ALDX },
2144 /* ED /dm */ { 0, BX_IA_IN_EAXDX },
2145 /* EE /dm */ { 0, BX_IA_OUT_DXAL },
2146 /* EF /dm */ { 0, BX_IA_OUT_DXEAX },
2147 /* F0 /dm */ { 0, BX_IA_ERROR }, // LOCK:
2148 /* F1 /dm */ { BxTraceEnd, BX_IA_INT1 },
2149 /* F2 /dm */ { 0, BX_IA_ERROR }, // REPNE/REPNZ
2150 /* F3 /dm */ { 0, BX_IA_ERROR }, // REP,REPE/REPZ
2151 /* F4 /dm */ { BxTraceEnd, BX_IA_HLT },
2152 /* F5 /dm */ { 0, BX_IA_CMC },
2153 /* F6 /dm */ { BxGroup3, BX_IA_ERROR, BxOpcodeInfoG3EbM },
2154 /* F7 /dm */ { BxGroup3, BX_IA_ERROR, BxOpcodeInfoG3EdM },
2155 /* F8 /dm */ { 0, BX_IA_CLC },
2156 /* F9 /dm */ { 0, BX_IA_STC },
2157 /* FA /dm */ { 0, BX_IA_CLI },
2158 /* FB /dm */ { 0, BX_IA_STI },
2159 /* FC /dm */ { 0, BX_IA_CLD },
2160 /* FD /dm */ { 0, BX_IA_STD },
2161 /* FE /dm */ { BxGroup4, BX_IA_ERROR, BxOpcodeInfoG4M },
2162 /* FF /dm */ { BxGroup5, BX_IA_ERROR, BxOpcodeInfoG5dM },
2164 /* 0F 00 /dm */ { BxGroup6, BX_IA_ERROR, BxOpcodeInfoG6 },
2165 /* 0F 01 /dm */ { BxGroup7, BX_IA_ERROR, BxOpcodeInfoG7M },
2166 /* 0F 02 /dm */ { 0, BX_IA_LAR_GvEw },
2167 /* 0F 03 /dm */ { 0, BX_IA_LSL_GvEw },
2168 /* 0F 04 /dm */ { 0, BX_IA_ERROR },
2169 #if BX_SUPPORT_X86_64
2170 /* 0F 05 /dm */ { BxTraceEnd, BX_IA_SYSCALL },
2171 #elif BX_CPU_LEVEL == 2
2172 /* 0F 05 /dm */ { BxTraceEnd, BX_IA_LOADALL },
2173 #else
2174 /* 0F 05 /dm */ { 0, BX_IA_ERROR },
2175 #endif
2176 /* 0F 06 /dm */ { 0, BX_IA_CLTS },
2177 #if BX_SUPPORT_X86_64
2178 /* 0F 07 /dm */ { BxTraceEnd, BX_IA_SYSRET },
2179 #else
2180 /* 0F 07 /dm */ { 0, BX_IA_ERROR },
2181 #endif
2182 /* 0F 08 /dm */ { BxTraceEnd, BX_IA_INVD },
2183 /* 0F 09 /dm */ { BxTraceEnd, BX_IA_WBINVD },
2184 /* 0F 0A /dm */ { 0, BX_IA_ERROR },
2185 /* 0F 0B /dm */ { BxTraceEnd, BX_IA_UD2A },
2186 /* 0F 0C /dm */ { 0, BX_IA_ERROR },
2187 #if BX_SUPPORT_X86_64 || BX_SUPPORT_3DNOW
2188 /* 0F 0D /dm */ { 0, BX_IA_NOP }, // 3DNow! PREFETCH on AMD, NOP on Intel
2189 #else
2190 /* 0F 0D /dm */ { 0, BX_IA_ERROR },
2191 #endif
2192 /* 0F 0E /dm */ { 0, BX_IA_FEMMS }, // 3DNow! FEMMS
2193 #if BX_SUPPORT_3DNOW
2194 /* 0F 0F /dm */ { BxImmediate_Ib, BX_IA_ERROR, Bx3DNowOpcodeInfo },
2195 #else
2196 /* 0F 0F /dm */ { 0, BX_IA_ERROR },
2197 #endif
2198 /* 0F 10 /dm */ { BxPrefixSSE, BX_IA_MOVUPS_VpsWps, BxOpcodeGroupSSE_0f10 },
2199 /* 0F 11 /dm */ { BxPrefixSSE, BX_IA_MOVUPS_WpsVps, BxOpcodeGroupSSE_0f11 },
2200 /* 0F 12 /dm */ { BxPrefixSSE, BX_IA_MOVLPS_VpsMq, BxOpcodeGroupSSE_0f12 },
2201 /* 0F 13 /dm */ { BxPrefixSSE, BX_IA_MOVLPS_MqVps, BxOpcodeGroupSSE_0f13M },
2202 /* 0F 14 /dm */ { BxPrefixSSE, BX_IA_UNPCKLPS_VpsWdq, BxOpcodeGroupSSE_0f14 },
2203 /* 0F 15 /dm */ { BxPrefixSSE, BX_IA_UNPCKHPS_VpsWdq, BxOpcodeGroupSSE_0f15 },
2204 /* 0F 16 /dm */ { BxPrefixSSE, BX_IA_MOVHPS_VpsMq, BxOpcodeGroupSSE_0f16 },
2205 /* 0F 17 /dm */ { BxPrefixSSE, BX_IA_MOVHPS_MqVps, BxOpcodeGroupSSE_0f17M },
2206 # if BX_CPU_LEVEL >= 6
2207 /* 0F 18 /dm */ { 0, BX_IA_PREFETCH }, // opcode group G16, PREFETCH hints
2208 /* 0F 19 /dm */ { 0, BX_IA_NOP }, // multi-byte NOP
2209 /* 0F 1A /dm */ { 0, BX_IA_NOP }, // multi-byte NOP
2210 /* 0F 1B /dm */ { 0, BX_IA_NOP }, // multi-byte NOP
2211 /* 0F 1C /dm */ { 0, BX_IA_NOP }, // multi-byte NOP
2212 /* 0F 1D /dm */ { 0, BX_IA_NOP }, // multi-byte NOP
2213 /* 0F 1E /dm */ { 0, BX_IA_NOP }, // multi-byte NOP
2214 /* 0F 1F /dm */ { 0, BX_IA_NOP }, // multi-byte NOP
2215 #else
2216 /* 0F 18 /dm */ { 0, BX_IA_ERROR },
2217 /* 0F 19 /dm */ { 0, BX_IA_ERROR },
2218 /* 0F 1A /dm */ { 0, BX_IA_ERROR },
2219 /* 0F 1B /dm */ { 0, BX_IA_ERROR },
2220 /* 0F 1C /dm */ { 0, BX_IA_ERROR },
2221 /* 0F 1D /dm */ { 0, BX_IA_ERROR },
2222 /* 0F 1E /dm */ { 0, BX_IA_ERROR },
2223 /* 0F 1F /dm */ { 0, BX_IA_ERROR },
2224 #endif
2225 /* 0F 20 /dm */ { 0, BX_IA_MOV_RdCd },
2226 /* 0F 21 /dm */ { 0, BX_IA_MOV_RdDd },
2227 /* 0F 22 /dm */ { BxTraceEnd, BX_IA_MOV_CdRd },
2228 /* 0F 23 /dm */ { BxTraceEnd, BX_IA_MOV_DdRd },
2229 /* 0F 24 /dm */ { BxTraceEnd, BX_IA_MOV_RdTd }, // not implemented
2230 /* 0F 25 /dm */ { 0, BX_IA_ERROR },
2231 /* 0F 26 /dm */ { BxTraceEnd, BX_IA_MOV_TdRd }, // not implemented
2232 /* 0F 27 /dm */ { 0, BX_IA_ERROR },
2233 /* 0F 28 /dm */ { BxPrefixSSE, BX_IA_MOVAPS_VpsWps, BxOpcodeGroupSSE_0f28 },
2234 /* 0F 29 /dm */ { BxPrefixSSE, BX_IA_MOVAPS_WpsVps, BxOpcodeGroupSSE_0f29 },
2235 /* 0F 2A /dm */ { BxPrefixSSE, BX_IA_CVTPI2PS_VpsQq, BxOpcodeGroupSSE_0f2a },
2236 /* 0F 2B /dm */ { BxPrefixSSE, BX_IA_MOVNTPS_MpsVps, BxOpcodeGroupSSE_0f2bM },
2237 /* 0F 2C /dm */ { BxPrefixSSE, BX_IA_CVTTPS2PI_PqWps, BxOpcodeGroupSSE_0f2c },
2238 /* 0F 2D /dm */ { BxPrefixSSE, BX_IA_CVTPS2PI_PqWps, BxOpcodeGroupSSE_0f2d },
2239 /* 0F 2E /dm */ { BxPrefixSSE, BX_IA_UCOMISS_VssWss, BxOpcodeGroupSSE_0f2e },
2240 /* 0F 2F /dm */ { BxPrefixSSE, BX_IA_COMISS_VpsWps, BxOpcodeGroupSSE_0f2f },
2241 /* 0F 30 /dm */ { 0, BX_IA_WRMSR },
2242 /* 0F 31 /dm */ { 0, BX_IA_RDTSC },
2243 /* 0F 32 /dm */ { 0, BX_IA_RDMSR },
2244 /* 0F 33 /dm */ { 0, BX_IA_RDPMC },
2245 /* 0F 34 /dm */ { BxTraceEnd, BX_IA_SYSENTER },
2246 /* 0F 35 /dm */ { BxTraceEnd, BX_IA_SYSEXIT },
2247 /* 0F 36 /dm */ { 0, BX_IA_ERROR },
2248 /* 0F 37 /dm */ { 0, BX_IA_ERROR },
2249 #if (BX_SUPPORT_SSE >= 4) || (BX_SUPPORT_SSE >= 3 && BX_SUPPORT_SSE_EXTENSION > 0)
2250 /* 0F 38 /dm */ { Bx3ByteOp, BX_IA_ERROR, BxOpcode3ByteTable0f38 }, // 3-byte escape
2251 #else
2252 /* 0F 38 /dm */ { 0, BX_IA_ERROR },
2253 #endif
2254 /* 0F 39 /dm */ { 0, BX_IA_ERROR },
2255 #if (BX_SUPPORT_SSE >= 4) || (BX_SUPPORT_SSE >= 3 && BX_SUPPORT_SSE_EXTENSION > 0)
2256 /* 0F 3A /dm */ { Bx3ByteOp, BX_IA_ERROR, BxOpcode3ByteTable0f3a }, // 3-byte escape
2257 #else
2258 /* 0F 3A /dm */ { 0, BX_IA_ERROR },
2259 #endif
2260 /* 0F 3B /dm */ { 0, BX_IA_ERROR },
2261 /* 0F 3C /dm */ { 0, BX_IA_ERROR },
2262 /* 0F 3D /dm */ { 0, BX_IA_ERROR },
2263 /* 0F 3E /dm */ { 0, BX_IA_ERROR },
2264 /* 0F 3F /dm */ { 0, BX_IA_ERROR },
2265 /* 0F 40 /dm */ { 0, BX_IA_CMOVO_GdEdM },
2266 /* 0F 41 /dm */ { 0, BX_IA_CMOVNO_GdEdM },
2267 /* 0F 42 /dm */ { 0, BX_IA_CMOVB_GdEdM },
2268 /* 0F 43 /dm */ { 0, BX_IA_CMOVNB_GdEdM },
2269 /* 0F 44 /dm */ { 0, BX_IA_CMOVZ_GdEdM },
2270 /* 0F 45 /dm */ { 0, BX_IA_CMOVNZ_GdEdM },
2271 /* 0F 46 /dm */ { 0, BX_IA_CMOVBE_GdEdM },
2272 /* 0F 47 /dm */ { 0, BX_IA_CMOVNBE_GdEdM },
2273 /* 0F 48 /dm */ { 0, BX_IA_CMOVS_GdEdM },
2274 /* 0F 49 /dm */ { 0, BX_IA_CMOVNS_GdEdM },
2275 /* 0F 4A /dm */ { 0, BX_IA_CMOVP_GdEdM },
2276 /* 0F 4B /dm */ { 0, BX_IA_CMOVNP_GdEdM },
2277 /* 0F 4C /dm */ { 0, BX_IA_CMOVL_GdEdM },
2278 /* 0F 4D /dm */ { 0, BX_IA_CMOVNL_GdEdM },
2279 /* 0F 4E /dm */ { 0, BX_IA_CMOVLE_GdEdM },
2280 /* 0F 4F /dm */ { 0, BX_IA_CMOVNLE_GdEdM },
2281 /* 0F 50 /dm */ { BxPrefixSSE, BX_IA_MOVMSKPS_GdVRps, BxOpcodeGroupSSE_0f50 },
2282 /* 0F 51 /dm */ { BxPrefixSSE, BX_IA_SQRTPS_VpsWps, BxOpcodeGroupSSE_0f51 },
2283 /* 0F 52 /dm */ { BxPrefixSSE, BX_IA_RSQRTPS_VpsWps, BxOpcodeGroupSSE_0f52 },
2284 /* 0F 53 /dm */ { BxPrefixSSE, BX_IA_RCPPS_VpsWps, BxOpcodeGroupSSE_0f53 },
2285 /* 0F 54 /dm */ { BxPrefixSSE, BX_IA_ANDPS_VpsWps, BxOpcodeGroupSSE_0f54 },
2286 /* 0F 55 /dm */ { BxPrefixSSE, BX_IA_ANDNPS_VpsWps, BxOpcodeGroupSSE_0f55 },
2287 /* 0F 56 /dm */ { BxPrefixSSE, BX_IA_ORPS_VpsWps, BxOpcodeGroupSSE_0f56 },
2288 /* 0F 57 /dm */ { BxPrefixSSE, BX_IA_XORPS_VpsWps, BxOpcodeGroupSSE_0f57 },
2289 /* 0F 58 /dm */ { BxPrefixSSE, BX_IA_ADDPS_VpsWps, BxOpcodeGroupSSE_0f58 },
2290 /* 0F 59 /dm */ { BxPrefixSSE, BX_IA_MULPS_VpsWps, BxOpcodeGroupSSE_0f59 },
2291 /* 0F 5A /dm */ { BxPrefixSSE, BX_IA_CVTPS2PD_VpsWps, BxOpcodeGroupSSE_0f5a },
2292 /* 0F 5B /dm */ { BxPrefixSSE, BX_IA_CVTDQ2PS_VpsWdq, BxOpcodeGroupSSE_0f5b },
2293 /* 0F 5C /dm */ { BxPrefixSSE, BX_IA_SUBPS_VpsWps, BxOpcodeGroupSSE_0f5c },
2294 /* 0F 5D /dm */ { BxPrefixSSE, BX_IA_MINPS_VpsWps, BxOpcodeGroupSSE_0f5d },
2295 /* 0F 5E /dm */ { BxPrefixSSE, BX_IA_DIVPS_VpsWps, BxOpcodeGroupSSE_0f5e },
2296 /* 0F 5F /dm */ { BxPrefixSSE, BX_IA_MAXPS_VpsWps, BxOpcodeGroupSSE_0f5f },
2297 /* 0F 60 /dm */ { BxPrefixSSE, BX_IA_PUNPCKLBW_PqQd, BxOpcodeGroupSSE_0f60 },
2298 /* 0F 61 /dm */ { BxPrefixSSE, BX_IA_PUNPCKLWD_PqQd, BxOpcodeGroupSSE_0f61 },
2299 /* 0F 62 /dm */ { BxPrefixSSE, BX_IA_PUNPCKLDQ_PqQd, BxOpcodeGroupSSE_0f62 },
2300 /* 0F 63 /dm */ { BxPrefixSSE, BX_IA_PACKSSWB_PqQq, BxOpcodeGroupSSE_0f63 },
2301 /* 0F 64 /dm */ { BxPrefixSSE, BX_IA_PCMPGTB_PqQq, BxOpcodeGroupSSE_0f64 },
2302 /* 0F 65 /dm */ { BxPrefixSSE, BX_IA_PCMPGTW_PqQq, BxOpcodeGroupSSE_0f65 },
2303 /* 0F 66 /dm */ { BxPrefixSSE, BX_IA_PCMPGTD_PqQq, BxOpcodeGroupSSE_0f66 },
2304 /* 0F 67 /dm */ { BxPrefixSSE, BX_IA_PACKUSWB_PqQq, BxOpcodeGroupSSE_0f67 },
2305 /* 0F 68 /dm */ { BxPrefixSSE, BX_IA_PUNPCKHBW_PqQq, BxOpcodeGroupSSE_0f68 },
2306 /* 0F 69 /dm */ { BxPrefixSSE, BX_IA_PUNPCKHWD_PqQq, BxOpcodeGroupSSE_0f69 },
2307 /* 0F 6A /dm */ { BxPrefixSSE, BX_IA_PUNPCKHDQ_PqQq, BxOpcodeGroupSSE_0f6a },
2308 /* 0F 6B /dm */ { BxPrefixSSE, BX_IA_PACKSSDW_PqQq, BxOpcodeGroupSSE_0f6b },
2309 /* 0F 6C /dm */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0f6c },
2310 /* 0F 6D /dm */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0f6d },
2311 /* 0F 6E /dm */ { BxPrefixSSE, BX_IA_MOVD_PqEd, BxOpcodeGroupSSE_0f6e },
2312 /* 0F 6F /dm */ { BxPrefixSSE, BX_IA_MOVQ_PqQq, BxOpcodeGroupSSE_0f6f },
2313 /* 0F 70 /dm */ { BxPrefixSSE | BxImmediate_Ib, BX_IA_PSHUFW_PqQqIb, BxOpcodeGroupSSE_0f70 },
2314 /* 0F 71 /dm */ { 0, BX_IA_ERROR }, // SSE Group G12
2315 /* 0F 72 /dm */ { 0, BX_IA_ERROR }, // SSE Group G13
2316 /* 0F 73 /dm */ { 0, BX_IA_ERROR }, // SSE Group G14
2317 /* 0F 74 /dm */ { BxPrefixSSE, BX_IA_PCMPEQB_PqQq, BxOpcodeGroupSSE_0f74 },
2318 /* 0F 75 /dm */ { BxPrefixSSE, BX_IA_PCMPEQW_PqQq, BxOpcodeGroupSSE_0f75 },
2319 /* 0F 76 /dm */ { BxPrefixSSE, BX_IA_PCMPEQD_PqQq, BxOpcodeGroupSSE_0f76 },
2320 /* 0F 77 /dm */ { BxPrefixSSE, BX_IA_EMMS, BxOpcodeGroupSSE_ERR },
2321 /* 0F 78 /dm */ { 0, BX_IA_ERROR },
2322 /* 0F 79 /dm */ { 0, BX_IA_ERROR },
2323 /* 0F 7A /dm */ { 0, BX_IA_ERROR },
2324 /* 0F 7B /dm */ { 0, BX_IA_ERROR },
2325 /* 0F 7C /dm */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0f7c },
2326 /* 0F 7D /dm */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0f7d },
2327 /* 0F 7E /dm */ { BxPrefixSSE, BX_IA_MOVD_EdPd, BxOpcodeGroupSSE_0f7e },
2328 /* 0F 7F /dm */ { BxPrefixSSE, BX_IA_MOVQ_QqPq, BxOpcodeGroupSSE_0f7f },
2329 /* 0F 80 /dm */ { BxImmediate_BrOff32 | BxTraceJCC, BX_IA_JO_Jd },
2330 /* 0F 81 /dm */ { BxImmediate_BrOff32 | BxTraceJCC, BX_IA_JNO_Jd },
2331 /* 0F 82 /dm */ { BxImmediate_BrOff32 | BxTraceJCC, BX_IA_JB_Jd },
2332 /* 0F 83 /dm */ { BxImmediate_BrOff32 | BxTraceJCC, BX_IA_JNB_Jd },
2333 /* 0F 84 /dm */ { BxImmediate_BrOff32 | BxTraceJCC, BX_IA_JZ_Jd },
2334 /* 0F 85 /dm */ { BxImmediate_BrOff32 | BxTraceJCC, BX_IA_JNZ_Jd },
2335 /* 0F 86 /dm */ { BxImmediate_BrOff32 | BxTraceJCC, BX_IA_JBE_Jd },
2336 /* 0F 87 /dm */ { BxImmediate_BrOff32 | BxTraceJCC, BX_IA_JNBE_Jd },
2337 /* 0F 88 /dm */ { BxImmediate_BrOff32 | BxTraceJCC, BX_IA_JS_Jd },
2338 /* 0F 89 /dm */ { BxImmediate_BrOff32 | BxTraceJCC, BX_IA_JNS_Jd },
2339 /* 0F 8A /dm */ { BxImmediate_BrOff32 | BxTraceJCC, BX_IA_JP_Jd },
2340 /* 0F 8B /dm */ { BxImmediate_BrOff32 | BxTraceJCC, BX_IA_JNP_Jd },
2341 /* 0F 8C /dm */ { BxImmediate_BrOff32 | BxTraceJCC, BX_IA_JL_Jd },
2342 /* 0F 8D /dm */ { BxImmediate_BrOff32 | BxTraceJCC, BX_IA_JNL_Jd },
2343 /* 0F 8E /dm */ { BxImmediate_BrOff32 | BxTraceJCC, BX_IA_JLE_Jd },
2344 /* 0F 8F /dm */ { BxImmediate_BrOff32 | BxTraceJCC, BX_IA_JNLE_Jd },
2345 /* 0F 90 /dm */ { 0, BX_IA_SETO_EbM },
2346 /* 0F 91 /dm */ { 0, BX_IA_SETNO_EbM },
2347 /* 0F 92 /dm */ { 0, BX_IA_SETB_EbM },
2348 /* 0F 93 /dm */ { 0, BX_IA_SETNB_EbM },
2349 /* 0F 94 /dm */ { 0, BX_IA_SETZ_EbM },
2350 /* 0F 95 /dm */ { 0, BX_IA_SETNZ_EbM },
2351 /* 0F 96 /dm */ { 0, BX_IA_SETBE_EbM },
2352 /* 0F 97 /dm */ { 0, BX_IA_SETNBE_EbM },
2353 /* 0F 98 /dm */ { 0, BX_IA_SETS_EbM },
2354 /* 0F 99 /dm */ { 0, BX_IA_SETNS_EbM },
2355 /* 0F 9A /dm */ { 0, BX_IA_SETP_EbM },
2356 /* 0F 9B /dm */ { 0, BX_IA_SETNP_EbM },
2357 /* 0F 9C /dm */ { 0, BX_IA_SETL_EbM },
2358 /* 0F 9D /dm */ { 0, BX_IA_SETNL_EbM },
2359 /* 0F 9E /dm */ { 0, BX_IA_SETLE_EbM },
2360 /* 0F 9F /dm */ { 0, BX_IA_SETNLE_EbM },
2361 /* 0F A0 /dm */ { 0, BX_IA_PUSH32_FS },
2362 /* 0F A1 /dm */ { 0, BX_IA_POP32_FS },
2363 /* 0F A2 /dm */ { 0, BX_IA_CPUID },
2364 /* 0F A3 /dm */ { 0, BX_IA_BT_EdGdM },
2365 /* 0F A4 /dm */ { BxImmediate_Ib, BX_IA_SHLD_EdGdM },
2366 /* 0F A5 /dm */ { 0, BX_IA_SHLD_EdGdM },
2367 /* 0F A6 /dm */ { BxTraceEnd, BX_IA_CMPXCHG_XBTS }, // not implemented
2368 /* 0F A7 /dm */ { BxTraceEnd, BX_IA_CMPXCHG_IBTS }, // not implemented
2369 /* 0F A8 /dm */ { 0, BX_IA_PUSH32_GS },
2370 /* 0F A9 /dm */ { 0, BX_IA_POP32_GS },
2371 /* 0F AA /dm */ { BxTraceEnd, BX_IA_RSM },
2372 /* 0F AB /dm */ { BxLockable, BX_IA_BTS_EdGdM },
2373 /* 0F AC /dm */ { BxImmediate_Ib, BX_IA_SHRD_EdGdM },
2374 /* 0F AD /dm */ { 0, BX_IA_SHRD_EdGdM },
2375 /* 0F AE /dm */ { BxGroup15, BX_IA_ERROR, BxOpcodeInfoG15M },
2376 /* 0F AF /dm */ { 0, BX_IA_IMUL_GdEdM },
2377 /* 0F B0 /dm */ { BxLockable, BX_IA_CMPXCHG_EbGbM },
2378 /* 0F B1 /dm */ { BxLockable, BX_IA_CMPXCHG_EdGdM },
2379 /* 0F B2 /dm */ { 0, BX_IA_LSS_GdMp },
2380 /* 0F B3 /dm */ { BxLockable, BX_IA_BTR_EdGdM },
2381 /* 0F B4 /dm */ { 0, BX_IA_LFS_GdMp },
2382 /* 0F B5 /dm */ { 0, BX_IA_LGS_GdMp },
2383 /* 0F B6 /dm */ { 0, BX_IA_MOVZX_GdEbM },
2384 /* 0F B7 /dm */ { 0, BX_IA_MOVZX_GdEwM },
2385 /* 0F B8 /dm */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0fb8dM },
2386 /* 0F B9 /dm */ { BxTraceEnd, BX_IA_UD2B },
2387 /* 0F BA /dm */ { BxGroup8, BX_IA_ERROR, BxOpcodeInfoG8EdIbM },
2388 /* 0F BB /dm */ { BxLockable, BX_IA_BTC_EdGdM },
2389 /* 0F BC /dm */ { 0, BX_IA_BSF_GdEdM },
2390 /* 0F BD /dm */ { 0, BX_IA_BSR_GdEdM },
2391 /* 0F BE /dm */ { 0, BX_IA_MOVSX_GdEbM },
2392 /* 0F BF /dm */ { 0, BX_IA_MOVSX_GdEwM },
2393 /* 0F C0 /dm */ { BxLockable, BX_IA_XADD_EbGbM },
2394 /* 0F C1 /dm */ { BxLockable, BX_IA_XADD_EdGdM },
2395 /* 0F C2 /dm */ { BxPrefixSSE | BxImmediate_Ib, BX_IA_CMPPS_VpsWpsIb, BxOpcodeGroupSSE_0fc2 },
2396 /* 0F C3 /dm */ { BxPrefixSSE, BX_IA_MOVNTI_MdGd, BxOpcodeGroupSSE_ERR },
2397 /* 0F C4 /dm */ { BxPrefixSSE | BxImmediate_Ib, BX_IA_PINSRW_PqEwIb, BxOpcodeGroupSSE_0fc4 },
2398 /* 0F C5 /dm */ { 0, BX_IA_ERROR }, // PEXTRW SSE group
2399 /* 0F C6 /dm */ { BxPrefixSSE | BxImmediate_Ib, BX_IA_SHUFPS_VpsWpsIb, BxOpcodeGroupSSE_0fc6 },
2400 /* 0F C7 /dm */ { BxGroup9, BX_IA_ERROR, BxOpcodeInfoG9M },
2401 /* 0F C8 /dm */ { 0, BX_IA_BSWAP_ERX },
2402 /* 0F C9 /dm */ { 0, BX_IA_BSWAP_ERX },
2403 /* 0F CA /dm */ { 0, BX_IA_BSWAP_ERX },
2404 /* 0F CB /dm */ { 0, BX_IA_BSWAP_ERX },
2405 /* 0F CC /dm */ { 0, BX_IA_BSWAP_ERX },
2406 /* 0F CD /dm */ { 0, BX_IA_BSWAP_ERX },
2407 /* 0F CE /dm */ { 0, BX_IA_BSWAP_ERX },
2408 /* 0F CF /dm */ { 0, BX_IA_BSWAP_ERX },
2409 /* 0F D0 /dm */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0fd0 },
2410 /* 0F D1 /dm */ { BxPrefixSSE, BX_IA_PSRLW_PqQq, BxOpcodeGroupSSE_0fd1 },
2411 /* 0F D2 /dm */ { BxPrefixSSE, BX_IA_PSRLD_PqQq, BxOpcodeGroupSSE_0fd2 },
2412 /* 0F D3 /dm */ { BxPrefixSSE, BX_IA_PSRLQ_PqQq, BxOpcodeGroupSSE_0fd3 },
2413 /* 0F D4 /dm */ { BxPrefixSSE, BX_IA_PADDQ_PqQq, BxOpcodeGroupSSE_0fd4 },
2414 /* 0F D5 /dm */ { BxPrefixSSE, BX_IA_PMULLW_PqQq, BxOpcodeGroupSSE_0fd5 },
2415 /* 0F D6 /dm */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0fd6 },
2416 /* 0F D7 /dm */ { BxPrefixSSE, BX_IA_PMOVMSKB_GdPRq, BxOpcodeGroupSSE_0fd7 },
2417 /* 0F D8 /dm */ { BxPrefixSSE, BX_IA_PSUBUSB_PqQq, BxOpcodeGroupSSE_0fd8 },
2418 /* 0F D9 /dm */ { BxPrefixSSE, BX_IA_PSUBUSW_PqQq, BxOpcodeGroupSSE_0fd9 },
2419 /* 0F DA /dm */ { BxPrefixSSE, BX_IA_PMINUB_PqQq, BxOpcodeGroupSSE_0fda },
2420 /* 0F DB /dm */ { BxPrefixSSE, BX_IA_PAND_PqQq, BxOpcodeGroupSSE_0fdb },
2421 /* 0F DC /dm */ { BxPrefixSSE, BX_IA_PADDUSB_PqQq, BxOpcodeGroupSSE_0fdc },
2422 /* 0F DD /dm */ { BxPrefixSSE, BX_IA_PADDUSW_PqQq, BxOpcodeGroupSSE_0fdd },
2423 /* 0F DE /dm */ { BxPrefixSSE, BX_IA_PMAXUB_PqQq, BxOpcodeGroupSSE_0fde },
2424 /* 0F DF /dm */ { BxPrefixSSE, BX_IA_PANDN_PqQq, BxOpcodeGroupSSE_0fdf },
2425 /* 0F E0 /dm */ { BxPrefixSSE, BX_IA_PAVGB_PqQq, BxOpcodeGroupSSE_0fe0 },
2426 /* 0F E1 /dm */ { BxPrefixSSE, BX_IA_PSRAW_PqQq, BxOpcodeGroupSSE_0fe1 },
2427 /* 0F E2 /dm */ { BxPrefixSSE, BX_IA_PSRAD_PqQq, BxOpcodeGroupSSE_0fe2 },
2428 /* 0F E3 /dm */ { BxPrefixSSE, BX_IA_PAVGW_PqQq, BxOpcodeGroupSSE_0fe3 },
2429 /* 0F E4 /dm */ { BxPrefixSSE, BX_IA_PMULHUW_PqQq, BxOpcodeGroupSSE_0fe4 },
2430 /* 0F E5 /dm */ { BxPrefixSSE, BX_IA_PMULHW_PqQq, BxOpcodeGroupSSE_0fe5 },
2431 /* 0F E6 /dm */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0fe6 },
2432 /* 0F E7 /dm */ { BxPrefixSSE, BX_IA_MOVNTQ_MqPq, BxOpcodeGroupSSE_0fe7M },
2433 /* 0F E8 /dm */ { BxPrefixSSE, BX_IA_PSUBSB_PqQq, BxOpcodeGroupSSE_0fe8 },
2434 /* 0F E9 /dm */ { BxPrefixSSE, BX_IA_PSUBSW_PqQq, BxOpcodeGroupSSE_0fe9 },
2435 /* 0F EA /dm */ { BxPrefixSSE, BX_IA_PMINSW_PqQq, BxOpcodeGroupSSE_0fea },
2436 /* 0F EB /dm */ { BxPrefixSSE, BX_IA_POR_PqQq, BxOpcodeGroupSSE_0feb },
2437 /* 0F EC /dm */ { BxPrefixSSE, BX_IA_PADDSB_PqQq, BxOpcodeGroupSSE_0fec },
2438 /* 0F ED /dm */ { BxPrefixSSE, BX_IA_PADDSW_PqQq, BxOpcodeGroupSSE_0fed },
2439 /* 0F EE /dm */ { BxPrefixSSE, BX_IA_PMAXSW_PqQq, BxOpcodeGroupSSE_0fee },
2440 /* 0F EF /dm */ { BxPrefixSSE, BX_IA_PXOR_PqQq, BxOpcodeGroupSSE_0fef },
2441 /* 0F F0 /dm */ { BxPrefixSSE, BX_IA_ERROR, BxOpcodeGroupSSE_0ff0M },
2442 /* 0F F1 /dm */ { BxPrefixSSE, BX_IA_PSLLW_PqQq, BxOpcodeGroupSSE_0ff1 },
2443 /* 0F F2 /dm */ { BxPrefixSSE, BX_IA_PSLLD_PqQq, BxOpcodeGroupSSE_0ff2 },
2444 /* 0F F3 /dm */ { BxPrefixSSE, BX_IA_PSLLQ_PqQq, BxOpcodeGroupSSE_0ff3 },
2445 /* 0F F4 /dm */ { BxPrefixSSE, BX_IA_PMULUDQ_PqQq, BxOpcodeGroupSSE_0ff4 },
2446 /* 0F F5 /dm */ { BxPrefixSSE, BX_IA_PMADDWD_PqQq, BxOpcodeGroupSSE_0ff5 },
2447 /* 0F F6 /dm */ { BxPrefixSSE, BX_IA_PSADBW_PqQq, BxOpcodeGroupSSE_0ff6 },
2448 /* 0F F7 /dm */ { 0, BX_IA_ERROR }, // MASKMOV SSE group
2449 /* 0F F8 /dm */ { BxPrefixSSE, BX_IA_PSUBB_PqQq, BxOpcodeGroupSSE_0ff8 },
2450 /* 0F F9 /dm */ { BxPrefixSSE, BX_IA_PSUBW_PqQq, BxOpcodeGroupSSE_0ff9 },
2451 /* 0F FA /dm */ { BxPrefixSSE, BX_IA_PSUBD_PqQq, BxOpcodeGroupSSE_0ffa },
2452 /* 0F FB /dm */ { BxPrefixSSE, BX_IA_PSUBQ_PqQq, BxOpcodeGroupSSE_0ffb },
2453 /* 0F FC /dm */ { BxPrefixSSE, BX_IA_PADDB_PqQq, BxOpcodeGroupSSE_0ffc },
2454 /* 0F FD /dm */ { BxPrefixSSE, BX_IA_PADDW_PqQq, BxOpcodeGroupSSE_0ffd },
2455 /* 0F FE /dm */ { BxPrefixSSE, BX_IA_PADDD_PqQq, BxOpcodeGroupSSE_0ffe },
2456 /* 0F FF /dm */ { 0, BX_IA_ERROR }
2459 enum {
2460 BX_RESOLVE16,
2461 BX_RESOLVE32_BASE,
2462 BX_RESOLVE32_BASE_INDEX,
2463 BX_RESOLVE_NONE
2466 unsigned BX_CPP_AttrRegparmN(3)
2467 BX_CPU_C::fetchDecode32(const Bit8u *iptr, bxInstruction_c *i, unsigned remainingInPage)
2469 // remain must be at least 1
2470 unsigned remain = (remainingInPage < 15) ? remainingInPage : 15;
2472 bx_bool is_32, lock=0;
2473 unsigned b1, b2, ilen=0, attr, os_32, ia_opcode = 0;
2474 unsigned imm_mode, offset, resolve = BX_RESOLVE_NONE;
2475 unsigned rm = 0, mod=0, nnn=0;
2476 unsigned seg = BX_SEG_REG_DS, seg_override = BX_SEG_REG_NULL;
2478 #define SSE_PREFIX_NONE 0
2479 #define SSE_PREFIX_66 1
2480 #define SSE_PREFIX_F2 2
2481 #define SSE_PREFIX_F3 3
2482 unsigned sse_prefix = SSE_PREFIX_NONE;
2484 os_32 = is_32 =
2485 BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].cache.u.segment.d_b;
2487 i->ResolveModrm = 0;
2488 i->init(/*os32*/ is_32, /*as32*/ is_32,
2489 /*os64*/ 0, /*as64*/ 0);
2491 offset = os_32 << 9; // * 512
2493 fetch_b1:
2494 b1 = *iptr++;
2495 ilen++;
2497 switch (b1) {
2498 case 0x0f: // 2-byte escape
2499 if (ilen < remain) {
2500 ilen++;
2501 b1 = 0x100 | *iptr++;
2502 break;
2504 return(0);
2505 case 0x66: // OpSize
2506 os_32 = !is_32;
2507 offset = os_32 << 9;
2508 if(!sse_prefix) sse_prefix = SSE_PREFIX_66;
2509 i->setOs32B(os_32);
2510 if (ilen < remain) {
2511 goto fetch_b1;
2513 return(0);
2514 case 0x67: // AddrSize
2515 i->setAs32B(!is_32);
2516 if (ilen < remain) {
2517 goto fetch_b1;
2519 return(0);
2520 case 0xf2: // REPNE/REPNZ
2521 case 0xf3: // REP/REPE/REPZ
2522 sse_prefix = b1 & 0xf;
2523 i->setRepUsed(b1 & 3);
2524 if (ilen < remain) {
2525 goto fetch_b1;
2527 return(0);
2528 case 0x26: // ES:
2529 case 0x2e: // CS:
2530 case 0x36: // SS:
2531 case 0x3e: // DS:
2532 seg_override = (b1 >> 3) & 3;
2533 if (ilen < remain) {
2534 goto fetch_b1;
2536 return(0);
2537 case 0x64: // FS:
2538 case 0x65: // GS:
2539 seg_override = (b1 & 0xf);
2540 if (ilen < remain) {
2541 goto fetch_b1;
2543 return(0);
2544 case 0xf0: // LOCK:
2545 lock = 1;
2546 if (ilen < remain) {
2547 goto fetch_b1;
2549 return(0);
2550 default:
2551 break;
2554 attr = BxOpcodeInfo32R[b1+offset].Attr;
2556 if (BxOpcodeHasModrm32[b1]) {
2558 #if (BX_SUPPORT_SSE >= 4) || (BX_SUPPORT_SSE >= 3 && BX_SUPPORT_SSE_EXTENSION > 0)
2559 unsigned b3 = 0;
2560 // handle 3-byte escape
2561 if ((attr & BxGroupX) == Bx3ByteOp) {
2562 if (ilen < remain) {
2563 ilen++;
2564 b3 = *iptr++;
2566 else
2567 return(0);
2569 #endif
2571 // opcode requires modrm byte
2572 if (ilen < remain) {
2573 ilen++;
2574 b2 = *iptr++;
2576 else
2577 return(0);
2579 // Parse mod-nnn-rm and related bytes
2580 mod = b2 & 0xc0; // leave unshifted
2581 nnn = (b2 >> 3) & 0x7;
2582 rm = b2 & 0x7;
2584 // MOVs with CRx and DRx always use register ops and ignore the mod field.
2585 if ((b1 & ~3) == 0x120)
2586 mod = 0xc0;
2588 i->setModRM(b2);
2589 i->setNnn(nnn);
2591 if (mod == 0xc0) { // mod == 11b
2592 i->assertModC0();
2593 i->setRm(rm);
2594 goto modrm_done;
2597 i->setRm(BX_TMP_REGISTER);
2598 i->setSibBase(rm); // initialize with rm to use BxResolve32Base
2599 i->setSibIndex(BX_NIL_REGISTER);
2600 // initialize displ32 with zero to include cases with no diplacement
2601 i->modRMForm.displ32u = 0;
2603 if (i->as32L()) {
2604 // 32-bit addressing modes; note that mod==11b handled above
2605 resolve = BX_RESOLVE32_BASE;
2606 i->ResolveModrm = &BX_CPU_C::BxResolve32Base;
2607 if (rm != 4) { // no s-i-b byte
2608 if (mod == 0x00) { // mod == 00b
2609 if (rm == 5) {
2610 i->setSibBase(BX_NIL_REGISTER);
2611 if ((ilen+3) < remain) {
2612 i->modRMForm.displ32u = FetchDWORD(iptr);
2613 iptr += 4;
2614 ilen += 4;
2616 else return(0);
2618 // mod==00b, rm!=4, rm!=5
2619 goto modrm_done;
2621 seg = sreg_mod01or10_rm32[rm];
2622 if (mod == 0x40) { // mod == 01b
2623 if (ilen < remain) {
2624 // 8 sign extended to 32
2625 i->modRMForm.displ32u = (Bit8s) *iptr++;
2626 ilen++;
2627 goto modrm_done;
2629 else return(0);
2631 // (mod == 0x80) mod == 10b
2632 if ((ilen+3) < remain) {
2633 i->modRMForm.displ32u = FetchDWORD(iptr);
2634 iptr += 4;
2635 ilen += 4;
2637 else {
2638 return(0);
2640 goto modrm_done;
2642 else { // mod!=11b, rm==4, s-i-b byte follows
2643 unsigned sib, base, index, scale;
2644 if (ilen < remain) {
2645 sib = *iptr++;
2646 ilen++;
2648 else {
2649 return(0);
2651 base = sib & 0x7; sib >>= 3;
2652 index = sib & 0x7; sib >>= 3;
2653 scale = sib;
2654 i->setSibScale(scale);
2655 i->setSibBase(base);
2656 if (index != 4) {
2657 resolve = BX_RESOLVE32_BASE_INDEX;
2658 i->ResolveModrm = &BX_CPU_C::BxResolve32BaseIndex;
2659 i->setSibIndex(index);
2661 if (mod == 0x00) { // mod==00b, rm==4
2662 seg = sreg_mod0_base32[base];
2663 if (base == 0x05) {
2664 i->setSibBase(BX_NIL_REGISTER);
2665 if ((ilen+3) < remain) {
2666 i->modRMForm.displ32u = FetchDWORD(iptr);
2667 iptr += 4;
2668 ilen += 4;
2670 else {
2671 return(0);
2674 // mod==00b, rm==4, base!=5
2675 goto modrm_done;
2677 seg = sreg_mod1or2_base32[base];
2678 if (mod == 0x40) { // mod==01b, rm==4
2679 if (ilen < remain) {
2680 // 8 sign extended to 32
2681 i->modRMForm.displ32u = (Bit8s) *iptr++;
2682 ilen++;
2683 goto modrm_done;
2685 else {
2686 return(0);
2688 goto modrm_done;
2690 // (mod == 0x80), mod==10b, rm==4
2691 if ((ilen+3) < remain) {
2692 i->modRMForm.displ32u = FetchDWORD(iptr);
2693 iptr += 4;
2694 ilen += 4;
2696 else {
2697 return(0);
2699 goto modrm_done;
2702 else {
2703 // 16-bit addressing modes, mod==11b handled above
2704 resolve = BX_RESOLVE16;
2705 i->ResolveModrm = &BX_CPU_C::BxResolve16BaseIndex;
2706 i->setSibBase(Resolve16BaseReg[rm]);
2707 i->setSibIndex(Resolve16IndexReg[rm]);
2708 if (mod == 0x00) { // mod == 00b
2709 seg = sreg_mod00_rm16[rm];
2710 if (rm == 0x06) {
2711 i->setSibBase(BX_NIL_REGISTER);
2712 if ((ilen+1) < remain) {
2713 i->modRMForm.displ16u = FetchWORD(iptr);
2714 iptr += 2;
2715 ilen += 2;
2716 goto modrm_done;
2718 else return(0);
2720 goto modrm_done;
2722 seg = sreg_mod01or10_rm16[rm];
2723 if (mod == 0x40) { // mod == 01b
2724 if (ilen < remain) {
2725 // 8 sign extended to 16
2726 i->modRMForm.displ16u = (Bit8s) *iptr++;
2727 ilen++;
2728 goto modrm_done;
2730 else return(0);
2732 // (mod == 0x80) mod == 10b
2733 if ((ilen+1) < remain) {
2734 i->modRMForm.displ16u = FetchWORD(iptr);
2735 iptr += 2;
2736 ilen += 2;
2738 else return(0);
2741 modrm_done:
2743 // Resolve ExecutePtr and additional opcode Attr
2744 const BxOpcodeInfo_t *OpcodeInfoPtr;
2745 if (mod == 0xc0) {
2746 OpcodeInfoPtr = &(BxOpcodeInfo32R[b1+offset]);
2747 attr = BxOpcodeInfo32R[b1+offset].Attr;
2749 else {
2750 OpcodeInfoPtr = &(BxOpcodeInfo32M[b1+offset]);
2751 attr = BxOpcodeInfo32M[b1+offset].Attr;
2754 while(attr & BxGroupX) {
2755 Bit32u group = attr & BxGroupX;
2756 attr &= ~BxGroupX;
2758 switch(group) {
2759 case BxGroupN:
2760 OpcodeInfoPtr = &(OpcodeInfoPtr->AnotherArray[nnn]);
2761 break;
2762 case BxRMGroup:
2763 OpcodeInfoPtr = &(OpcodeInfoPtr->AnotherArray[rm]);
2764 break;
2765 #if (BX_SUPPORT_SSE >= 4) || (BX_SUPPORT_SSE >= 3 && BX_SUPPORT_SSE_EXTENSION > 0)
2766 case Bx3ByteOp:
2767 OpcodeInfoPtr = &(OpcodeInfoPtr->AnotherArray[b3]);
2768 break;
2769 #endif
2770 case BxOSizeGrp:
2771 OpcodeInfoPtr = &(OpcodeInfoPtr->AnotherArray[os_32]);
2772 break;
2773 case BxPrefixSSE:
2774 /* For SSE opcodes look into another table
2775 with the opcode prefixes (NONE, 0x66, 0xF2, 0xF3) */
2776 if (sse_prefix) {
2777 OpcodeInfoPtr = &(OpcodeInfoPtr->AnotherArray[sse_prefix-1]);
2778 break;
2780 continue;
2781 case BxFPEscape:
2782 OpcodeInfoPtr = &(OpcodeInfoPtr->AnotherArray[b2 & 0x3f]);
2783 break;
2784 default:
2785 BX_PANIC(("fetchdecode: Unknown opcode group"));
2788 /* get additional attributes from group table */
2789 attr |= OpcodeInfoPtr->Attr;
2792 ia_opcode = OpcodeInfoPtr->IA;
2794 else {
2795 // Opcode does not require a MODRM byte.
2796 // Note that a 2-byte opcode (0F XX) will jump to before
2797 // the if() above after fetching the 2nd byte, so this path is
2798 // taken in all cases if a modrm byte is NOT required.
2799 ia_opcode = BxOpcodeInfo32R[b1+offset].IA;
2800 i->setOpcodeReg(b1 & 7);
2803 if (lock) { // lock prefix invalid opcode
2804 // lock prefix not allowed or destination operand is not memory
2805 // mod == 0xc0 can't be BxLockable in fetchdecode tables
2806 if (/*(mod == 0xc0) ||*/ !(attr & BxLockable)) {
2807 BX_INFO(("LOCK prefix unallowed (op1=0x%x, attr=0x%x, mod=0x%x, nnn=%u)", b1, attr, mod, nnn));
2808 // replace execution function with undefined-opcode
2809 ia_opcode = BX_IA_ERROR;
2813 imm_mode = attr & BxImmediate;
2814 if (imm_mode) {
2815 switch (imm_mode) {
2816 case BxImmediate_I1:
2817 i->modRMForm.Ib = 1;
2818 break;
2819 case BxImmediate_Ib:
2820 if (ilen < remain) {
2821 i->modRMForm.Ib = *iptr;
2822 ilen++;
2824 else {
2825 return(0);
2827 break;
2828 case BxImmediate_Ib_SE: // Sign extend to OS size
2829 if (ilen < remain) {
2830 Bit8s temp8s = *iptr;
2831 if (i->os32L())
2832 i->modRMForm.Id = (Bit32s) temp8s;
2833 else
2834 i->modRMForm.Iw = (Bit16s) temp8s;
2835 ilen++;
2837 else {
2838 return(0);
2840 break;
2841 case BxImmediate_Iw:
2842 if ((ilen+1) < remain) {
2843 i->modRMForm.Iw = FetchWORD(iptr);
2844 ilen += 2;
2846 else {
2847 return(0);
2849 break;
2850 case BxImmediate_Id:
2851 if ((ilen+3) < remain) {
2852 i->modRMForm.Id = FetchDWORD(iptr);
2853 ilen += 4;
2855 else {
2856 return(0);
2858 break;
2859 case BxImmediate_BrOff8:
2860 if (ilen < remain) {
2861 i->modRMForm.Id = (Bit8s) (*iptr);
2862 ilen++;
2864 else {
2865 return(0);
2867 break;
2868 case BxImmediate_IwIb:
2869 if ((ilen+1) < remain) {
2870 i->IxIxForm.Iw = FetchWORD(iptr);
2871 iptr += 2;
2872 ilen += 2;
2874 else {
2875 return(0);
2877 if (ilen < remain) {
2878 i->IxIxForm.Ib2 = *iptr;
2879 ilen++;
2881 else {
2882 return(0);
2884 break;
2885 case BxImmediate_IwIw: // CALL_Ap
2886 if ((ilen+1) < remain) {
2887 i->IxIxForm.Iw = FetchWORD(iptr);
2888 iptr += 2;
2889 ilen += 2;
2891 else {
2892 return(0);
2894 if ((ilen+1) < remain) {
2895 i->IxIxForm.Iw2 = FetchWORD(iptr);
2896 ilen += 2;
2898 else {
2899 return(0);
2901 break;
2902 case BxImmediate_IdIw: // CALL_Ap
2903 if ((ilen+3) < remain) {
2904 i->IxIxForm.Id = FetchDWORD(iptr);
2905 iptr += 4;
2906 ilen += 4;
2908 else {
2909 return(0);
2911 if ((ilen+1) < remain) {
2912 i->IxIxForm.Iw2 = FetchWORD(iptr);
2913 ilen += 2;
2915 else {
2916 return(0);
2918 break;
2919 case BxImmediate_O:
2920 // For is which embed the address in the opcode.
2921 if (i->as32L()) {
2922 // fetch 32bit address into Id
2923 if ((ilen+3) < remain) {
2924 i->modRMForm.Id = FetchDWORD(iptr);
2925 ilen += 4;
2927 else return(0);
2929 else {
2930 // fetch 16bit address into Id
2931 if ((ilen+1) < remain) {
2932 i->modRMForm.Id = (Bit32u) FetchWORD(iptr);
2933 ilen += 2;
2935 else return(0);
2937 break;
2938 default:
2939 BX_INFO(("b1 was %x", b1));
2940 BX_PANIC(("fetchdecode: imm_mode = %u", imm_mode));
2944 #if BX_SUPPORT_3DNOW
2945 if(b1 == 0x10f)
2946 ia_opcode = Bx3DNowOpcodeInfo[i->modRMForm.Ib].IA;
2947 #endif
2949 if (! BX_NULL_SEG_REG(seg_override))
2950 seg = seg_override;
2951 i->setSeg(seg);
2953 #if BX_SUPPORT_TRACE_CACHE
2954 if ((attr & BxTraceEnd) || ia_opcode == BX_IA_ERROR)
2955 i->setStopTraceAttr();
2956 #endif
2958 if (attr & BxArithDstRM) {
2959 i->setRm(nnn);
2960 i->setNnn(rm);
2963 i->execute = BxOpcodesTable[ia_opcode].execute1;
2964 i->execute2 = BxOpcodesTable[ia_opcode].execute2;
2966 i->setB1(b1);
2967 i->setILen(ilen);
2969 #if BX_INSTRUMENTATION
2970 i->ia_opcode = ia_opcode;
2971 #endif
2973 if (i->execute2 != NULL) {
2974 optimize32(i, resolve);
2977 return(1);
2980 void BX_CPP_AttrRegparmN(2) BX_CPU_C::optimize32(bxInstruction_c *i, unsigned resolve)
2982 // LOAD speedups
2983 static const BxExecutePtr_tR BxTableLoad32_Eb[3] = {
2984 &BX_CPU_C::LOAD_Eb_Resolve16BaseIndex,
2985 &BX_CPU_C::LOAD_Eb_Resolve32Base,
2986 &BX_CPU_C::LOAD_Eb_Resolve32BaseIndex
2989 static const BxExecutePtr_tR BxTableLoad32_Ew[3] = {
2990 &BX_CPU_C::LOAD_Ew_Resolve16BaseIndex,
2991 &BX_CPU_C::LOAD_Ew_Resolve32Base,
2992 &BX_CPU_C::LOAD_Ew_Resolve32BaseIndex
2995 static const BxExecutePtr_tR BxTableLoad32_Ed[3] = {
2996 &BX_CPU_C::LOAD_Ed_Resolve16BaseIndex,
2997 &BX_CPU_C::LOAD_Ed_Resolve32Base,
2998 &BX_CPU_C::LOAD_Ed_Resolve32BaseIndex
3001 #if BX_CPU_LEVEL >= 4 && BX_SUPPORT_ALIGNMENT_CHECK
3002 if (! BX_CPU_THIS_PTR alignment_check())
3003 #endif
3005 if (i->execute == &BX_CPU_C::LOAD_Eb)
3006 i->execute = BxTableLoad32_Eb[resolve];
3007 else if (i->execute == &BX_CPU_C::LOAD_Ew)
3008 i->execute = BxTableLoad32_Ew[resolve];
3009 else if (i->execute == &BX_CPU_C::LOAD_Ed)
3010 i->execute = BxTableLoad32_Ed[resolve];
3014 void BX_CPP_AttrRegparmN(1) BX_CPU_C::BxError(bxInstruction_c *i)
3016 BX_DEBUG(("BxError: Encountered an unknown instruction b1=0x%02x (signalling #UD)", i->b1()));
3017 BX_DEBUG(("modrm was 0x%02x, nnn was %u, rm was %u", i->modrm(), i->nnn(), i->rm()));
3019 #if BX_DISASM && BX_DEBUGGER == 0 // with debugger it easy to see the #UD
3020 if (LOG_THIS getonoff(LOGLEV_DEBUG))
3021 debug_disasm_instruction(BX_CPU_THIS_PTR prev_rip);
3022 #endif
3024 exception(BX_UD_EXCEPTION, 0, 0);