const char comment_chars[] = "#";
/* Characters which start a comment at the beginning of a line. */
const char line_comment_chars[] = ";#";
const char comment_chars[] = "#";
/* Characters which start a comment at the beginning of a line. */
const char line_comment_chars[] = ";#";
{0x7f, -0x80, 2, 1},
{0x7fff, -0x8000, 5, 2},
{0x7fffffff, -0x80000000, 7, 0},
{0x7f, -0x80, 2, 1},
{0x7fff, -0x8000, 5, 2},
{0x7fffffff, -0x80000000, 7, 0},
{0x7f, -0x80, 3, 4},
{0x7fff, -0x8000, 6, 5},
{0x7fffffff, -0x80000000, 8, 0},
{0x7f, -0x80, 3, 4},
{0x7fff, -0x8000, 6, 5},
{0x7fffffff, -0x80000000, 8, 0},
{0x7fff, -0x8000, 5, 7},
{0x7fffffff, -0x80000000, 7, 0},
{0x7fff, -0x8000, 5, 7},
{0x7fffffff, -0x80000000, 7, 0},
{0x7fff, -0x8000, 4, 9},
{0x7fffffff, -0x80000000, 6, 0},
{0x7fff, -0x8000, 4, 9},
{0x7fffffff, -0x80000000, 6, 0},
{0x7f, -0x80, 2, 11},
{0x7fff, -0x8000, 3, 12},
{0x7fffffff, -0x80000000, 5, 0},
};
{0x7f, -0x80, 2, 11},
{0x7fff, -0x8000, 3, 12},
{0x7fffffff, -0x80000000, 5, 0},
};
static void mn10300_insert_operand PARAMS ((unsigned long *, unsigned long *,
const struct mn10300_operand *,
offsetT, char *, unsigned,
static void mn10300_insert_operand PARAMS ((unsigned long *, unsigned long *,
const struct mn10300_operand *,
offsetT, char *, unsigned,
struct option md_longopts[] = {
{NULL, no_argument, NULL, 0}
};
struct option md_longopts[] = {
{NULL, no_argument, NULL, 0}
};
/* reg_name_search does a binary search of the given register table
to see if "name" is a valid regiter name. Returns the register
/* reg_name_search does a binary search of the given register table
to see if "name" is a valid regiter name. Returns the register
start = name = input_line_pointer;
c = get_symbol_end ();
reg_number = reg_name_search (r_registers, R_REG_NAME_CNT, name);
start = name = input_line_pointer;
c = get_symbol_end ();
reg_number = reg_name_search (r_registers, R_REG_NAME_CNT, name);
- /* reset the line as if we had not done anything */
- *input_line_pointer = c; /* put back the delimiting char */
- input_line_pointer = start; /* reset input_line pointer */
+ /* Reset the line as if we had not done anything. */
+ /* Put back the delimiting char. */
+ *input_line_pointer = c;
+
+ /* Reset input_line pointer. */
+ input_line_pointer = start;
start = name = input_line_pointer;
c = get_symbol_end ();
reg_number = reg_name_search (xr_registers, XR_REG_NAME_CNT, name);
start = name = input_line_pointer;
c = get_symbol_end ();
reg_number = reg_name_search (xr_registers, XR_REG_NAME_CNT, name);
- /* reset the line as if we had not done anything */
- *input_line_pointer = c; /* put back the delimiting char */
- input_line_pointer = start; /* reset input_line pointer */
+ /* Reset the line as if we had not done anything. */
+ /* Put back the delimiting char. */
+ *input_line_pointer = c;
+
+ /* Reset input_line pointer. */
+ input_line_pointer = start;
start = name = input_line_pointer;
c = get_symbol_end ();
reg_number = reg_name_search (data_registers, DATA_REG_NAME_CNT, name);
start = name = input_line_pointer;
c = get_symbol_end ();
reg_number = reg_name_search (data_registers, DATA_REG_NAME_CNT, name);
- /* reset the line as if we had not done anything */
- *input_line_pointer = c; /* put back the delimiting char */
- input_line_pointer = start; /* reset input_line pointer */
+ /* Reset the line as if we had not done anything. */
+ /* Put back the delimiting char. */
+ *input_line_pointer = c;
+
+ /* Reset input_line pointer. */
+ input_line_pointer = start;
start = name = input_line_pointer;
c = get_symbol_end ();
reg_number = reg_name_search (address_registers, ADDRESS_REG_NAME_CNT, name);
start = name = input_line_pointer;
c = get_symbol_end ();
reg_number = reg_name_search (address_registers, ADDRESS_REG_NAME_CNT, name);
- /* reset the line as if we had not done anything */
- *input_line_pointer = c; /* put back the delimiting char */
- input_line_pointer = start; /* reset input_line pointer */
+ /* Reset the line as if we had not done anything. */
+ /* Put back the delimiting char. */
+ *input_line_pointer = c;
+
+ /* Reset input_line pointer. */
+ input_line_pointer = start;
+
start = name = input_line_pointer;
c = get_symbol_end ();
reg_number = reg_name_search (other_registers, OTHER_REG_NAME_CNT, name);
start = name = input_line_pointer;
c = get_symbol_end ();
reg_number = reg_name_search (other_registers, OTHER_REG_NAME_CNT, name);
- /* reset the line as if we had not done anything */
- *input_line_pointer = c; /* put back the delimiting char */
- input_line_pointer = start; /* reset input_line pointer */
+ /* Reset the line as if we had not done anything. */
+ /* Put back the delimiting char. */
+ *input_line_pointer = c;
+
+ /* Reset input_line pointer. */
+ input_line_pointer = start;
/* Insert unique names into hash table. The MN10300 instruction set
has many identical opcode names that have different opcodes based
/* Insert unique names into hash table. The MN10300 instruction set
has many identical opcode names that have different opcodes based
{
prev_name = (char *) op->name;
hash_insert (mn10300_hash, op->name, (char *) op);
{
prev_name = (char *) op->name;
hash_insert (mn10300_hash, op->name, (char *) op);
- /* find the first opcode with the proper name */
- opcode = (struct mn10300_opcode *)hash_find (mn10300_hash, str);
+ /* Find the first opcode with the proper name. */
+ opcode = (struct mn10300_opcode *) hash_find (mn10300_hash, str);
The linker can then fill in the appropriate bits for the
register list and stack size or change the instruction
The linker can then fill in the appropriate bits for the
register list and stack size or change the instruction
mn10300_insert_operand (&insn, &extension, operand,
ex.X_add_number, (char *) NULL,
0, extra_shift);
mn10300_insert_operand (&insn, &extension, operand,
ex.X_add_number, (char *) NULL,
0, extra_shift);
/* And note the register number in the register array. */
mn10300_reg_operands[op_idx - 1] = ex.X_add_number;
break;
/* And note the register number in the register array. */
mn10300_reg_operands[op_idx - 1] = ex.X_add_number;
break;
then promote it (ie this opcode does not match). */
if (operand->flags
& (MN10300_OPERAND_PROMOTE | MN10300_OPERAND_RELAX)
then promote it (ie this opcode does not match). */
if (operand->flags
& (MN10300_OPERAND_PROMOTE | MN10300_OPERAND_RELAX)
fixups[0].exp.X_add_symbol,
fixups[0].exp.X_add_number,
(char *)fixups[0].opindex);
fixups[0].exp.X_add_symbol,
fixups[0].exp.X_add_number,
(char *)fixups[0].opindex);
/* This is pretty hokey. We basically just care about the
opcode, so we have to write out the first word big endian.
/* This is pretty hokey. We basically just care about the
opcode, so we have to write out the first word big endian.
else if (opcode->format == FMT_D4)
{
unsigned long temp = ((insn & 0xffff) << 16) | (extension & 0xffff);
else if (opcode->format == FMT_D4)
{
unsigned long temp = ((insn & 0xffff) << 16) | (extension & 0xffff);
number_to_chars_bigendian (f, (insn >> 16) & 0xffff, 2);
number_to_chars_littleendian (f + 2, temp, 4);
}
else if (opcode->format == FMT_D5)
{
number_to_chars_bigendian (f, (insn >> 16) & 0xffff, 2);
number_to_chars_littleendian (f + 2, temp, 4);
}
else if (opcode->format == FMT_D5)
{
number_to_chars_bigendian (f, (insn >> 16) & 0xffff, 2);
number_to_chars_littleendian (f + 2, temp, 4);
number_to_chars_bigendian (f + 6, extension & 0xff, 1);
}
else if (opcode->format == FMT_D8)
{
number_to_chars_bigendian (f, (insn >> 16) & 0xffff, 2);
number_to_chars_littleendian (f + 2, temp, 4);
number_to_chars_bigendian (f + 6, extension & 0xff, 1);
}
else if (opcode->format == FMT_D8)
{
- unsigned long temp = ((insn & 0xff) << 16) | (extension & 0xffff);
- number_to_chars_bigendian (f, (insn >> 8) & 0xffffff, 3);
- number_to_chars_bigendian (f + 3, (temp & 0xff), 1);
- number_to_chars_littleendian (f + 4, temp >> 8, 2);
+ unsigned long temp = ((insn & 0xff) << 16) | (extension & 0xffff);
+
+ number_to_chars_bigendian (f, (insn >> 8) & 0xffffff, 3);
+ number_to_chars_bigendian (f + 3, (temp & 0xff), 1);
+ number_to_chars_littleendian (f + 4, temp >> 8, 2);
- unsigned long temp = ((insn & 0xff) << 24) | (extension & 0xffffff);
- number_to_chars_bigendian (f, (insn >> 8) & 0xffffff, 3);
- number_to_chars_littleendian (f + 3, temp, 4);
+ unsigned long temp = ((insn & 0xff) << 24) | (extension & 0xffffff);
+
+ number_to_chars_bigendian (f, (insn >> 8) & 0xffffff, 3);
+ number_to_chars_littleendian (f + 3, temp, 4);
pcrel = (operand->flags & MN10300_OPERAND_PCREL) != 0;
/* Gross. This disgusting hack is to make sure we
pcrel = (operand->flags & MN10300_OPERAND_PCREL) != 0;
/* Gross. This disgusting hack is to make sure we
"call" instructions. Basically they're a pain
because the reloc isn't at the end of the instruction. */
if ((size == 5 || size == 7)
"call" instructions. Basically they're a pain
because the reloc isn't at the end of the instruction. */
if ((size == 5 || size == 7)
if (reloc->howto == (reloc_howto_type *) NULL)
{
as_bad_where (fixp->fx_file, fixp->fx_line,
if (reloc->howto == (reloc_howto_type *) NULL)
{
as_bad_where (fixp->fx_file, fixp->fx_line,
if ((S_GET_SEGMENT (fixp->fx_addsy) != S_GET_SEGMENT (fixp->fx_subsy))
|| S_GET_SEGMENT (fixp->fx_addsy) == undefined_section)
{
if ((S_GET_SEGMENT (fixp->fx_addsy) != S_GET_SEGMENT (fixp->fx_subsy))
|| S_GET_SEGMENT (fixp->fx_addsy) == undefined_section)
{
- {
- const char *err =
- _("operand out of range (%s not between %ld and %ld)");
- char buf[100];
-
- sprint_value (buf, test);
- if (file == (char *) NULL)
- as_warn (err, buf, min, max);
- else
- as_warn_where (file, line, err, buf, min, max);
- }
+ {
+ const char *err =
+ _("operand out of range (%s not between %ld and %ld)");
+ char buf[100];
+
+ sprint_value (buf, test);
+ if (file == (char *) NULL)
+ as_warn (err, buf, min, max);
+ else
+ as_warn_where (file, line, err, buf, min, max);
+ }