if (warn_p)
{
- info->fprintf_func (info->stream,
- _("\nWarning: disassembly may be wrong due to "
- "guessed opcode class choice.\n"
- "Use -M<class[,class]> to select the correct "
- "opcode class(es).\n\t\t\t\t"));
+ info->fprintf_styled_func
+ (info->stream, dis_style_text,
+ _("\nWarning: disassembly may be wrong due to "
+ "guessed opcode class choice.\n"
+ "Use -M<class[,class]> to select the correct "
+ "opcode class(es).\n\t\t\t\t"));
return t_op;
}
opcode = arcExtMap_genOpcode (i, isa_mask, &errmsg);
if (opcode == NULL)
{
- (*info->fprintf_func) (info->stream,
- _("An error occurred while generating the "
- "extension instruction operations"));
+ (*info->fprintf_styled_func)
+ (info->stream, dis_style_text,
+ _("An error occurred while generating "
+ "the extension instruction operations"));
*opcode_result = NULL;
return false;
}
name = arcExtMap_condCodeName (value);
if (name)
{
- (*info->fprintf_func) (info->stream, ".%s", name);
+ (*info->fprintf_styled_func) (info->stream, dis_style_mnemonic,
+ ".%s", name);
continue;
}
}
{
/* FIXME!: print correctly nt/t flag. */
if (!special_flag_p (opcode->name, flg_operand->name))
- (*info->fprintf_func) (info->stream, ".");
+ (*info->fprintf_styled_func) (info->stream,
+ dis_style_mnemonic, ".");
else if (info->insn_type == dis_dref)
{
switch (flg_operand->name[0])
if (cl_flags->flag_class & F_CLASS_WB)
arc_infop->writeback_mode = flg_operand->code;
- (*info->fprintf_func) (info->stream, "%s", flg_operand->name);
+ (*info->fprintf_styled_func) (info->stream, dis_style_mnemonic,
+ "%s", flg_operand->name);
}
}
}
switch (size)
{
case 1:
- (*info->fprintf_func) (info->stream, ".byte\t0x%02lx", data);
+ (*info->fprintf_styled_func) (info->stream,
+ dis_style_assembler_directive,
+ ".byte");
+ (*info->fprintf_styled_func) (info->stream, dis_style_text, "\t");
+ (*info->fprintf_styled_func) (info->stream, dis_style_immediate,
+ "0x%02lx", data);
break;
case 2:
- (*info->fprintf_func) (info->stream, ".short\t0x%04lx", data);
+ (*info->fprintf_styled_func) (info->stream,
+ dis_style_assembler_directive,
+ ".short");
+ (*info->fprintf_styled_func) (info->stream, dis_style_text, "\t");
+ (*info->fprintf_styled_func) (info->stream, dis_style_immediate,
+ "0x%04lx", data);
break;
case 4:
- (*info->fprintf_func) (info->stream, ".word\t0x%08lx", data);
+ (*info->fprintf_styled_func) (info->stream,
+ dis_style_assembler_directive,
+ ".word");
+ (*info->fprintf_styled_func) (info->stream, dis_style_text, "\t");
+ (*info->fprintf_styled_func) (info->stream, dis_style_immediate,
+ "0x%08lx", data);
break;
default:
return -1;
switch (insn_len)
{
case 2:
- (*info->fprintf_func) (info->stream, ".shor\t%#04llx",
- insn & 0xffff);
+ (*info->fprintf_styled_func) (info->stream,
+ dis_style_assembler_directive,
+ ".short");
+ (*info->fprintf_styled_func) (info->stream, dis_style_text, "\t");
+ (*info->fprintf_styled_func) (info->stream, dis_style_immediate,
+ "0x%04llx", insn & 0xffff);
break;
case 4:
- (*info->fprintf_func) (info->stream, ".word\t%#08llx",
- insn & 0xffffffff);
+ (*info->fprintf_styled_func) (info->stream,
+ dis_style_assembler_directive,
+ ".word");
+ (*info->fprintf_styled_func) (info->stream, dis_style_text, "\t");
+ (*info->fprintf_styled_func) (info->stream, dis_style_immediate,
+ "0x%08llx", insn & 0xffffffff);
break;
case 6:
- (*info->fprintf_func) (info->stream, ".long\t%#08llx",
- insn & 0xffffffff);
- (*info->fprintf_func) (info->stream, ".long\t%#04llx",
- (insn >> 32) & 0xffff);
+ (*info->fprintf_styled_func) (info->stream,
+ dis_style_assembler_directive,
+ ".long");
+ (*info->fprintf_styled_func) (info->stream, dis_style_text, "\t");
+ (*info->fprintf_styled_func) (info->stream, dis_style_immediate,
+ "0x%08llx", insn & 0xffffffff);
+ (*info->fprintf_styled_func) (info->stream, dis_style_text, " ");
+ (*info->fprintf_styled_func) (info->stream, dis_style_immediate,
+ "0x%04llx", (insn >> 32) & 0xffff);
break;
case 8:
- (*info->fprintf_func) (info->stream, ".long\t%#08llx",
- insn & 0xffffffff);
- (*info->fprintf_func) (info->stream, ".long\t%#08llx",
- insn >> 32);
+ (*info->fprintf_styled_func) (info->stream,
+ dis_style_assembler_directive,
+ ".long");
+ (*info->fprintf_styled_func) (info->stream, dis_style_text, "\t");
+ (*info->fprintf_styled_func) (info->stream, dis_style_immediate,
+ "0x%08llx", insn & 0xffffffff);
+ (*info->fprintf_styled_func) (info->stream, dis_style_text, " ");
+ (*info->fprintf_styled_func) (info->stream, dis_style_immediate,
+ "0x%08llx", (insn >> 32));
break;
default:
}
/* Print the mnemonic. */
- (*info->fprintf_func) (info->stream, "%s", opcode->name);
+ (*info->fprintf_styled_func) (info->stream, dis_style_mnemonic,
+ "%s", opcode->name);
/* Preselect the insn class. */
info->insn_type = arc_opcode_to_insn_type (opcode);
print_flags (opcode, &insn, info);
if (opcode->operands[0] != 0)
- (*info->fprintf_func) (info->stream, "\t");
+ (*info->fprintf_styled_func) (info->stream, dis_style_text, "\t");
need_comma = false;
open_braket = false;
{
if (open_braket && (operand->flags & ARC_OPERAND_BRAKET))
{
- (*info->fprintf_func) (info->stream, "]");
+ (*info->fprintf_styled_func) (info->stream, dis_style_text, "]");
open_braket = false;
continue;
}
if (operand->flags & ARC_OPERAND_COLON)
{
- (*info->fprintf_func) (info->stream, ":");
+ (*info->fprintf_styled_func) (info->stream, dis_style_text, ":");
continue;
}
if (need_comma)
- (*info->fprintf_func) (info->stream, ",");
+ (*info->fprintf_styled_func) (info->stream, dis_style_text,",");
if (!open_braket && (operand->flags & ARC_OPERAND_BRAKET))
{
- (*info->fprintf_func) (info->stream, "[");
+ (*info->fprintf_styled_func) (info->stream, dis_style_text, "[");
open_braket = true;
need_comma = false;
continue;
rname = arcExtMap_coreRegName (value);
if (!rname)
rname = regnames[value];
- (*info->fprintf_func) (info->stream, "%s", rname);
+ (*info->fprintf_styled_func) (info->stream, dis_style_register,
+ "%s", rname);
/* Check if we have a double register to print. */
if (operand->flags & ARC_OPERAND_TRUNCATE)
else
rname = _("\nWarning: illegal use of double register "
"pair.\n");
- (*info->fprintf_func) (info->stream, "%s", rname);
+ (*info->fprintf_styled_func) (info->stream, dis_style_register,
+ "%s", rname);
}
if (value == 63)
rpcl = true;
const char *rname = get_auxreg (opcode, value, isa_mask);
if (rname && open_braket)
- (*info->fprintf_func) (info->stream, "%s", rname);
+ (*info->fprintf_styled_func) (info->stream, dis_style_register,
+ "%s", rname);
else
{
- (*info->fprintf_func) (info->stream, "%#x", value);
+ (*info->fprintf_styled_func) (info->stream, dis_style_immediate,
+ "%#x", value);
if (info->insn_type == dis_branch
|| info->insn_type == dis_jsr)
info->target = (bfd_vma) value;
{
const char *rname = get_auxreg (opcode, value, isa_mask);
if (rname && open_braket)
- (*info->fprintf_func) (info->stream, "%s", rname);
+ (*info->fprintf_styled_func) (info->stream, dis_style_register,
+ "%s", rname);
else
{
if (print_hex)
- (*info->fprintf_func) (info->stream, "%#x", value);
+ (*info->fprintf_styled_func) (info->stream, dis_style_immediate,
+ "%#x", value);
else
- (*info->fprintf_func) (info->stream, "%d", value);
+ (*info->fprintf_styled_func) (info->stream, dis_style_immediate,
+ "%d", value);
}
}
else if (operand->flags & ARC_OPERAND_ADDRTYPE)
{
const char *addrtype = get_addrtype (value);
- (*info->fprintf_func) (info->stream, "%s", addrtype);
+ (*info->fprintf_styled_func) (info->stream, dis_style_address,
+ "%s", addrtype);
/* A colon follow an address type. */
need_comma = false;
}
need_comma = false;
break;
case 1:
- (*info->fprintf_func) (info->stream, "r13");
+ (*info->fprintf_styled_func) (info->stream,
+ dis_style_register, "r13");
break;
default:
- (*info->fprintf_func) (info->stream, "r13-%s",
- regnames[13 + value - 1]);
+ (*info->fprintf_styled_func) (info->stream,
+ dis_style_register, "r13");
+ (*info->fprintf_styled_func) (info->stream,
+ dis_style_text, "-");
+ (*info->fprintf_styled_func) (info->stream,
+ dis_style_register, "%s",
+ regnames[13 + value - 1]);
break;
}
rpcl = false;
{
const char *rname = get_auxreg (opcode, value, isa_mask);
if (rname && open_braket)
- (*info->fprintf_func) (info->stream, "%s", rname);
+ (*info->fprintf_styled_func) (info->stream, dis_style_register,
+ "%s", rname);
else
- (*info->fprintf_func) (info->stream, "%#x", value);
+ (*info->fprintf_styled_func) (info->stream, dis_style_immediate,
+ "%" PRIx32, value);
}
}
the addend is not currently pc-relative. */
memaddr = 0;
- (*info->fprintf_func) (info->stream, "\t;");
+ (*info->fprintf_styled_func) (info->stream,
+ dis_style_comment_start, "\t;");
(*info->print_address_func) ((memaddr & ~3) + vpcl, info);
}