From 0069b1f670b74e6893a58f827c64d63bcc10450b Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 10 Nov 1992 20:09:23 +0000 Subject: [PATCH] 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. --- gas/config/ChangeLog | 6 ++++++ gas/config/tc-m68k.c | 50 ++++++++++++++++++++++++-------------------- 2 files changed, 33 insertions(+), 23 deletions(-) diff --git a/gas/config/ChangeLog b/gas/config/ChangeLog index ded8a99c379..6d919ac10ff 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 7b6df192efd..775f9306afa 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 -- 2.30.2