one_byte_opcodes.isa (4575:d0017efdfa02) one_byte_opcodes.isa (4592:520664dfb26f)
1// Copyright (c) 2007 The Hewlett-Packard Development Company
2// All rights reserved.
3//
4// Redistribution and use of this software in source and binary forms,
5// with or without modification, are permitted provided that the
6// following conditions are met:
7//
8// The software must be used only for Non-Commercial Use which means any

--- 49 unchanged lines hidden (view full) ---

58// Decode the one byte opcodes
59//
60
610x1: decode OPCODE_OP_TOP5 {
62 format WarnUnimpl {
63 0x00: decode OPCODE_OP_BOTTOM3 {
64 0x4: ADD();
65 0x5: ADD();
1// Copyright (c) 2007 The Hewlett-Packard Development Company
2// All rights reserved.
3//
4// Redistribution and use of this software in source and binary forms,
5// with or without modification, are permitted provided that the
6// following conditions are met:
7//
8// The software must be used only for Non-Commercial Use which means any

--- 49 unchanged lines hidden (view full) ---

58// Decode the one byte opcodes
59//
60
610x1: decode OPCODE_OP_TOP5 {
62 format WarnUnimpl {
63 0x00: decode OPCODE_OP_BOTTOM3 {
64 0x4: ADD();
65 0x5: ADD();
66 0x6: push_ES();
67 0x7: pop_ES();
66 0x6: decode MODE_SUBMODE {
67 0x0: This_should_be_an_illegal_instruction();
68 default: push_ES();
69 }
70 0x7: decode MODE_SUBMODE {
71 0x0: This_should_be_an_illegal_instruction();
72 default: pop_ES();
73 }
68 default: ADD();
69 }
70 0x01: decode OPCODE_OP_BOTTOM3 {
71 0x0: or_Eb_Gb();
72 0x1: or_Ev_Gv();
73 0x2: or_Gb_Eb();
74 0x3: or_Gv_Ev();
75 0x4: or_Al_Ib();
76 0x5: or_rAX_Iz();
74 default: ADD();
75 }
76 0x01: decode OPCODE_OP_BOTTOM3 {
77 0x0: or_Eb_Gb();
78 0x1: or_Ev_Gv();
79 0x2: or_Gb_Eb();
80 0x3: or_Gv_Ev();
81 0x4: or_Al_Ib();
82 0x5: or_rAX_Iz();
77 0x6: push_CS();
83 0x6: decode MODE_SUBMODE {
84 0x0: This_should_be_an_illegal_instruction();
85 default: push_CS();
86 }
78 //Any time this is seen, it should generate a two byte opcode
79 0x7: M5InternalError::error(
80 {{"Saw a one byte opcode whose value was 0x0F!"}});
81 }
82 0x02: decode OPCODE_OP_BOTTOM3 {
83 0x0: adc_Eb_Gb();
84 0x1: adc_Ev_Gv();
85 0x2: adc_Gb_Eb();
86 0x3: adc_Gv_Ev();
87 0x4: adc_Al_Ib();
88 0x5: adc_rAX_Iz();
87 //Any time this is seen, it should generate a two byte opcode
88 0x7: M5InternalError::error(
89 {{"Saw a one byte opcode whose value was 0x0F!"}});
90 }
91 0x02: decode OPCODE_OP_BOTTOM3 {
92 0x0: adc_Eb_Gb();
93 0x1: adc_Ev_Gv();
94 0x2: adc_Gb_Eb();
95 0x3: adc_Gv_Ev();
96 0x4: adc_Al_Ib();
97 0x5: adc_rAX_Iz();
89 0x6: push_SS();
90 0x7: pop_SS();
98 0x6: decode MODE_SUBMODE {
99 0x0: This_should_be_an_illegal_instruction();
100 default: push_SS();
101 }
102 0x7: decode MODE_SUBMODE {
103 0x0: This_should_be_an_illegal_instruction();
104 default: pop_SS();
105 }
91 }
92 0x03: decode OPCODE_OP_BOTTOM3 {
93 0x0: sbb_Eb_Gb();
94 0x1: sbb_Ev_Gv();
95 0x2: sbb_Gb_Eb();
96 0x3: sbb_Gv_Ev();
97 0x4: sbb_Al_Ib();
98 0x5: sbb_rAX_Iz();
106 }
107 0x03: decode OPCODE_OP_BOTTOM3 {
108 0x0: sbb_Eb_Gb();
109 0x1: sbb_Ev_Gv();
110 0x2: sbb_Gb_Eb();
111 0x3: sbb_Gv_Ev();
112 0x4: sbb_Al_Ib();
113 0x5: sbb_rAX_Iz();
99 0x6: push_DS();
100 0x7: pop_DS();
114 0x6: decode MODE_SUBMODE {
115 0x0: This_should_be_an_illegal_instruction();
116 default: push_DS();
117 }
118 0x7: decode MODE_SUBMODE {
119 0x0: This_should_be_an_illegal_instruction();
120 default: pop_DS();
121 }
101 }
102 0x04: decode OPCODE_OP_BOTTOM3 {
103 0x0: and_Eb_Gb();
104 0x1: and_Ev_Gv();
105 0x2: and_Gb_Eb();
106 0x3: and_Gv_Ev();
107 0x4: and_Al_Ib();
108 0x5: and_rAX_Iz();
109 0x6: M5InternalError::error(
110 {{"Tried to execute the ES segment override prefix!"}});
122 }
123 0x04: decode OPCODE_OP_BOTTOM3 {
124 0x0: and_Eb_Gb();
125 0x1: and_Ev_Gv();
126 0x2: and_Gb_Eb();
127 0x3: and_Gv_Ev();
128 0x4: and_Al_Ib();
129 0x5: and_rAX_Iz();
130 0x6: M5InternalError::error(
131 {{"Tried to execute the ES segment override prefix!"}});
111 0x7: daa();
132 0x7: decode MODE_SUBMODE {
133 0x0: This_should_be_an_illegal_instruction();
134 default: daa();
135 }
112 }
113 0x05: decode OPCODE_OP_BOTTOM3 {
114 0x0: sub_Eb_Gb();
115 0x1: sub_Ev_Gv();
116 0x2: sub_Gb_Eb();
117 0x3: sub_Gv_Ev();
118 0x4: sub_Al_Ib();
119 0x5: sub_rAX_Iz();
120 0x6: M5InternalError::error(
121 {{"Tried to execute the CS segment override prefix!"}});
122 0x7: das();
123 }
124 0x06: decode OPCODE_OP_BOTTOM3 {
125 0x4: Inst::XOR(rAl,Ib);
126 0x5: Inst::XOR(rAx,Iz);
127 0x6: M5InternalError::error(
128 {{"Tried to execute the SS segment override prefix!"}});
136 }
137 0x05: decode OPCODE_OP_BOTTOM3 {
138 0x0: sub_Eb_Gb();
139 0x1: sub_Ev_Gv();
140 0x2: sub_Gb_Eb();
141 0x3: sub_Gv_Ev();
142 0x4: sub_Al_Ib();
143 0x5: sub_rAX_Iz();
144 0x6: M5InternalError::error(
145 {{"Tried to execute the CS segment override prefix!"}});
146 0x7: das();
147 }
148 0x06: decode OPCODE_OP_BOTTOM3 {
149 0x4: Inst::XOR(rAl,Ib);
150 0x5: Inst::XOR(rAx,Iz);
151 0x6: M5InternalError::error(
152 {{"Tried to execute the SS segment override prefix!"}});
129 0x7: aaa();
153 0x7: decode MODE_SUBMODE {
154 0x0: This_should_be_an_illegal_instruction();
155 default: aaa();
156 }
130 default: MultiInst::XOR(OPCODE_OP_BOTTOM3,
131 [Eb,Gb], [Ev,Gv],
132 [Gb,Eb], [Gv,Ev]);
133 }
134 0x07: decode OPCODE_OP_BOTTOM3 {
135 0x0: cmp_Eb_Gb();
136 0x1: cmp_Ev_Gv();
137 0x2: cmp_Gb_Eb();
138 0x3: cmp_Gv_Ev();
139 0x4: cmp_Al_Ib();
140 0x5: cmp_rAX_Iz();
141 0x6: M5InternalError::error(
142 {{"Tried to execute the DS segment override prefix!"}});
157 default: MultiInst::XOR(OPCODE_OP_BOTTOM3,
158 [Eb,Gb], [Ev,Gv],
159 [Gb,Eb], [Gv,Ev]);
160 }
161 0x07: decode OPCODE_OP_BOTTOM3 {
162 0x0: cmp_Eb_Gb();
163 0x1: cmp_Ev_Gv();
164 0x2: cmp_Gb_Eb();
165 0x3: cmp_Gv_Ev();
166 0x4: cmp_Al_Ib();
167 0x5: cmp_rAX_Iz();
168 0x6: M5InternalError::error(
169 {{"Tried to execute the DS segment override prefix!"}});
143 0x7: aas();
170 0x7: decode MODE_SUBMODE {
171 0x0: This_should_be_an_illegal_instruction();
172 default: aas();
173 }
144 }
145 0x08: decode OPCODE_OP_BOTTOM3 {
146 0x0: inc_eAX();
147 0x1: inc_eCX();
148 0x2: inc_eDX();
149 0x3: inc_eBX();
150 0x4: inc_eSP();
151 0x5: inc_eBP();

--- 5 unchanged lines hidden (view full) ---

157 0x1: dec_eCX();
158 0x2: dec_eDX();
159 0x3: dec_eBX();
160 0x4: dec_eSP();
161 0x5: dec_eBP();
162 0x6: dec_eSI();
163 0x7: dec_eDI();
164 }
174 }
175 0x08: decode OPCODE_OP_BOTTOM3 {
176 0x0: inc_eAX();
177 0x1: inc_eCX();
178 0x2: inc_eDX();
179 0x3: inc_eBX();
180 0x4: inc_eSP();
181 0x5: inc_eBP();

--- 5 unchanged lines hidden (view full) ---

187 0x1: dec_eCX();
188 0x2: dec_eDX();
189 0x3: dec_eBX();
190 0x4: dec_eSP();
191 0x5: dec_eBP();
192 0x6: dec_eSI();
193 0x7: dec_eDI();
194 }
165 0x0A: decode OPCODE_OP_BOTTOM3 {
166 0x0: Inst::PUSH(rAx);
167 0x1: push_rCX();
168 0x2: push_rDX();
169 0x3: push_rBX();
170 0x4: Inst::PUSH(rSP);
171 0x5: push_rBP();
172 0x6: push_rSI();
173 0x7: push_rDI();
195 format Inst {
196 0x0A: decode OPCODE_OP_BOTTOM3 {
197 0x0: PUSH(rAx);
198 0x1: PUSH(rCx);
199 0x2: PUSH(rDx);
200 0x3: PUSH(rBx);
201 0x4: PUSH(rSP);
202 0x5: PUSH(rBP);
203 0x6: PUSH(rSI);
204 0x7: PUSH(rDI);
205 }
206 0x0B: decode OPCODE_OP_BOTTOM3 {
207 0x0: POP(rAx);
208 0x1: POP(rCx);
209 0x2: POP(rDx);
210 0x3: POP(rBx);
211 0x4: POP(rSP);
212 0x5: POP(rBP);
213 0x6: POP(rSI);
214 0x7: POP(rDI);
215 }
174 }
216 }
175 0x0B: decode OPCODE_OP_BOTTOM3 {
176 0x0: pop_rAX();
177 0x1: pop_rCX();
178 0x2: pop_rDX();
179 0x3: pop_rBX();
180 0x4: pop_rSP();
181 0x5: pop_rBP();
182 0x6: Inst::POP(rSI);
183 0x7: pop_rDI();
184 }
185 0x0C: decode OPCODE_OP_BOTTOM3 {
217 0x0C: decode OPCODE_OP_BOTTOM3 {
186 0x0: pusha();
187 0x1: popa();
188 0x2: bound_Gv_Ma();
218 0x0: decode MODE_SUBMODE {
219 0x0: This_should_be_an_illegal_instruction();
220 default: pusha();
221 }
222 0x1: decode MODE_SUBMODE {
223 0x0: This_should_be_an_illegal_instruction();
224 default: popa();
225 }
226 0x2: decode MODE_SUBMODE {
227 0x0: This_should_be_an_illegal_instruction();
228 default: bound_Gv_Ma();
229 }
189 0x3: arpl_Ew_Gw();
190 0x4: M5InternalError::error(
191 {{"Tried to execute the FS segment override prefix!"}});
192 0x5: M5InternalError::error(
193 {{"Tried to execute the GS segment override prefix!"}});
194 0x6: M5InternalError::error(
195 {{"Tried to execute the operand size override prefix!"}});
196 0x7: M5InternalError::error(

--- 27 unchanged lines hidden (view full) ---

224 0x4: jl_Jb();
225 0x5: jnl_Jb();
226 0x6: jle_Jb();
227 0x7: jnke_Jb();
228 }
229 0x10: decode OPCODE_OP_BOTTOM3 {
230 0x0: group1_Eb_Ib();
231 0x1: group1_Ev_Iz();
230 0x3: arpl_Ew_Gw();
231 0x4: M5InternalError::error(
232 {{"Tried to execute the FS segment override prefix!"}});
233 0x5: M5InternalError::error(
234 {{"Tried to execute the GS segment override prefix!"}});
235 0x6: M5InternalError::error(
236 {{"Tried to execute the operand size override prefix!"}});
237 0x7: M5InternalError::error(

--- 27 unchanged lines hidden (view full) ---

265 0x4: jl_Jb();
266 0x5: jnl_Jb();
267 0x6: jle_Jb();
268 0x7: jnke_Jb();
269 }
270 0x10: decode OPCODE_OP_BOTTOM3 {
271 0x0: group1_Eb_Ib();
272 0x1: group1_Ev_Iz();
232 0x2: group1_Eb_Ib();
273 0x2: decode MODE_SUBMODE {
274 0x0: This_should_be_an_illegal_instruction();
275 default: group1_Eb_Ib();
276 }
233 //0x3: group1_Ev_Ib();
234 0x3: decode MODRM_REG {
235 0x0: add_Eb_Ib();
236 0x1: or_Eb_Ib();
237 0x2: adc_Eb_Ib();
238 0x3: sbb_Eb_Ib();
239 0x4: Inst::AND(Eb,Ib);
240 0x5: sub_Eb_Ib();

--- 23 unchanged lines hidden (view full) ---

264 0x4: xchg_rSP_rAX();
265 0x5: xchg_rBP_rAX();
266 0x6: xchg_rSI_rAX();
267 0x7: xchg_rDI_rAX();
268 }
269 0x13: decode OPCODE_OP_BOTTOM3 {
270 0x0: cbw_or_cwde_or_cdqe_rAX();
271 0x1: cwd_or_cdq_or_cqo_rAX_rDX();
277 //0x3: group1_Ev_Ib();
278 0x3: decode MODRM_REG {
279 0x0: add_Eb_Ib();
280 0x1: or_Eb_Ib();
281 0x2: adc_Eb_Ib();
282 0x3: sbb_Eb_Ib();
283 0x4: Inst::AND(Eb,Ib);
284 0x5: sub_Eb_Ib();

--- 23 unchanged lines hidden (view full) ---

308 0x4: xchg_rSP_rAX();
309 0x5: xchg_rBP_rAX();
310 0x6: xchg_rSI_rAX();
311 0x7: xchg_rDI_rAX();
312 }
313 0x13: decode OPCODE_OP_BOTTOM3 {
314 0x0: cbw_or_cwde_or_cdqe_rAX();
315 0x1: cwd_or_cdq_or_cqo_rAX_rDX();
272 0x2: call_Ap();
316 0x2: decode MODE_SUBMODE {
317 0x0: This_should_be_an_illegal_instruction();
318 default: call_Ap();
319 }
273 0x3: fwait(); //aka wait
274 0x4: pushf_Fv();
275 0x5: popf_Fv();
320 0x3: fwait(); //aka wait
321 0x4: pushf_Fv();
322 0x5: popf_Fv();
276 0x6: sahf();
277 0x7: lahf();
323 //Both of these should be illegal only if CPUID.AHF64=0,
324 //according to sandpile.org
325 0x6: decode MODE_SUBMODE {
326 0x0: This_should_be_an_illegal_instruction();
327 default: sahf();
328 }
329 0x7: decode MODE_SUBMODE {
330 0x0: This_should_be_an_illegal_instruction();
331 default: lahf();
332 }
278 }
279 0x14: decode OPCODE_OP_BOTTOM3 {
280 0x0: mov_Al_Ob();
281 0x1: mov_rAX_Ov();
282 0x2: mov_Ob_Al();
283 0x3: mov_Ov_rAX();
284 0x4: movs_Yb_Xb();
285 0x5: movs_Yv_Xv();

--- 30 unchanged lines hidden (view full) ---

316 0x6: mov_rSI_Iv();
317 0x7: mov_rDI_Iv();
318 }
319 0x18: decode OPCODE_OP_BOTTOM3 {
320 0x0: group2_Eb_Ib();
321 0x1: group2_Ev_Ib();
322 0x2: ret_near_Iw();
323 0x3: ret_near();
333 }
334 0x14: decode OPCODE_OP_BOTTOM3 {
335 0x0: mov_Al_Ob();
336 0x1: mov_rAX_Ov();
337 0x2: mov_Ob_Al();
338 0x3: mov_Ov_rAX();
339 0x4: movs_Yb_Xb();
340 0x5: movs_Yv_Xv();

--- 30 unchanged lines hidden (view full) ---

371 0x6: mov_rSI_Iv();
372 0x7: mov_rDI_Iv();
373 }
374 0x18: decode OPCODE_OP_BOTTOM3 {
375 0x0: group2_Eb_Ib();
376 0x1: group2_Ev_Ib();
377 0x2: ret_near_Iw();
378 0x3: ret_near();
324 0x4: les_Gz_Mp();
325 0x5: lds_Gz_Mp();
379 0x4: decode MODE_SUBMODE {
380 0x0: This_should_be_an_illegal_instruction();
381 default: les_Gz_Mp();
382 }
383 0x5: decode MODE_SUBMODE {
384 0x0: This_should_be_an_illegal_instruction();
385 default: lds_Gz_Mp();
386 }
326 //0x6: group12_Eb_Ib();
327 0x6: decode MODRM_REG {
328 0x0: Inst::MOV(Eb,Ib);
329 }
330 //0x7: group12_Ev_Iz();
331 0x7: decode MODRM_REG {
332 0x0: Inst::MOV(Ev,Iz);
333 }
334 }
335 0x19: decode OPCODE_OP_BOTTOM3 {
336 0x0: enter_Iw_Ib();
337 0x1: leave();
338 0x2: ret_far_Iw();
339 0x3: ret_far();
340 0x4: int3();
341 0x5: int_Ib();
387 //0x6: group12_Eb_Ib();
388 0x6: decode MODRM_REG {
389 0x0: Inst::MOV(Eb,Ib);
390 }
391 //0x7: group12_Ev_Iz();
392 0x7: decode MODRM_REG {
393 0x0: Inst::MOV(Ev,Iz);
394 }
395 }
396 0x19: decode OPCODE_OP_BOTTOM3 {
397 0x0: enter_Iw_Ib();
398 0x1: leave();
399 0x2: ret_far_Iw();
400 0x3: ret_far();
401 0x4: int3();
402 0x5: int_Ib();
342 0x6: into();
403 0x6: decode MODE_SUBMODE {
404 0x0: This_should_be_an_illegal_instruction();
405 default: into();
406 }
343 0x7: iret();
344 }
345 0x1A: decode OPCODE_OP_BOTTOM3 {
346 0x0: group2_Eb_1();
347 0x1: group2_Ev_1();
348 0x2: group2_Eb_Cl();
349 0x3: group2_Ev_Cl();
407 0x7: iret();
408 }
409 0x1A: decode OPCODE_OP_BOTTOM3 {
410 0x0: group2_Eb_1();
411 0x1: group2_Ev_1();
412 0x2: group2_Eb_Cl();
413 0x3: group2_Ev_Cl();
350 0x4: aam_Ib();
351 0x5: aad_Ib();
352 0x6: salc();
414 0x4: decode MODE_SUBMODE {
415 0x0: This_should_be_an_illegal_instruction();
416 default: aam_Ib();
417 }
418 0x5: decode MODE_SUBMODE {
419 0x0: This_should_be_an_illegal_instruction();
420 default: aad_Ib();
421 }
422 0x6: decode MODE_SUBMODE {
423 0x0: This_should_be_an_illegal_instruction();
424 default: salc();
425 }
353 0x7: xlat();
354 }
355 0x1B: decode OPCODE_OP_BOTTOM3 {
356 0x0: esc0();
357 0x1: esc1();
358 0x2: esc2();
359 0x3: esc3();
360 0x4: esc4();

--- 7 unchanged lines hidden (view full) ---

368 0x2: loop_Jb();
369 0x3: jcxz_or_jecx_or_jrcx();
370 0x4: in_Al_Ib();
371 0x5: in_eAX_Ib();
372 0x6: out_Ib_Al();
373 0x7: out_Ib_eAX();
374 }
375 0x1D: decode OPCODE_OP_BOTTOM3 {
426 0x7: xlat();
427 }
428 0x1B: decode OPCODE_OP_BOTTOM3 {
429 0x0: esc0();
430 0x1: esc1();
431 0x2: esc2();
432 0x3: esc3();
433 0x4: esc4();

--- 7 unchanged lines hidden (view full) ---

441 0x2: loop_Jb();
442 0x3: jcxz_or_jecx_or_jrcx();
443 0x4: in_Al_Ib();
444 0x5: in_eAX_Ib();
445 0x6: out_Ib_Al();
446 0x7: out_Ib_eAX();
447 }
448 0x1D: decode OPCODE_OP_BOTTOM3 {
376 0x0: call_Jz();
449 0x0: Inst::CALL(Jz);
377 0x1: jmp_Jz();
450 0x1: jmp_Jz();
378 0x2: jmp_Ap();
451 0x2: decode MODE_SUBMODE {
452 0x0: This_should_be_an_illegal_instruction();
453 default: jmp_Ap();
454 }
379 0x3: jmp_Jb();
380 0x4: in_Al_Dx();
381 0x5: in_eAX_Dx();
382 0x6: out_Dx_Al();
383 0x7: out_Dx_eAX();
384 }
385 0x1E: decode OPCODE_OP_BOTTOM3 {
386 0x0: M5InternalError::error(

--- 24 unchanged lines hidden ---
455 0x3: jmp_Jb();
456 0x4: in_Al_Dx();
457 0x5: in_eAX_Dx();
458 0x6: out_Dx_Al();
459 0x7: out_Dx_eAX();
460 }
461 0x1E: decode OPCODE_OP_BOTTOM3 {
462 0x0: M5InternalError::error(

--- 24 unchanged lines hidden ---