/* tc-tic80.c -- Assemble for the TI TMS320C80 (MV)
- Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
as_fatal (_("internal error:%s:%d: %s\n"), __FILE__, __LINE__, what)
#define internal_error_a(what,arg) \
- as_fatal (_("internal error:%s:%d: %s %d\n"), __FILE__, __LINE__, what, arg)
+ as_fatal (_("internal error:%s:%d: %s %ld\n"), __FILE__, __LINE__, what, arg)
\f
/* Generic assembler global variables which must be defined by all
targets. */
function to call to execute this pseudo-op
integer arg to pass to the function */
-extern void obj_coff_section ();
-
const pseudo_typeS md_pseudo_table[] = {
{ "align", s_align_bytes, 4 }, /* Do byte alignment, default is a 4 byte boundary */
{ "word", cons, 4 }, /* FIXME: Should this be machine independent? */
\f
int
md_estimate_size_before_relax (fragP, segment_type)
- fragS *fragP;
- segT segment_type;
+ fragS *fragP ATTRIBUTE_UNUSED;
+ segT segment_type ATTRIBUTE_UNUSED;
{
internal_error (_("Relaxation is a luxury we can't afford"));
return (-1);
symbolS *
md_undefined_symbol (name)
- char *name;
+ char *name ATTRIBUTE_UNUSED;
{
return 0;
}
LITTLENUM_TYPE words[MAX_LITTLENUMS];
LITTLENUM_TYPE *wordP;
char *t;
- char *atof_ieee ();
switch (type)
{
int retval = 0;
/* Only need to check fields less than 32 bits wide. */
- if (bits < 32)
- if (flags & TIC80_OPERAND_SIGNED)
- {
- max = (1 << (bits - 1)) - 1;
- min = - (1 << (bits - 1));
- retval = ((long) num > max) || ((long) num < min);
- }
- else
- {
- max = (1 << bits) - 1;
- min = 0;
- retval = (num > max) || (num < min);
- }
- return (retval);
+ if (bits >= 32)
+ return retval;
+
+ if (flags & TIC80_OPERAND_SIGNED)
+ {
+ max = (1 << (bits - 1)) - 1;
+ min = - (1 << (bits - 1));
+ retval = (long) num > max || (long) num < min;
+ }
+ else
+ {
+ max = (1 << bits) - 1;
+ retval = num > (unsigned long) max;
+ }
+ return retval;
}
/* get_operands () parses a string of operands and fills in a passed
{
char *p = input_line_pointer;
int numexp = 0;
- int mflag = 0;
- int sflag = 0;
int parens = 0;
while (*p)
expression that supplies additional information about
the operand, such as ":m" or ":s" modifiers. Check to
see that the operand matches this requirement. */
- if (!((num & TIC80_OPERAND_M_SI) && (flags & TIC80_OPERAND_M_SI)
- || (num & TIC80_OPERAND_M_LI) && (flags & TIC80_OPERAND_M_LI)
- || (num & TIC80_OPERAND_SCALED) && (flags & TIC80_OPERAND_SCALED)))
+ if (!((num & flags & TIC80_OPERAND_M_SI)
+ || (num & flags & TIC80_OPERAND_M_LI)
+ || (num & flags & TIC80_OPERAND_SCALED)))
{
match = 0;
}
case O_logical_or:
case O_max:
default:
- internal_error_a (_("unhandled expression type"), X_op);
+ internal_error_a (_("unhandled expression type"), (long) X_op);
}
}
if (!match)
else
{
internal_error_a (_("unhandled operand modifier"),
- opers[expi].X_add_number);
+ (long) opers[expi].X_add_number);
}
break;
case O_big:
case O_logical_or:
case O_max:
default:
- internal_error_a (_("unhandled expression"), X_op);
+ internal_error_a (_("unhandled expression"), (long) X_op);
break;
}
}
unsigned char *input_line_save;
struct tic80_opcode *opcode;
expressionS myops[16];
- unsigned long insn;
/* Ensure there is something there to assemble. */
assert (str);
valu = PDS_VALUE (pdsp) & ~TIC80_OPERAND_MASK;
break;
default:
- internal_error_a (_("unhandled predefined symbol bits"), symtype);
+ internal_error_a (_("unhandled predefined symbol bits"),
+ (long) symtype);
break;
}
symbol_table_insert (symbol_create (PDS_NAME (pdsp), segment, valu,
\f
/* The assembler adds md_shortopts to the string passed to getopt. */
-CONST char *md_shortopts = "";
+const char *md_shortopts = "";
/* The assembler adds md_longopts to the machine independent long options
that are passed to getopt. */
int
md_parse_option (c, arg)
int c;
- char *arg;
+ char *arg ATTRIBUTE_UNUSED;
{
switch (c)
{
To indicate that a fixup has been eliminated, set fixP->fx_done. */
void
-md_apply_fix (fixP, val)
+md_apply_fix3 (fixP, valP, seg)
fixS *fixP;
- long val;
+ valueT * valP;
+ segT seg ATTRIBUTE_UNUSED;
{
+ long val = * (long *) valP;
char *dest = fixP->fx_frag->fr_literal + fixP->fx_where;
int overflow;
break;
default:
internal_error_a (_("unhandled relocation type in fixup"),
- fixP->fx_r_type);
+ (long) fixP->fx_r_type);
break;
}
+
+ if (fixP->fx_addsy == NULL && fixP->fx_pcrel == 0)
+ fixP->fx_done = 1;
}
\f
/* Functions concerning relocs. */
void
md_convert_frag (headers, seg, fragP)
- object_headers *headers;
- segT seg;
- fragS *fragP;
+ object_headers *headers ATTRIBUTE_UNUSED;
+ segT seg ATTRIBUTE_UNUSED;
+ fragS *fragP ATTRIBUTE_UNUSED;
{
internal_error (_("md_convert_frag() not implemented yet"));
abort ();
\f
void
tc_coff_symbol_emit_hook (ignore)
- symbolS *ignore;
+ symbolS *ignore ATTRIBUTE_UNUSED;
{
}