/* Local function prototypes */
+static int
+fetch_data PARAMS ((struct disassemble_info *, bfd_byte *));
+
+static void
+dummy_print_address PARAMS ((bfd_vma, struct disassemble_info *));
+
static int
fetch_arg PARAMS ((unsigned char *, int, int, disassemble_info *));
(p += 4, FETCH_DATA (info, p), \
(COERCE32 ((((((p[-4] << 8) + p[-3]) << 8) + p[-2]) << 8) + p[-1])))
-/* NEXTSINGLE and NEXTDOUBLE handle alignment problems, but not
- * byte-swapping or other float format differences. FIXME! */
-
-union number {
- double d;
- float f;
- char c[10];
-};
-
+/* Get a single precision float. */
#define NEXTSINGLE(val, p) \
- { unsigned int i; union number u;\
- FETCH_DATA (info, p + sizeof (float));\
- for (i = 0; i < sizeof(float); i++) u.c[i] = *p++; \
- val = u.f; }
+ (p += 4, FETCH_DATA (info, p), \
+ floatformat_to_double (&floatformat_ieee_single_big, (char *) p - 4, &val))
+/* Get a double precision float. */
#define NEXTDOUBLE(val, p) \
- { unsigned int i; union number u;\
- FETCH_DATA (info, p + sizeof (double));\
- for (i = 0; i < sizeof(double); i++) u.c[i] = *p++; \
- val = u.d; }
+ (p += 8, FETCH_DATA (info, p), \
+ floatformat_to_double (&floatformat_ieee_double_big, (char *) p - 8, &val))
-/* Need a function to convert from extended to double precision... */
-#define NEXTEXTEND(p) \
- (p += 12, FETCH_DATA (info, p), 0.0)
+/* Get an extended precision float. */
+#define NEXTEXTEND(val, p) \
+ (p += 12, FETCH_DATA (info, p), \
+ floatformat_to_double (&floatformat_m68881_ext, (char *) p - 12, &val))
/* Need a function to convert from packed to double
precision. Actually, it's easier to print a
#endif
{ return 0; }
-void
+static void
dummy_print_address (vma, info)
bfd_vma vma;
struct disassemble_info *info;
}
info->private_data = (PTR) &priv;
+ /* Tell objdump to use two bytes per chunk and six bytes per line for
+ displaying raw data. */
+ info->bytes_per_chunk = 2;
+ info->bytes_per_line = 6;
+ info->display_endian = BFD_ENDIAN_BIG;
priv.max_fetched = priv.the_buffer;
priv.insn_start = memaddr;
if (setjmp (priv.bailout) != 0)
break;
}
}
- /* Some opcodes like pflusha and lpstop are exceptions; they take no
- arguments but are two words long. Recognize them by looking at
- the lower 16 bits of the mask. */
+
+ /* pflusha is an exceptions. It takes no arguments but is two words
+ long. Recognize it by looking at the lower 16 bits of the mask. */
if (p - buffer < 4 && (best->match & 0xFFFF) != 0)
p = buffer + 4;
-
+
+ /* lpstop is another exception. It takes a one word argument but is
+ three words long. */
+ if (p - buffer < 6
+ && (best->match & 0xffff) == 0xffff
+ && best->args[0] == '#'
+ && best->args[1] == 'w')
+ {
+ /* Copy the one word argument into the usual location for a one
+ word argument, to simplify printing it. We can get away with
+ this because we know exactly what the second word is, and we
+ aren't going to print anything based on it. */
+ p = buffer + 6;
+ FETCH_DATA (info, p);
+ buffer[2] = buffer[4];
+ buffer[3] = buffer[5];
+ }
+
FETCH_DATA (info, p);
d = best->args;
{"%tc", 0x003}, {"%itt0",0x004}, {"%itt1", 0x005},
{"%dtt0",0x006}, {"%dtt1",0x007}, {"%buscr",0x008},
{"%usp", 0x800}, {"%vbr", 0x801}, {"%caar", 0x802},
- {"%msp", 0x803}, {"%ibsp", 0x804},
+ {"%msp", 0x803}, {"%isp", 0x804},
/* Should we be calling this psr like we do in case 'Y'? */
{"%mmusr",0x805},
val = NEXTWORD (p);
(*info->fprintf_func)
(info->stream, "%s@(%d)",
- reg_names[fetch_arg (buffer, place, 3, info)], val);
+ reg_names[fetch_arg (buffer, place, 3, info) + 8], val);
break;
case 's':
case '?':
case '/':
case '&':
- case '`':
case '|':
case '<':
case '>':
case 2:
val = NEXTWORD (p);
+ (*info->fprintf_func) (info->stream, "%%pc@(");
(*info->print_address_func) (addr + val, info);
+ (*info->fprintf_func) (info->stream, ")");
break;
case 3:
break;
case 'x':
- FETCH_DATA (info, p + 12);
- floatformat_to_double (&floatformat_m68881_ext,
- (char *) p, &flval);
- p += 12;
+ NEXTEXTEND(flval, p);
break;
case 'p':
{"lea", one(0040700), one(0170700), "!sAd", m68000up | mcf5200 },
-{"lpstop", two(0174000,0000700), two(0177777,0177777), "", cpu32|m68060 },
+{"lpstop", two(0174000,0000700),two(0177777,0177777),"#w", cpu32|m68060 },
{"linkw", one(0047120), one(0177770), "As#w", m68000up | mcf5200 },
{"linkl", one(0044010), one(0177770), "As#l", m68020up | cpu32 },
#define TBL1(name,signed,round,size) \
{name, two(0174000, (signed<<11)|(!round<<10)|(size<<6)|0000400), \
- two(0177700,0107777), "`sD1", cpu32 }, \
+ two(0177700,0107777), "!sD1", cpu32 }, \
{name, two(0174000, (signed<<11)|(!round<<10)|(size<<6)), \
two(0177770,0107770), "DsD3D1", cpu32 }
#define TBL(name1, name2, name3, s, r) \