remove bigus code.
[deliverable/binutils-gdb.git] / opcodes / h8500-dis.c
index 856e580d7aee6a56e51717b4407f2bd6843ff7d1..16858c98fa686b6b63b458af0b06364669ebd078 100644 (file)
@@ -1,5 +1,5 @@
 /* Disassemble h8500 instructions.
-   Copyright (C) 1993 Free Software Foundation, Inc.
+   Copyright (C) 1993, 94, 95, 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
@@ -13,7 +13,7 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #include <stdio.h>
 
@@ -22,6 +22,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 #include "h8500-opc.h"
 #include "dis-asm.h"
+#include "opintl.h"
 
 /* Maximum length of an instruction.  */
 #define MAXLEN 8
@@ -50,7 +51,7 @@ fetch_data (info, addr)
      bfd_byte *addr;
 {
   int status;
-  struct private *priv = (struct private *)info->private_data;
+  struct private *priv = (struct private *) info->private_data;
   bfd_vma start = priv->insn_start + (priv->max_fetched - priv->the_buffer);
 
   status = (*info->read_memory_func) (start,
@@ -60,7 +61,7 @@ fetch_data (info, addr)
   if (status != 0)
     {
       (*info->memory_error_func) (status, start, info);
-      longjmp (priv->bailout);
+      longjmp (priv->bailout, 1);
     }
   else
     priv->max_fetched = addr;
@@ -72,7 +73,7 @@ static char *crname[] =
 
 int
 print_insn_h8500 (addr, info)
-     unsigned long addr;
+     bfd_vma addr;
      disassemble_info *info;
 {
   h8500_opcode_info *opcode;
@@ -82,27 +83,41 @@ print_insn_h8500 (addr, info)
   struct private priv;
   bfd_byte *buffer = priv.the_buffer;
 
-  info->private_data = (PTR) &priv;
+  info->private_data = (PTR) & priv;
   priv.max_fetched = priv.the_buffer;
   priv.insn_start = addr;
   if (setjmp (priv.bailout) != 0)
     /* Error return.  */
     return -1;
 
+if (0)  {
+    static    int one;
+    if (!one ) 
+      {
+       one = 1;
+       for (opcode = h8500_table; opcode->name; opcode++)
+         {
+           if ((opcode->bytes[0].contents & 0x8) == 0)
+             printf("%s\n", opcode->name);
+         }
+      }
+  }
+
+
   /* Run down the table to find the one which matches */
   for (opcode = h8500_table; opcode->name; opcode++)
     {
       int byte;
-      int rn;
-      int rd;
-      int rs;
-      int disp;
-      int abs;
-      int imm;
-      int pcrel;
-      int qim;
+      int rn = 0;
+      int rd = 0;
+      int rs = 0;
+      int disp = 0;
+      int abs = 0;
+      int imm = 0;
+      int pcrel = 0;
+      int qim = 0;
       int i;
-      int cr;
+      int cr = 0;
       for (byte = 0; byte < opcode->length; byte++)
        {
          FETCH_DATA (info, buffer + byte + 1);
@@ -120,7 +135,8 @@ print_insn_h8500 (addr, info)
                case FP:
                  break;
                default:
-                 func (stream, "can't cope with insert %d\n",
+                 /* xgettext:c-format */
+                 func (stream, _("can't cope with insert %d\n"),
                        opcode->bytes[byte].insert);
                  break;
                case RN:
@@ -292,11 +308,11 @@ print_insn_h8500 (addr, info)
                  {
                    if (imm & (1 << i))
                      {
+                       func (stream, "r%d", i);
                        if (nc)
                          func (stream, ",");
-                       nc += 1;
+                       nc = 1;
                      }
-                   func (stream, "r%d", i);
                  }
                func (stream, ")");
              }
@@ -324,7 +340,8 @@ print_insn_h8500 (addr, info)
     }
 
   /* Couldn't understand anything */
-  func (stream, "%02x\t\t*unknown*", buffer[0]);
+  /* xgettext:c-format */
+  func (stream, _("%02x\t\t*unknown*"), buffer[0]);
   return 1;
 
 }
This page took 0.026402 seconds and 4 git commands to generate.