Fix copyright notices
[deliverable/binutils-gdb.git] / gas / config / tc-m88k.c
index eaf994f8aec5d3fc9afcabb41c3b12909d066e67..a5842d11bcd381e9ce1c8b242840dbe03734e05e 100644 (file)
@@ -1,13 +1,15 @@
 /* m88k.c -- Assembler for the Motorola 88000
    Contributed by Devon Bowen of Buffalo University
    and Torbjorn Granlund of the Swedish Institute of Computer Science.
-   Copyright (C) 1989, 1990, 1991, 1993 Free Software Foundation, Inc.
+   Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1999,
+   2000
+   Free Software Foundation, Inc.
 
 This file is part of GAS, the GNU Assembler.
 
 GAS is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 1, or (at your option)
+the Free Software Foundation; either version 2, or (at your option)
 any later version.
 
 GAS is distributed in the hope that it will be useful,
@@ -16,11 +18,13 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with GAS; see the file COPYING.  If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+along with GAS; see the file COPYING.  If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA.  */
 
 #include <ctype.h>
 #include "as.h"
+#include "subsegs.h"
 #include "m88k-opcode.h"
 
 struct field_val_assoc
@@ -135,7 +139,6 @@ static char *get_pcr PARAMS ((char *param, struct m88k_insn *insn,
 static int calcop PARAMS ((struct m88k_opcode *format,
                           char *param, struct m88k_insn *insn));
 
-
 extern char *myname;
 static struct hash_control *op_hash = NULL;
 
@@ -146,7 +149,7 @@ int md_seg_align = 7;
    another comment */
 const char comment_chars[] = ";";
 
-/* These chars only start a comment at the beginning of a line. */
+/* These chars only start a comment at the beginning of a line.  */
 const char line_comment_chars[] = "#";
 
 const char line_separator_chars[] = "";
@@ -173,9 +176,9 @@ const pseudo_typeS md_pseudo_table[] =
   {"bss", s_lcomm, 1},
   {"string", stringer, 0},
   {"word", cons, 4},
-  {"zero", s_space, 0},
   /* Force set to be treated as an instruction.  */
   {"set", NULL, 0},
+  {".set", s_set, 0},
   {0}
 };
 
@@ -200,7 +203,7 @@ md_begin ()
       retval = hash_insert (op_hash, name, &m88k_opcodes[i]);
 
       if (retval != NULL)
-       as_fatal ("Can't hash instruction '%s':%s",
+       as_fatal (_("Can't hash instruction '%s':%s"),
                  m88k_opcodes[i].name, retval);
 
       /* skip to next unique mnemonic or end of list */
@@ -209,16 +212,27 @@ md_begin ()
        ;
     }
 }
+\f
+CONST char *md_shortopts = "";
+struct option md_longopts[] = {
+  {NULL, no_argument, NULL, 0}
+};
+size_t md_longopts_size = sizeof (md_longopts);
 
 int
-md_parse_option (argP, cntP, vecP)
-     char **argP;
-     int *cntP;
-     char ***vecP;
+md_parse_option (c, arg)
+     int c;
+     char *arg;
 {
   return 0;
 }
 
+void
+md_show_usage (stream)
+     FILE *stream;
+{
+}
+\f
 void
 md_assemble (op)
      char *op;
@@ -241,7 +255,7 @@ md_assemble (op)
 
   if ((format = (struct m88k_opcode *) hash_find (op_hash, op)) == NULL)
     {
-      as_bad ("Invalid mnemonic '%s'", op);
+      as_bad (_("Invalid mnemonic '%s'"), op);
       return;
     }
 
@@ -261,7 +275,7 @@ md_assemble (op)
        format++;
       else
        {
-         as_fatal ("Parameter syntax error");
+         as_fatal (_("Parameter syntax error"));
          return;
        }
     }
@@ -316,7 +330,7 @@ md_assemble (op)
       break;
 
     default:
-      as_fatal ("Unknown relocation type");
+      as_fatal (_("Unknown relocation type"));
       break;
     }
 }
