/* tc-vax.c - vax-specific -
- 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.
bbsc e4
bbcc e5
Always, you complement 0th bit to reverse condition.
- Always, 1-byte opcde, longword-address, byte-address, 1-byte-displacement
+ Always, 1-byte opcode, longword-address, byte-address, 1-byte-displacement
2c. J<cond> where cond tests low-order memory bit
length of byte,word,long.
#define BB (1+-128)
#define WF (2+ 32767)
#define WB (2+-32768)
-/* Dont need LF, LB because they always reach. [They are coded as 0.] */
+/* Don't need LF, LB because they always reach. [They are coded as 0.] */
#define C(a,b) ENCODE_RELAX(a,b)
/* This macro has no side-effects. */
int old_fr_fix;
old_fr_fix = fragP->fr_fix;
- p = fragP->fr_literal + old_fr_fix;
+ p = &fragP->fr_literal[0] + old_fr_fix;
#ifdef OBJ_ELF
/* If this is to an undefined symbol, then if it's an indirect
reference indicate that is can mutated into a GLOB_DAT or
know (fragP->fr_type == rs_machine_dependent);
where = fragP->fr_fix;
- addressP = fragP->fr_literal + where;
+ addressP = &fragP->fr_literal[0] + where;
opcodeP = fragP->fr_opcode;
symbolP = fragP->fr_symbol;
know (symbolP);
source file, and changed the makefile. */
/* Handle of the OPCODE hash table. */
-static struct hash_control *op_hash;
+static htab_t op_hash;
/* In: 1 character, from "bdfghloqpw" being the data-type of an operand
of a vax instruction.
instruction table.
You must nominate metacharacters for eg DEC's "#", "@", "^". */
-static const char *
+static void
vip_begin (int synthetic_too, /* 1 means include jXXX op-codes. */
const char *immediate,
const char *indirect,
const char *displen)
{
const struct vot *vP; /* scan votstrs */
- const char *retval = 0; /* error text */
- op_hash = hash_new ();
+ op_hash = str_htab_create ();
- for (vP = votstrs; *vP->vot_name && !retval; vP++)
- retval = hash_insert (op_hash, vP->vot_name, (void *) &vP->vot_detail);
+ for (vP = votstrs; *vP->vot_name; vP++)
+ str_hash_insert (op_hash, vP->vot_name, (void *) &vP->vot_detail);
if (synthetic_too)
- for (vP = synthetic_votstrs; *vP->vot_name && !retval; vP++)
- retval = hash_insert (op_hash, vP->vot_name, (void *) &vP->vot_detail);
+ for (vP = synthetic_votstrs; *vP->vot_name; vP++)
+ str_hash_insert (op_hash, vP->vot_name, (void *) &vP->vot_detail);
#ifndef CONST_TABLE
vip_op_defaults (immediate, indirect, displen);
#endif
-
- return retval;
}
/* Take 3 char.s, the last of which may be `\0` (non-existent)
/* Here with instring pointing to what better be an op-name, and p
pointing to character just past that.
We trust instring points to an op-name, with no whitespace. */
- vwP = (struct vot_wot *) hash_find (op_hash, instring);
+ vwP = (struct vot_wot *) str_hash_find (op_hash, instring);
/* Restore char after op-code. */
*p = c;
if (vwP == 0)
printf ("enter displen symbols eg enter ^ ");
gets (my_displen);
- if (p = vip_begin (mysynth, my_immediate, my_indirect, my_displen))
- error ("vip_begin=%s", p);
+ vip_begin (mysynth, my_immediate, my_indirect, my_displen)
printf ("An empty input line will quit you from the vax instruction parser\n");
for (;;)
default:
my_operand_length = 2;
- printf ("I dn't understand access width %c\n", mywidth);
+ printf ("I don't understand access width %c\n", mywidth);
break;
}
printf ("VAX assembler instruction operand: ");
|| operandP->vop_access == 'a')
{
if (operandP->vop_access == 'v')
- as_warn (_("Invalid operand: immediate value used as base address."));
+ as_warn (_("Invalid operand: immediate value used as base address."));
else
- as_warn (_("Invalid operand: immediate value used as address."));
+ as_warn (_("Invalid operand: immediate value used as address."));
/* gcc 2.6.3 is known to generate these in at least
one case. */
}
void
md_begin (void)
{
- const char *errtxt;
FLONUM_TYPE *fP;
int i;
- if ((errtxt = vip_begin (1, "$", "*", "`")) != 0)
- as_fatal (_("VIP_BEGIN error:%s"), errtxt);
+ vip_begin (1, "$", "*", "`");
for (i = 0, fP = float_operand;
fP < float_operand + VIT_MAX_OPERANDS;