5
5
- the resultant file is machine generated, cgen-dis.in isn't
7
7
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2007,
8
2008 Free Software Foundation, Inc.
8
2008, 2010 Free Software Foundation, Inc.
10
10
This file is part of libopcodes.
63
#define CGEN_PRINT_NORMAL(cd, info, value, attrs, pc, length) \
66
if (CGEN_BOOL_ATTR ((attrs), CGEN_OPERAND_DOT_PREFIX)) \
67
info->fprintf_func (info->stream, "."); \
68
if (CGEN_BOOL_ATTR ((attrs), CGEN_OPERAND_POF_PREFIX)) \
69
info->fprintf_func (info->stream, "#pof:"); \
70
if (CGEN_BOOL_ATTR ((attrs), CGEN_OPERAND_PAG_PREFIX)) \
71
info->fprintf_func (info->stream, "#pag:"); \
63
/* Print an operand with a "." prefix.
64
NOTE: This prints the operand in hex.
65
??? This exists to maintain disassembler compatibility with previous
66
versions. Ideally we'd print the "." in print_dot. */
69
print_with_dot_prefix (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
72
unsigned attrs ATTRIBUTE_UNUSED,
73
bfd_vma pc ATTRIBUTE_UNUSED,
74
int length ATTRIBUTE_UNUSED)
76
disassemble_info *info = (disassemble_info *) dis_info;
78
info->fprintf_func (info->stream, ".");
79
info->fprintf_func (info->stream, "0x%lx", value);
82
/* Print an operand with a "#pof:" prefix.
83
NOTE: This prints the operand as an address.
84
??? This exists to maintain disassembler compatibility with previous
85
versions. Ideally we'd print "#pof:" in print_pof. */
88
print_with_pof_prefix (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
91
unsigned attrs ATTRIBUTE_UNUSED,
92
bfd_vma pc ATTRIBUTE_UNUSED,
93
int length ATTRIBUTE_UNUSED)
95
disassemble_info *info = (disassemble_info *) dis_info;
97
info->fprintf_func (info->stream, "#pof:");
98
info->fprintf_func (info->stream, "0x%lx", (long) value);
101
/* Print an operand with a "#pag:" prefix.
102
NOTE: This prints the operand in hex.
103
??? This exists to maintain disassembler compatibility with previous
104
versions. Ideally we'd print "#pag:" in print_pag. */
107
print_with_pag_prefix (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
110
unsigned attrs ATTRIBUTE_UNUSED,
111
bfd_vma pc ATTRIBUTE_UNUSED,
112
int length ATTRIBUTE_UNUSED)
114
disassemble_info *info = (disassemble_info *) dis_info;
116
info->fprintf_func (info->stream, "#pag:");
117
info->fprintf_func (info->stream, "0x%lx", value);
75
120
/* Print a 'pof:' prefix to an operand. */
271
316
print_pof (cd, info, 0, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
273
318
case XC16X_OPERAND_QBIT :
274
print_normal (cd, info, fields->f_qbit, 0|(1<<CGEN_OPERAND_DOT_PREFIX), pc, length);
319
print_with_dot_prefix (cd, info, fields->f_qbit, 0|(1<<CGEN_OPERAND_DOT_PREFIX), pc, length);
276
321
case XC16X_OPERAND_QHIBIT :
277
print_normal (cd, info, fields->f_qhibit, 0|(1<<CGEN_OPERAND_DOT_PREFIX), pc, length);
322
print_with_dot_prefix (cd, info, fields->f_qhibit, 0|(1<<CGEN_OPERAND_DOT_PREFIX), pc, length);
279
324
case XC16X_OPERAND_QLOBIT :
280
print_normal (cd, info, fields->f_qlobit, 0|(1<<CGEN_OPERAND_DOT_PREFIX), pc, length);
325
print_with_dot_prefix (cd, info, fields->f_qlobit, 0|(1<<CGEN_OPERAND_DOT_PREFIX), pc, length);
282
327
case XC16X_OPERAND_REG8 :
283
328
print_keyword (cd, info, & xc16x_cgen_opval_r8_names, fields->f_reg8, 0);
355
400
print_normal (cd, info, fields->f_uimm8, 0|(1<<CGEN_OPERAND_HASH_PREFIX), pc, length);
357
402
case XC16X_OPERAND_UPAG16 :
358
print_normal (cd, info, fields->f_uimm16, 0|(1<<CGEN_OPERAND_PAG_PREFIX), pc, length);
403
print_with_pag_prefix (cd, info, fields->f_uimm16, 0|(1<<CGEN_OPERAND_PAG_PREFIX), pc, length);
360
405
case XC16X_OPERAND_UPOF16 :
361
print_address (cd, info, fields->f_memory, 0|(1<<CGEN_OPERAND_POF_PREFIX), pc, length);
406
print_with_pof_prefix (cd, info, fields->f_memory, 0|(1<<CGEN_OPERAND_POF_PREFIX), pc, length);
363
408
case XC16X_OPERAND_USEG16 :
364
409
print_normal (cd, info, fields->f_offset16, 0|(1<<CGEN_OPERAND_SEG_PREFIX)|(1<<CGEN_OPERAND_RELOC)|(1<<CGEN_OPERAND_ABS_ADDR), pc, length);
432
473
disassemble_info *info = (disassemble_info *) dis_info;
434
#ifdef CGEN_PRINT_ADDRESS
435
CGEN_PRINT_ADDRESS (cd, info, value, attrs, pc, length);
438
475
/* Print the operand as directed by the attributes. */
439
476
if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_SEM_ONLY))
440
477
; /* Nothing to do. */