@@ -429,7 +443,7 @@ calcop (format, param, insn)
        case '?':
          /* Having this here repeats the warning somtimes.
           But can't we stand that?  */
-         as_warn ("Use of obsolete instruction");
+         as_warn (_("Use of obsolete instruction"));
          break;
        }
     }
@@ -546,7 +560,7 @@ get_imm16 (param, insn)
        {
          /* Warn about too big expressions if not surrounded by xx16.  */
          if (val > 0xffff)
-           as_warn ("Expression truncated to 16 bits");
+           as_warn (_("Expression truncated to 16 bits"));
        }
 
       if (reloc == RELOC_HI16)
@@ -612,7 +626,7 @@ get_cmp (param, valp)
 
       if (val >= 32)
        {
-         as_warn ("Expression truncated to 5 bits");
+         as_warn (_("Expression truncated to 5 bits"));
          val %= 32;
        }
     }
@@ -634,7 +648,7 @@ get_cnd (param, valp)
 
       if (val >= 32)
        {
-         as_warn ("Expression truncated to 5 bits");
+         as_warn (_("Expression truncated to 5 bits"));
          val %= 32;
        }
     }
@@ -856,7 +870,7 @@ get_vec9 (param, valp)
   input_line_pointer = save_ptr;
 
   if (val >= 1 << 9)
-    as_warn ("Expression truncated to 9 bits");
+    as_warn (_("Expression truncated to 9 bits"));
 
   *valp = val % (1 << 9);
 
@@ -878,7 +892,7 @@ get_o6 (param, valp)
   input_line_pointer = save_ptr;
 
   if (val & 0x3)
-    as_warn ("Removed lower 2 bits of expression");
+    as_warn (_("Removed lower 2 bits of expression"));
 
   *valp = val;
 
@@ -1017,7 +1031,7 @@ md_number_to_imm (buf, val, nbytes, fixP, seg_type)
       break;
 
     default:
-      as_fatal ("Bad relocation type");
+      as_fatal (_("Bad relocation type"));
       break;
     }
 }
@@ -1030,7 +1044,7 @@ md_number_to_disp (buf, val, nbytes)
      int val;
      int nbytes;
 {
-  as_fatal ("md_number_to_disp not defined");
+  as_fatal (_("md_number_to_disp not defined"));
   md_number_to_chars (buf, val, nbytes);
 }
 
@@ -1040,7 +1054,7 @@ md_number_to_field (buf, val, nbytes)
      int val;
      int nbytes;
 {
-  as_fatal ("md_number_to_field not defined");
+  as_fatal (_("md_number_to_field not defined"));
   md_number_to_chars (buf, val, nbytes);
 }
 
@@ -1060,7 +1074,6 @@ md_atof (type, litP, sizeP)
   LITTLENUM_TYPE words[MAX_LITTLENUMS];
   LITTLENUM_TYPE *wordP;
   char *t;
-  char *atof_ieee ();
 
   switch (type)
     {
@@ -1090,7 +1103,7 @@ md_atof (type, litP, sizeP)
 
     default:
       *sizeP = 0;
-      return "Bad call to MD_ATOF()";
+      return _("Bad call to MD_ATOF()");
     }
   t = atof_ieee (input_line_pointer, type, words);
   if (t)
@@ -1154,25 +1167,16 @@ md_estimate_size_before_relax (fragP, segment_type)
      fragS *fragP;
      segT segment_type;
 {
-  as_fatal ("Relaxation should never occur");
+  as_fatal (_("Relaxation should never occur"));
   return (-1);
 }
 
-const relax_typeS md_relax_table[] =
-{0};
-
-void
-md_end ()
-{
-}
-
 #if 0
 
 /* As far as I can tell, this routine is never called.  What is it
    doing here?
    Ian Taylor, Cygnus Support 13 Jul 1993 */
 
