public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* h8300 assembler rejects upper-case letters after slash
@ 2003-07-15 19:53 Alexandre Oliva
  2003-07-16  5:43 ` Alan Modra
  2003-07-21  4:23 ` Alexandre Oliva
  0 siblings, 2 replies; 8+ messages in thread
From: Alexandre Oliva @ 2003-07-15 19:53 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 398 bytes --]

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?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: h8sx-lower-after-slash.patch --]
[-- Type: text/x-patch, Size: 1321 bytes --]

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;

[-- Attachment #3: Type: text/plain, Size: 289 bytes --]


-- 
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2003-07-21 17:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-15 19:53 h8300 assembler rejects upper-case letters after slash Alexandre Oliva
2003-07-16  5:43 ` Alan Modra
2003-07-16  5:53   ` Alexandre Oliva
2003-07-16  6:02     ` Alan Modra
2003-07-21  4:23 ` Alexandre Oliva
2003-07-21  9:03   ` Nick Clifton
2003-07-21 17:30     ` Alexandre Oliva
2003-07-21 17:36       ` Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).