X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=opcodes%2Fh8300-dis.c;h=b3a9496d5c10767c4f15d82446748371eca42294;hb=15a4be0cfa4413029985eaeb9b8828f382273b96;hp=3ba4d8ba18018422cca3e4b206f10ff778c47384;hpb=0decb7fde3e3c5dd32a7850fc3cacea8e11bcdb3;p=deliverable%2Fbinutils-gdb.git diff --git a/opcodes/h8300-dis.c b/opcodes/h8300-dis.c index 3ba4d8ba18..b3a9496d5c 100644 --- a/opcodes/h8300-dis.c +++ b/opcodes/h8300-dis.c @@ -234,6 +234,8 @@ bfd_h8_disassemble (addr, info, mode) case 0: abs = 1; break; + default: + goto fail; } } else if (looking_for & L_8) @@ -243,12 +245,12 @@ bfd_h8_disassemble (addr, info, mode) } else if (looking_for & L_3) { - bit = thisnib; + bit = thisnib & 0x7; } else if (looking_for & L_2) { plen = 2; - abs = thisnib; + abs = thisnib & 0x3; } else if (looking_for == E) { @@ -266,6 +268,30 @@ bfd_h8_disassemble (addr, info, mode) } } fprintf (stream, "%s\t", q->name); + + /* Gross. Disgusting. */ + if (strcmp (q->name, "ldm.l") == 0) + { + int count, high; + + count = (data[1] >> 4) & 0x3; + high = data[3] & 0x7; + + fprintf (stream, "@sp+,er%d-er%d", high - count, high); + return q->length; + } + + if (strcmp (q->name, "stm.l") == 0) + { + int count, low; + + count = (data[1] >> 4) & 0x3; + low = data[3] & 0x7; + + fprintf (stream, "er%d-er%d,@-sp", low, low + count); + return q->length; + } + /* Fill in the args */ { op_type *args = q->args.nib; @@ -285,6 +311,10 @@ bfd_h8_disassemble (addr, info, mode) } else if (x & (IMM|KBIT|DBIT)) { + /* Bletch. For shal #2,er0 and friends. */ + if (*(args+1) & SRC_IN_DST) + abs = 2; + fprintf (stream, "#0x%x", (unsigned) abs); } else if (x & REG) @@ -356,9 +386,12 @@ bfd_h8_disassemble (addr, info, mode) else if (x & CCR) { - fprintf (stream, "ccr"); } + else if (x & EXR) + { + fprintf (stream, "exr"); + } else fprintf (stream, "Hmmmm %x", x);