This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

h8300 assembler rejects upper-case letters after slash


Even though the assembler is supposed to be case-insensitive as far as
opcodes are concerned, the fact that `/' is not a character that can
be part of a symbol gets the generic code to stop lower-casing the
opcode at the slash.  This patch introduces machine-specific code to
lower-case whatever opcode characters appear after a slash, as well as
the size character after the dot.  Ok to install?

Index: gas/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* config/tc-h8300.c (md_assemble): Make sure characters after
	slash and dot are lower-case.

Index: gas/config/tc-h8300.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-h8300.c,v
retrieving revision 1.34
diff -u -p -r1.34 tc-h8300.c
--- gas/config/tc-h8300.c 7 Jul 2003 09:33:01 -0000 1.34
+++ gas/config/tc-h8300.c 15 Jul 2003 19:45:27 -0000
@@ -1889,6 +1889,7 @@ md_assemble (str)
   const struct h8_instruction *prev_instruction;
 
   char *dot = 0;
+  char *slash = 0;
   char c;
   int size, i;
 
@@ -1908,6 +1909,8 @@ md_assemble (str)
 	  op_end += 2;
 	  break;
 	}
+      else if (*op_end == '/' && ! slash)
+	slash = op_end;
     }
 
   if (op_end == op_start)
@@ -1918,6 +1921,12 @@ md_assemble (str)
 
   *op_end = 0;
 
+  /* The assembler stops scanning the opcode at slashes, so it fails
+     to make characters following them lower case.  Fix them.  */
+  if (slash)
+    while (*++slash)
+      *slash = TOLOWER (*slash);
+
   instruction = (const struct h8_instruction *)
     hash_find (opcode_hash_control, op_start);
 
@@ -1950,7 +1959,7 @@ md_assemble (str)
   size = SN;
   if (dot)
     {
-      switch (*dot)
+      switch (TOLOWER (*dot))
 	{
 	case 'b':
 	  size = SB;
-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]