These are actually Ken's patches--I told him I'd take move them from
authorIan Lance Taylor <ian@airs.com>
Tue, 10 Nov 1992 20:09:23 +0000 (20:09 +0000)
committerIan Lance Taylor <ian@airs.com>
Tue, 10 Nov 1992 20:09:23 +0000 (20:09 +0000)
p3 into devo.

* tc-m68k.c (m68k_reg_parse): If REGISTER_PREFIX isn't defined,
still accept (but don't require) OPTIONAL_REGISTER_PREFIX before
the register name.
* tc-m68k.h (OPTIONAL_REGISTER_PREFIX): Define to be "%", if not
M68KCOFF.

gas/config/ChangeLog
gas/config/tc-m68k.c

index ded8a99c379914506121eb7780cb0cbe072ffc8b..6d919ac10ffd4dc99fa003d7e6f9051329513cad 100644 (file)
@@ -1,5 +1,11 @@
 Tue Nov 10 09:50:25 1992  Ian Lance Taylor  (ian@cygnus.com)
 
+       * tc-m68k.c (m68k_reg_parse): If REGISTER_PREFIX isn't defined,
+       still accept (but don't require) OPTIONAL_REGISTER_PREFIX before
+       the register name.
+       * tc-m68k.h (OPTIONAL_REGISTER_PREFIX): Define to be "%", if not
+       M68KCOFF.
+
        * obj-coffbfd.c (fill_section): set STYP_NOLOAD bit for .bss
        section.
 
index 7b6df192efd1eae7d83fa256534210c2f5d858a1..775f9306afab351924f1916225de59ae2e6f2e50 100644 (file)
@@ -579,42 +579,43 @@ static char alt_notend_table[256];
  * advance the pointer.
  */
 
-enum _register
-m68k_reg_parse(ccp)
-     register char **ccp;
+enum _register m68k_reg_parse(ccp)
+register char **ccp;
 {
   char *start = *ccp;
+  char c;
+  char *p;
+  symbolS *symbolP;
 
 #ifdef REGISTER_PREFIX
-  if (*start == REGISTER_PREFIX)
-    ++start;
+  if (*start != REGISTER_PREFIX)
+    return FAIL;
+  p = start + 1;
+#else
+  p = start;
+  if (*p == OPTIONAL_REGISTER_PREFIX)
+    p++, start++;
 #endif
+  if (!isalpha (*p) || !is_name_beginner (*p))
+    return FAIL;
 
-  if (isalpha(*start) &&  is_name_beginner(*start))
-  {
-    char c;
-    char *p = start;
-    symbolS *symbolP;
-
-    c = *p++;
-    while (isalpha(c) || isdigit(c) || c == '_')
-      {
-       c = *p++;
-      }
+  c = *p++;
+  while (isalpha(c) || isdigit(c) || c == '_')
+    {
+      c = *p++;
+    }
 
-    * -- p = 0;
-    symbolP = symbol_find(start);
-    *p  = c;
+  * -- p = 0;
+  symbolP = symbol_find(start);
+  *p  = c;
 
-    if (symbolP && S_GET_SEGMENT(symbolP) == SEG_REGISTER)
+  if (symbolP && S_GET_SEGMENT(symbolP) == SEG_REGISTER)
     {
       *ccp = p;
       return  S_GET_VALUE(symbolP);
     }
-  }
-  return FAIL;
-
 
+  return FAIL;
 }
 
 #define SKIP_WHITE()   { str++; if(*str==' ') str++;}
@@ -3373,6 +3374,9 @@ void
 #ifdef REGISTER_PREFIX
        alt_notend_table[REGISTER_PREFIX] = 1;
 #endif
+#ifdef OPTIONAL_REGISTER_PREFIX
+       alt_notend_table[OPTIONAL_REGISTER_PREFIX] = 1;
+#endif
 
 #ifndef MIT_SYNTAX_ONLY
        /* Insert pseudo ops, these have to go into the opcode table since