-
 /*
  * Risc relocations are completely different, so it needs
  * this machine dependent routine to emit them.
@@ -1209,9 +1213,9 @@ emit_relocations (fixP, segment_address_in_file)
              ri.r_extern = 0;
              ri.r_symbolnum = symbolP->sy_type & N_TYPE;
            }
-         if (symbolP && symbolP->sy_frag)
+         if (symbolP && symbol_get_frag (symbolP))
            {
-             ri.r_addend = symbolP->sy_frag->fr_address;
+             ri.r_addend = symbol_get_frag (symbolP)->fr_address;
            }
          ri.r_type = fixP->fx_r_type;
          if (fixP->fx_pcrel)
@@ -1235,7 +1239,6 @@ emit_relocations (fixP, segment_address_in_file)
 /* This routine can be subsumed by s_lcomm in read.c.
    Ian Taylor, Cygnus Support 13 Jul 1993 */
 
-
 static void
 s_bss ()
 {
@@ -1252,14 +1255,14 @@ s_bss ()
   SKIP_WHITESPACE ();
   if (*input_line_pointer != ',')
     {
-      as_warn ("Expected comma after name");
+      as_warn (_("Expected comma after name"));
       ignore_rest_of_line ();
       return;
     }
   input_line_pointer++;
   if ((temp = get_absolute_expression ()) < 0)
     {
-      as_warn ("BSS length (%d.) <0! Ignored.", temp);
+      as_warn (_("BSS length (%d.) <0! Ignored."), temp);
       ignore_rest_of_line ();
       return;
     }
@@ -1286,15 +1289,15 @@ s_bss ()
          subseg_set (SEG_BSS, 1); /* switch to bss     */
 
          if (bss_align)
-           frag_align (bss_align, 0);
+           frag_align (bss_align, 0, 0);
 
          /* detach from old frag */
-         if (symbolP->sy_type == N_BSS && symbolP->sy_frag != NULL)
-           symbolP->sy_frag->fr_symbol = NULL;
+         if (symbolP->sy_type == N_BSS && symbol_get_frag (symbolP) != NULL)
+           symbol_get_frag (symbolP)->fr_symbol = NULL;
 
-         symbolP->sy_frag  = frag_now;
+         symbol_set_frag (symbolP, frag_now);
          p = frag_var (rs_org, 1, 1, (relax_substateT)0, symbolP,
-                       temp, (char *)0);
+                       (offsetT) temp, (char *)0);
          *p = 0;
          S_SET_SEGMENT (symbolP, SEG_BSS);
 
@@ -1303,10 +1306,10 @@ s_bss ()
     }
   else
     {
-      as_warn ("Ignoring attempt to re-define symbol %s.", name);
+      as_warn (_("Ignoring attempt to re-define symbol %s."), name);
     }
 
-  while (!is_end_of_line[*input_line_pointer])
+  while (!is_end_of_line[(unsigned char) *input_line_pointer])
     {
       input_line_pointer++;
     }
@@ -1425,4 +1428,34 @@ md_pcrel_from (fixp)
   /*NOTREACHED*/
 }
 
+/* Fill in rs_align_code fragments.  */
+
+void
+m88k_handle_align (fragp)
+     fragS *fragp;
+{
+  static const unsigned char nop_pattern[] = { 0xf4, 0x00, 0x58, 0x00 };
+
+  int bytes;
+  char *p;
+
+  if (fragp->fr_type != rs_align_code)
+    return;
+
+  bytes = fragp->fr_next->fr_address - fragp->fr_address - fragp->fr_fix;
+  p = fragp->fr_literal + fragp->fr_fix;
+
+  if (bytes & 3)
+    {
+      int fix = bytes & 3;
+      memset (p, 0, fix);
+      p += fix;
+      bytes -= fix;
+      fragp->fr_fix += fix;
+    }
+
+  memcpy (p, nop_pattern, 4);
+  fragp->fr_var = 4;
+}
+
 #endif /* M88KCOFF */
This page took 0.032266 seconds and 4 git commands to generate.