mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-22 02:50:08 +08:00
* tic80-opc.c (tic80_symbol_to_value): Changed to accept
a symbol class that restricts translation to just that class (general register, condition code, etc).
This commit is contained in:
@ -1,4 +1,10 @@
|
|||||||
start-sanitize-tic80
|
start-sanitize-tic80
|
||||||
|
Mon Feb 10 10:12:41 1997 Fred Fish <fnf@cygnus.com>
|
||||||
|
|
||||||
|
* tic80-opc.c (tic80_symbol_to_value): Changed to accept
|
||||||
|
a symbol class that restricts translation to just that
|
||||||
|
class (general register, condition code, etc).
|
||||||
|
|
||||||
Thu Feb 6 17:34:09 1997 Fred Fish <fnf@cygnus.com>
|
Thu Feb 6 17:34:09 1997 Fred Fish <fnf@cygnus.com>
|
||||||
|
|
||||||
* tic80-opc.c (tic80_operands): Add REG_0_E, REG_22_E,
|
* tic80-opc.c (tic80_operands): Add REG_0_E, REG_22_E,
|
||||||
|
@ -202,16 +202,29 @@ const struct predefined_symbol tic80_predefined_symbols[] =
|
|||||||
|
|
||||||
const int tic80_num_predefined_symbols = sizeof (tic80_predefined_symbols) / sizeof (struct predefined_symbol);
|
const int tic80_num_predefined_symbols = sizeof (tic80_predefined_symbols) / sizeof (struct predefined_symbol);
|
||||||
|
|
||||||
/* This function takes a predefined symbol name in NAME and translates
|
/* This function takes a predefined symbol name in NAME, symbol class
|
||||||
it to a numeric value, which it returns. If no translation is
|
in CLASS, and translates it to a numeric value, which it returns.
|
||||||
possible, it returns -1, a value not used by any predefined
|
|
||||||
symbol. Note that the predefined symbol array is presorted case
|
If CLASS is zero, any symbol that matches NAME is translated. If
|
||||||
independently by name. */
|
CLASS is non-zero, then only a symbol that has class CLASS is
|
||||||
|
matched.
|
||||||
|
|
||||||
|
If no translation is possible, it returns -1, a value not used by
|
||||||
|
any predefined symbol. Note that the predefined symbol array is
|
||||||
|
presorted case independently by name.
|
||||||
|
|
||||||
|
This function is implemented with the assumption that there are no
|
||||||
|
duplicate names in the predefined symbol array, which happens to be
|
||||||
|
true at the moment.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
tic80_symbol_to_value (name)
|
tic80_symbol_to_value (name, class)
|
||||||
char *name;
|
char *name;
|
||||||
|
int class;
|
||||||
{
|
{
|
||||||
|
const struct predefined_symbol *pdsp;
|
||||||
int low = 0;
|
int low = 0;
|
||||||
int middle;
|
int middle;
|
||||||
int high = tic80_num_predefined_symbols - 1;
|
int high = tic80_num_predefined_symbols - 1;
|
||||||
@ -232,7 +245,12 @@ tic80_symbol_to_value (name)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rtnval = tic80_predefined_symbols[middle].value;
|
pdsp = &tic80_predefined_symbols[middle];
|
||||||
|
if ((class == 0) || (class & pdsp -> value))
|
||||||
|
{
|
||||||
|
rtnval = pdsp -> value;
|
||||||
|
}
|
||||||
|
/* For now we assume that there are no duplicate names */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user