/* ns32k.c -- Assemble on the National Semiconductor 32k series
- Copyright (C) 1987-2016 Free Software Foundation, Inc.
+ Copyright (C) 1987-2020 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
10 implied1
11 implied2
- For every entry there is a datalength in bytes. This is stored in size[n].
- 0, the objectlength is not explicitly given by the instruction
+ For every entry there is a data length in bytes. This is stored in size[n].
+ 0, the object length is not explicitly given by the instruction
and the operand is undefined. This is a case for relaxation.
Reserve 4 bytes for the final object.
The low-order-byte corresponds to low physical memory.
Obviously a FRAGment must be created for each valid disp in PART whose
- datalength is undefined (to bad) .
+ data length is undefined (to bad) .
The case where just the expression is undefined is less severe and is
- handled by fix. Here the number of bytes in the objectfile is known.
+ handled by fix. Here the number of bytes in the object file is known.
With this representation we simplify the assembly and separates the
machine dependent/independent parts in a more clean way (said OE). */
\f
displacement base-adjust as there are other routines that must
consider this. Also, as we have two various offset-adjusts in the
ns32k (acb versus br/brs/jsr/bcond), two set of limits would have
- had to be used. Now we dont have to think about that. */
+ had to be used. Now we don't have to think about that. */
const relax_typeS md_relax_table[] =
{
char disp_size[] =
{4, 1, 2, 0, 4};
\f
-/* Parse a general operand into an addressingmode struct
+/* Parse a general operand into an addressing mode struct
In: pointer at operand in ascii form
pointer at addr_mode struct for result
addrmodeP->disp[0] = str + 2;
return -1;
}
+ /* Fall through. */
default:
as_bad (_("Invalid syntax in PC-relative addressing mode"));
return 0;
{
case 'f':
addrmodeP->float_flag = 1;
- /* Drop through. */
+ /* Fall through. */
case 'r':
if (str[1] >= '0' && str[1] < '8')
{
default:
break;
}
- /* Drop through. */
+ /* Fall through. */
case 3:
if (!strncmp (str, "tos", 3))
str[strl - 4] = 0;
return -1; /* reg rel */
}
- /* Drop through. */
+ /* Fall through. */
default:
if (!strncmp (&str[strl - 4], "(fp", 3))
addrmodeP->am_size += 1; /* scaled index byte. */
j = str[strl - 4] - '0'; /* store temporary. */
- str[strl - 6] = '\000'; /* nullterminate for recursive call. */
+ str[strl - 6] = '\000'; /* null terminate for recursive call. */
i = addr_mode (str, addrmodeP, 1);
if (!i || addrmodeP->mode == 20)
if ((tmp = addrmodeP->scaled_reg))
{ /* Build indexbyte. */
tmp--; /* Remember regnumber comes incremented for
- flagpurpose. */
+ flag purpose. */
tmp |= addrmodeP->scaled_mode << 3;
addrmodeP->index_byte = (char) tmp;
addrmodeP->am_size += 1;
return addrmodeP->mode;
}
-/* Read an optionlist. */
+/* Read an option list. */
static void
optlist (char *str, /* The string to extract options from. */
switch ((d = operandsP[(loop << 1) + 1]))
{
case 'f': /* Operand of sfsr turns out to be a nasty
- specialcase. */
+ special-case. */
opcode_bit_ptr -= 5;
+ /* Fall through. */
case 'Z': /* Float not immediate. */
case 'F': /* 32 bit float general form. */
case 'L': /* 64 bit float. */
argv[i] = freeptr;
pcrel -= 1; /* Make pcrel 0 in spite of what case 'p':
wants. */
- /* fall thru */
+ /* fallthru */
case 'p': /* Displacement - pc relative addressing. */
pcrel += 1;
- /* fall thru */
+ /* fallthru */
case 'd': /* Displacement. */
iif.instr_size += suffixP[i] ? suffixP[i] : 4;
IIF (12, 2, suffixP[i], (unsigned long) argv[i], 0,
opcode_bit_ptr -= 3;
iif.iifP[1].object |= tmp << opcode_bit_ptr;
break;
- case 'O': /* Setcfg instruction optionslist. */
+ case 'O': /* Setcfg instruction options list. */
optlist (argv[i], opt3, &tmp);
opcode_bit_ptr -= 4;
iif.iifP[1].object |= tmp << 15;
break;
- case 'C': /* Cinv instruction optionslist. */
+ case 'C': /* Cinv instruction options list. */
optlist (argv[i], opt4, &tmp);
opcode_bit_ptr -= 4;
iif.iifP[1].object |= tmp << 15; /* Insert the regtype in opcode. */
fix_bsr (fixP) = bsr;
fix_bit_fixP (fixP) = bit_fixP;
/* We have a MD overflow check for displacements. */
- fixP->fx_no_overflow = (im_disp != 0);
+ fixP->fx_no_overflow = im_disp != 0 || bit_fixP != NULL;
}
static void
fix_bsr (fixP) = bsr;
fix_bit_fixP (fixP) = bit_fixP;
/* We have a MD overflow check for displacements. */
- fixP->fx_no_overflow = (im_disp != 0);
+ fixP->fx_no_overflow = im_disp != 0 || bit_fixP != NULL;
}
/* Convert number to chars in correct order. */
number_to_chars_littleendian (buf, value, nbytes);
}
-/* This is a variant of md_numbers_to_chars. The reason for its'
+/* This is a variant of md_numbers_to_chars. The reason for its
existence is the fact that ns32k uses Huffman coded
displacements. This implies that the bit order is reversed in
displacements and that they are prefixed with a size-tag.
break;
default:
- as_fatal (_("Internal logic error. line %d, file \"%s\""),
+ as_fatal (_("Internal logic error. Line %d, file: \"%s\""),
__LINE__, __FILE__);
}
}
{
/* Frag it. */
if (exprP.X_op_symbol)
- /* We cant relax this case. */
+ /* We can't relax this case. */
as_fatal (_("Can't relax difference"));
else
{