/* tc-z80.c -- Assemble code for the Zilog Z80 and ASCII R800
- Copyright 2005, 2006, 2007, 2008, 2009, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2005-2016 Free Software Foundation, Inc.
Contributed by Arnold Metselaar <arnold_m@operamail.com>
This file is part of GAS, the GNU Assembler.
static int ins_used = INS_Z80;
int
-md_parse_option (int c, char* arg ATTRIBUTE_UNUSED)
+md_parse_option (int c, const char* arg ATTRIBUTE_UNUSED)
{
switch (c)
{
struct reg_entry
{
- char* name;
+ const char* name;
int number;
};
#define R_STACKABLE (0x80)
/* Check for <label>[:] [.](EQU|DEFL) <value>. */
if (is_name_beginner (*input_line_pointer))
{
+ char *name;
char c, *rest, *line_start;
int len;
if (ignore_input ())
return 0;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
rest = input_line_pointer + 1;
if (*rest == ':')
}
input_line_pointer = rest + len - 1;
/* Allow redefining with "DEFL" (len == 4), but not with "EQU". */
- equals (line_start, len == 4);
+ equals (name, len == 4);
return 1;
}
else
{
/* Restore line and pointer. */
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
input_line_pointer = line_start;
}
}
typedef struct _table_t
{
- char* name;
+ const char* name;
char prefix;
char opcode;
asfunc * fp;
if (ins_type & ins_err)
error (_(p));
else
- as_warn (_(p));
+ as_warn ("%s", _(p));
}
static void
}
/* Check whether a symbol involves a register. */
-static int
+static int
contains_register(symbolS *sym)
{
if (sym)
{
expressionS * ex = symbol_get_value_expression(sym);
- return (O_register == ex->X_op)
- || (ex->X_add_symbol && contains_register(ex->X_add_symbol))
+ return (O_register == ex->X_op)
+ || (ex->X_add_symbol && contains_register(ex->X_add_symbol))
|| (ex->X_op_symbol && contains_register(ex->X_op_symbol));
}
else
{
const char *p;
int indir;
- segT dummy;
p = skip_space (s);
op->X_md = indir = is_indir (p);
input_line_pointer = (char*) s ;
- dummy = expression (op);
+ expression (op);
switch (op->X_op)
{
case O_absent:
case O_illegal:
error (_("bad expression syntax"));
break;
+ default:
+ break;
}
return input_line_pointer;
}
op->X_op = O_md1;
}
break;
+ default:
+ break;
}
return res;
}
BFD_RELOC_32
};
- if (nbytes < 1 || nbytes > 4)
+ if (nbytes < 1 || nbytes > 4)
{
as_bad (_("unsupported BFD relocation size %u"), nbytes);
}
{
char *p;
int lo, hi;
- fixS * fixp;
p = frag_more (1);
*p = val->X_add_number;
}
else
{
- fixp = fix_new_exp (frag_now, p - frag_now->fr_literal, 1, val,
- (r_type == BFD_RELOC_8_PCREL) ? TRUE : FALSE, r_type);
+ fix_new_exp (frag_now, p - frag_now->fr_literal, 1, val,
+ (r_type == BFD_RELOC_8_PCREL) ? TRUE : FALSE, r_type);
/* FIXME : Process constant offsets immediately. */
}
}
{ "d32", cons, 4},
{ "def24", cons, 3},
{ "def32", cons, 4},
- { "defb", emit_data, 1},
+ { "defb", emit_data, 1},
{ "defs", s_space, 1}, /* Synonym for ds on some assemblers. */
{ "defw", cons, 2},
{ "ds", s_space, 1}, /* Fill with bytes rather than words. */
}
else if ((*p) && (!ISSPACE (*p)))
as_bad (_("syntax error"));
- else
+ else
{
buf[i] = 0;
p = skip_space (p);
key = buf;
-
+
insp = bsearch (&key, instab, ARRAY_SIZE (instab),
sizeof (instab[0]), key_cmp);
if (!insp)
if (val > 255 || val < -128)
as_warn_where (fixP->fx_file, fixP->fx_line, _("overflow"));
*p_lit++ = val;
- fixP->fx_no_overflow = 1;
+ fixP->fx_no_overflow = 1;
if (fixP->fx_addsy == NULL)
fixP->fx_done = 1;
break;
case BFD_RELOC_16:
*p_lit++ = val;
*p_lit++ = (val >> 8);
- fixP->fx_no_overflow = 1;
+ fixP->fx_no_overflow = 1;
if (fixP->fx_addsy == NULL)
fixP->fx_done = 1;
break;
*p_lit++ = val;
*p_lit++ = (val >> 8);
*p_lit++ = (val >> 16);
- fixP->fx_no_overflow = 1;
+ fixP->fx_no_overflow = 1;
if (fixP->fx_addsy == NULL)
fixP->fx_done = 1;
break;