/* tc-c30.c -- Assembly code for the Texas Instruments TMS320C30
- Copyright 1998, 1999, 2000, 2001, 2002, 2003
+ Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2006, 2007
Free Software Foundation, Inc.
Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
GAS is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
+ the Free Software Foundation; either version 3, or (at your option)
any later version.
GAS is distributed in the hope that it will be useful,
#include "as.h"
#include "safe-ctype.h"
#include "opcode/tic30.h"
-#ifdef ANSI_PROTOTYPES
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
/* Put here all non-digit non-letter characters that may occur in an
operand. */
"first", "second", "third", "fourth", "fifth"
};
-const int md_reloc_size = 0;
-
const char comment_chars[] = ";";
const char line_comment_chars[] = "*";
const char line_separator_chars[] = "";
{0, 0, 0}
};
-static int
+static int ATTRIBUTE_PRINTF_1
debug (const char *string, ...)
{
if (flag_debug)
struct tic30_insn insn;
static int found_parallel_insn;
-static char output_invalid_buf[8];
+static char output_invalid_buf[sizeof (unsigned char) * 2 + 6];
static char *
output_invalid (char c)
{
if (ISPRINT (c))
- sprintf (output_invalid_buf, "'%c'", c);
+ snprintf (output_invalid_buf, sizeof (output_invalid_buf),
+ "'%c'", c);
else
- sprintf (output_invalid_buf, "(0x%x)", (unsigned) c);
+ snprintf (output_invalid_buf, sizeof (output_invalid_buf),
+ "(0x%x)", (unsigned char) c);
return output_invalid_buf;
}
debug ("Expression type: %d\n",
current_op->direct.direct_expr.X_op);
- debug ("Expression addnum: %d\n",
- current_op->direct.direct_expr.X_add_number);
- debug ("Segment: %d\n", retval);
+ debug ("Expression addnum: %ld\n",
+ (long) current_op->direct.direct_expr.X_add_number);
+ debug ("Segment: %p\n", retval);
input_line_pointer = save_input_line_pointer;
retval = expression (¤t_op->immediate.imm_expr);
debug ("Expression type: %d\n",
current_op->immediate.imm_expr.X_op);
- debug ("Expression addnum: %d\n",
- current_op->immediate.imm_expr.X_add_number);
- debug ("Segment: %d\n", retval);
+ debug ("Expression addnum: %ld\n",
+ (long) current_op->immediate.imm_expr.X_add_number);
+ debug ("Segment: %p\n", retval);
input_line_pointer = save_input_line_pointer;
if (current_op->immediate.imm_expr.X_op == O_constant)
debug ("Values in fixP\n");
debug ("fx_size = %d\n", fixP->fx_size);
debug ("fx_pcrel = %d\n", fixP->fx_pcrel);
- debug ("fx_where = %d\n", fixP->fx_where);
+ debug ("fx_where = %ld\n", fixP->fx_where);
debug ("fx_offset = %d\n", (int) fixP->fx_offset);
{
char *buf = fixP->fx_frag->fr_literal + fixP->fx_where;
valueT
md_section_align (segT segment, valueT size)
{
- debug ("In md_section_align() segment = %d and size = %d\n",
- segment, size);
+ debug ("In md_section_align() segment = %p and size = %lu\n",
+ segment, (unsigned long) size);
size = (size + 3) / 4;
size *= 4;
- debug ("New size value = %d\n", size);
+ debug ("New size value = %lu\n", (unsigned long) size);
return size;
}
int offset;
debug ("In md_pcrel_from()\n");
- debug ("fx_where = %d\n", fixP->fx_where);
+ debug ("fx_where = %ld\n", fixP->fx_where);
debug ("fx_size = %d\n", fixP->fx_size);
/* Find the opcode that represents the current instruction in the
fr_literal storage area, and check bit 21. Bit 21 contains whether the