diff options
author | Timothy Wall <twall@alum.mit.edu> | 2000-02-08 14:21:53 +0000 |
---|---|---|
committer | Timothy Wall <twall@alum.mit.edu> | 2000-02-08 14:21:53 +0000 |
commit | 8fccee7d15db99749d55578d263a8aeaa678f5e6 (patch) | |
tree | 3856a694d057ecfbb47a2b0cfe22d6066004a3bb /gas/expr.c | |
parent | 4cac54185326dd641c3355b231cfbe06491e413f (diff) | |
download | binutils-redhat-8fccee7d15db99749d55578d263a8aeaa678f5e6.tar.gz |
Add handling for numbers with suffixed radix.
Diffstat (limited to 'gas/expr.c')
-rw-r--r-- | gas/expr.c | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/gas/expr.c b/gas/expr.c index ced12395bb..e2e64991e4 100644 --- a/gas/expr.c +++ b/gas/expr.c @@ -327,7 +327,7 @@ integer_constant (radix, expressionP) #define valuesize 32 #endif - if (flag_m68k_mri && radix == 0) + if ((NUMBERS_WITH_SUFFIX || flag_m68k_mri) && radix == 0) { int flt = 0; @@ -541,7 +541,9 @@ integer_constant (radix, expressionP) } } - if (flag_m68k_mri && suffix != NULL && input_line_pointer - 1 == suffix) + if ((NUMBERS_WITH_SUFFIX || flag_m68k_mri) + && suffix != NULL + && input_line_pointer - 1 == suffix) c = *input_line_pointer++; if (small) @@ -810,13 +812,15 @@ operand (expressionP) case '9': input_line_pointer--; - integer_constant (flag_m68k_mri ? 0 : 10, expressionP); + integer_constant ((NUMBERS_WITH_SUFFIX || flag_m68k_mri) + ? 0 : 10, + expressionP); break; case '0': /* non-decimal radix */ - if (flag_m68k_mri) + if (NUMBERS_WITH_SUFFIX || flag_m68k_mri) { char *s; @@ -829,8 +833,26 @@ operand (expressionP) integer_constant (0, expressionP); break; } - } - + if (NUMBERS_WITH_SUFFIX) + { + /* Check for a binary constant. */ + for (s = input_line_pointer; *s == '0' || *s == '1'; s++) + ; + if (toupper (*s) == 'B') + { + integer_constant (0, expressionP); + break; + } + /* Check for an octal constant. */ + for (s = input_line_pointer; *s >= '0' && *s <= '7'; s++) + ; + if (toupper (*s) == 'Q') + { + integer_constant (0, expressionP); + break; + } + } + } c = *input_line_pointer; switch (c) { @@ -840,7 +862,7 @@ operand (expressionP) case 'Q': case '8': case '9': - if (flag_m68k_mri) + if (NUMBERS_WITH_SUFFIX || flag_m68k_mri) { integer_constant (0, expressionP); break; @@ -873,7 +895,7 @@ operand (expressionP) break; case 'b': - if (LOCAL_LABELS_FB && ! flag_m68k_mri) + if (LOCAL_LABELS_FB && ! flag_m68k_mri && ! NUMBERS_WITH_SUFFIX) { /* This code used to check for '+' and '-' here, and, in some conditions, fall through to call |