Skip to contentSkip to conversation

What do these instructions do??

Qemu-devel Davide 2 participants 2 messages Apr 5, 2012

lore
Share & tools
lore

Davide

author
#0 lore raw

In target-i386/translate.c there are this instructions:
int op, f, val;
op = (b >> 3) & 7;
f = (b >> 1) & 3;
if ((b & 1) == 0)
ot = OT_BYTE;
else
ot = dflag + OT_WORD;
What does this code do??

#1 lore raw
Quoted 9 lines

In target-i386/translate.c there are this instructions:
int op, f, val;
op = (b >> 3) & 7;
f = (b >> 1) & 3;
if ((b & 1) == 0)
  ot = OT_BYTE;
else
  ot = dflag + OT_WORD;
What does this code do??

It extracts some useful subfields from one-byte opcodes, e.g. op is the arithmetic
operation code, f is operand encoding and ot is operand width.

Table A2 in the Intel® 64 and IA-32 Architectures Developer's Manual: Vol. 2B
http://www.intel.com/content/www/us/en/architecture-and-technology/64-ia-32-architectures-software-developer-vol-2b-manual.html
will probably help.

Signature · 2 lines
Thanks.
-- Max