aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1992-11-10 20:09:23 +0000
committerIan Lance Taylor <ian@airs.com>1992-11-10 20:09:23 +0000
commit0069b1f670b74e6893a58f827c64d63bcc10450b (patch)
tree9489288d8bdc667bbbff7a892d3d71af501ab55b
parent587c4264e020987b332577135abfefdbb3dee699 (diff)
downloadgdb-0069b1f670b74e6893a58f827c64d63bcc10450b.zip
gdb-0069b1f670b74e6893a58f827c64d63bcc10450b.tar.gz
gdb-0069b1f670b74e6893a58f827c64d63bcc10450b.tar.bz2
These are actually Ken's patches--I told him I'd take move them from
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.
-rw-r--r--gas/config/ChangeLog6
-rw-r--r--gas/config/tc-m68k.c50
2 files changed, 33 insertions, 23 deletions
diff --git a/gas/config/ChangeLog b/gas/config/ChangeLog
index ded8a99..6d919ac 100644
--- a/gas/config/ChangeLog
+++ b/gas/config/ChangeLog
@@ -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.
diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c
index 7b6df19..775f930 100644
--- a/gas/config/tc-m68k.c
+++ b/gas/config/tc-m68k.c
@@ -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