mirror of
https://github.com/darlinghq/darling-gdb.git
synced 2024-11-25 05:00:01 +00:00
* xstormy16-asm.c: Regenerate.
This commit is contained in:
parent
5fdd7054d3
commit
c2617f4067
@ -1,3 +1,7 @@
|
||||
2002-12-16 Andrew MacLeod <amacleod@redhat.com>
|
||||
|
||||
* xstormy16-asm.c: Regenerate.
|
||||
|
||||
2002-12-16 Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
* ns32k-dis.c (print_insn_ns32k): Constify "d", remove register
|
||||
|
@ -109,6 +109,9 @@ parse_small_immediate (cd, strp, opindex, valuep)
|
||||
enum cgen_parse_operand_result result;
|
||||
const char *errmsg;
|
||||
|
||||
if (**strp == '@')
|
||||
return _("No relocation for small immediate");
|
||||
|
||||
errmsg = (* cd->parse_operand_fn)
|
||||
(cd, CGEN_PARSE_OPERAND_INTEGER, strp, opindex, BFD_RELOC_NONE,
|
||||
&result, &value);
|
||||
@ -122,6 +125,54 @@ parse_small_immediate (cd, strp, opindex, valuep)
|
||||
*valuep = value;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Literal scan be either a normal literal, a @hi() or @lo relocation. */
|
||||
|
||||
static const char *
|
||||
parse_immediate16 (cd, strp, opindex, valuep)
|
||||
CGEN_CPU_DESC cd;
|
||||
const char **strp;
|
||||
int opindex;
|
||||
unsigned long *valuep;
|
||||
{
|
||||
const char *errmsg;
|
||||
enum cgen_parse_operand_result result;
|
||||
bfd_reloc_code_real_type code = BFD_RELOC_NONE;
|
||||
bfd_vma value;
|
||||
|
||||
if (strncmp (*strp, "@hi(", 4) == 0)
|
||||
{
|
||||
*strp += 4;
|
||||
code = BFD_RELOC_HI16;
|
||||
}
|
||||
else
|
||||
if (strncmp (*strp, "@lo(", 4) == 0)
|
||||
{
|
||||
*strp += 4;
|
||||
code = BFD_RELOC_LO16;
|
||||
}
|
||||
|
||||
if (code == BFD_RELOC_NONE)
|
||||
errmsg = cgen_parse_unsigned_integer (cd, strp, opindex, valuep);
|
||||
else
|
||||
{
|
||||
errmsg = cgen_parse_address (cd, strp, opindex, code, &result, &value);
|
||||
if ((errmsg == NULL) &&
|
||||
(result != CGEN_PARSE_OPERAND_RESULT_QUEUED))
|
||||
errmsg = _("Operand is not a symbol");
|
||||
|
||||
*valuep = value;
|
||||
if ((code == BFD_RELOC_HI16 || code == BFD_RELOC_LO16)
|
||||
&& **strp == ')')
|
||||
*strp += 1;
|
||||
else
|
||||
{
|
||||
errmsg = _("Syntax error: No trailing ')'");
|
||||
return errmsg;
|
||||
}
|
||||
}
|
||||
return errmsg;
|
||||
}
|
||||
/* -- */
|
||||
|
||||
const char * xstormy16_cgen_parse_operand
|
||||
@ -187,7 +238,7 @@ xstormy16_cgen_parse_operand (cd, opindex, strp, fields)
|
||||
errmsg = cgen_parse_signed_integer (cd, strp, XSTORMY16_OPERAND_IMM12, &fields->f_imm12);
|
||||
break;
|
||||
case XSTORMY16_OPERAND_IMM16 :
|
||||
errmsg = cgen_parse_unsigned_integer (cd, strp, XSTORMY16_OPERAND_IMM16, &fields->f_imm16);
|
||||
errmsg = parse_immediate16 (cd, strp, XSTORMY16_OPERAND_IMM16, &fields->f_imm16);
|
||||
break;
|
||||
case XSTORMY16_OPERAND_IMM2 :
|
||||
errmsg = cgen_parse_unsigned_integer (cd, strp, XSTORMY16_OPERAND_IMM2, &fields->f_imm2);
|
||||
|
Loading…
Reference in New Issue
Block a user