X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=opcodes%2Fh8300-dis.c;h=57753a98d548d6386ea67eeb5983603500be977f;hb=06b53c1bff55150114af371602cb278d5325cf4e;hp=659ead83671cd111452b2715800bae0b001bc2a1;hpb=52aa53362eb354df48dbeed236ef7576e13bffac;p=deliverable%2Fbinutils-gdb.git diff --git a/opcodes/h8300-dis.c b/opcodes/h8300-dis.c index 659ead8367..57753a98d5 100644 --- a/opcodes/h8300-dis.c +++ b/opcodes/h8300-dis.c @@ -1,5 +1,5 @@ /* Disassemble h8300 instructions. - Copyright (C) 1993 Free Software Foundation, Inc. + Copyright (C) 1993, 1998 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define h8_opcodes h8ops #include "opcode/h8300.h" #include "dis-asm.h" +#include "opintl.h" /* Run through the opcodes and sort them into order to make them easy @@ -209,8 +210,7 @@ bfd_h8_disassemble (addr, info, mode) else if (looking_for & L_24) { int i = len >> 1; - abs = (data[i] << 16) | (data[i + 1] << 8)| (data[i+ - 2]); + abs = (data[i] << 16) | (data[i + 1] << 8)| (data[i+2]); plen =24; } else if (looking_for & IGNORE) @@ -252,6 +252,10 @@ bfd_h8_disassemble (addr, info, mode) plen = 2; abs = thisnib & 0x3; } + else if (looking_for & MACREG) + { + abs = (thisnib == 3); + } else if (looking_for == E) { @@ -268,6 +272,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; @@ -311,7 +339,10 @@ bfd_h8_disassemble (addr, info, mode) } } - + else if (x & MACREG) + { + fprintf (stream, "mac%c", abs ? 'l' : 'h'); + } else if (x & INC) { fprintf (stream, "@%s+", pregnames[rs]); @@ -368,9 +399,9 @@ bfd_h8_disassemble (addr, info, mode) { fprintf (stream, "exr"); } - else - fprintf (stream, "Hmmmm %x", x); + /* xgettext:c-format */ + fprintf (stream, _("Hmmmm %x"), x); hadone = 1; args++; } @@ -381,7 +412,8 @@ bfd_h8_disassemble (addr, info, mode) else { - fprintf (stream, "Dont understand %x \n", looking_for); + /* xgettext:c-format */ + fprintf (stream, _("Don't understand %x \n"), looking_for); } }