static void ATTRIBUTE_PRINTF_3 i386_dis_printf (const instr_info *,
enum disassembler_style,
const char *, ...);
-static const char *prefix_name (const instr_info *, int, int);
/* This character is used to encode style information within the output
buffers. See oappend_insert_style for more details. */
mode_64bit
};
+static const char *prefix_name (enum address_mode, int, int);
+
enum x86_64_isa
{
amd64 = 1,
return -1;
if (ins->prefixes || ins->fwait_prefix >= 0 || (ins->rex & REX_OPCODE))
- name = prefix_name (ins, priv->the_buffer[0], priv->orig_sizeflag);
+ name = prefix_name (ins->address_mode, priv->the_buffer[0],
+ priv->orig_sizeflag);
if (name != NULL)
i386_dis_printf (ins, dis_style_mnemonic, "%s", name);
else
prefix byte. */
static const char *
-prefix_name (const instr_info *ins, int pref, int sizeflag)
+prefix_name (enum address_mode mode, int pref, int sizeflag)
{
static const char *rexes [16] =
{
case 0x66:
return (sizeflag & DFLAG) ? "data16" : "data32";
case 0x67:
- if (ins->address_mode == mode_64bit)
+ if (mode == mode_64bit)
return (sizeflag & AFLAG) ? "addr32" : "addr64";
else
return (sizeflag & AFLAG) ? "addr16" : "addr32";
i++)
i386_dis_printf (&ins, dis_style_mnemonic, "%s%s",
(i == 0 ? "" : " "),
- prefix_name (&ins, ins.all_prefixes[i], sizeflag));
+ prefix_name (ins.address_mode, ins.all_prefixes[i],
+ sizeflag));
ret = i;
goto out;
for (i = 0; i < ins.fwait_prefix && ins.all_prefixes[i];
i++)
i386_dis_printf (&ins, dis_style_mnemonic, "%s ",
- prefix_name (&ins, ins.all_prefixes[i], sizeflag));
+ prefix_name (ins.address_mode, ins.all_prefixes[i],
+ sizeflag));
i386_dis_printf (&ins, dis_style_mnemonic, "fwait");
ret = i + 1;
goto out;
for (i = 0; i < (int) ARRAY_SIZE (ins.all_prefixes); i++)
if (ins.all_prefixes[i])
{
- const char *name;
- name = prefix_name (&ins, ins.all_prefixes[i], orig_sizeflag);
+ const char *name = prefix_name (ins.address_mode, ins.all_prefixes[i],
+ orig_sizeflag);
+
if (name == NULL)
abort ();
prefix_length += strlen (name) + 1;