aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorK. Richard Pixley <rich@cygnus>1993-09-24 19:47:59 +0000
committerK. Richard Pixley <rich@cygnus>1993-09-24 19:47:59 +0000
commit58f3e8a9db8f29fc627fdb006c1542e7037d0814 (patch)
tree2c56ce081e3defb7b022bcdb2937bc24d4cd83ec /gas
parent6d6b97b74950cf5b83114ab416251f75fbd8b26a (diff)
downloadgdb-58f3e8a9db8f29fc627fdb006c1542e7037d0814.zip
gdb-58f3e8a9db8f29fc627fdb006c1542e7037d0814.tar.gz
gdb-58f3e8a9db8f29fc627fdb006c1542e7037d0814.tar.bz2
* config/tc-m88k.c (get_o6): new function.
(get_bf, get_cmp, get_cnd, get_cr, get_fcr, get_imm16, get_reg, get_vec9, getval, get_pcr, calcop, match_name): make static and prototype. (s_file): remove extraneous forward decl. (md_begin): add const to retval decl. (calcop): cope with instructions without arguments. Handle 'o' type argument, the o6 field of the prot insn. (md_estimate_size_before_relax): return a dummy value.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog10
-rw-r--r--gas/config/tc-m88k.c94
2 files changed, 72 insertions, 32 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 5b35a91..e694384 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,15 @@
Fri Sep 24 12:37:59 1993 K. Richard Pixley (rich@sendai.cygnus.com)
+ * config/tc-m88k.c (get_o6): new function.
+ (get_bf, get_cmp, get_cnd, get_cr, get_fcr, get_imm16, get_reg,
+ get_vec9, getval, get_pcr, calcop, match_name): make static and
+ prototype.
+ (s_file): remove extraneous forward decl.
+ (md_begin): add const to retval decl.
+ (calcop): cope with instructions without arguments. Handle 'o'
+ type argument, the o6 field of the prot insn.
+ (md_estimate_size_before_relax): return a dummy value.
+
* config/m88k-opcode.h (m88k_opcodes): comment change; o6 field is
in bits 10 through 7. flt.[dxs]s requires an r register in the
second argument. New instruction lda.x. New instruction muls
diff --git a/gas/config/tc-m88k.c b/gas/config/tc-m88k.c
index e064003..245fc20 100644
--- a/gas/config/tc-m88k.c
+++ b/gas/config/tc-m88k.c
@@ -23,17 +23,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "as.h"
#include "m88k-opcode.h"
-char *getval ();
-char *get_reg ();
-char *get_imm16 ();
-char *get_bf ();
-char *get_pcr ();
-char *get_cmp ();
-char *get_cnd ();
-char *get_cr ();
-char *get_fcr ();
-char *get_vec9 ();
-
struct field_val_assoc
{
char *name;
@@ -129,6 +118,24 @@ struct m88k_insn
enum reloc_type reloc;
};
+static char *get_bf PARAMS ((char *param, unsigned *valp));
+static char *get_cmp PARAMS ((char *param, unsigned *valp));
+static char *get_cnd PARAMS ((char *param, unsigned *valp));
+static char *get_cr PARAMS ((char *param, unsigned *regnop));
+static char *get_fcr PARAMS ((char *param, unsigned *regnop));
+static char *get_imm16 PARAMS ((char *param, struct m88k_insn *insn));
+static char *get_o6 PARAMS ((char *param, unsigned *valp));
+static char *get_reg PARAMS ((char *param, unsigned *regnop, int reg_prefix));
+static char *get_vec9 PARAMS ((char *param, unsigned *valp));
+static char *getval PARAMS ((char *param, unsigned int *valp));
+
+static char *get_pcr PARAMS ((char *param, struct m88k_insn *insn,
+ enum reloc_type reloc));
+
+static int calcop PARAMS ((struct m88k_opcode *format,
+ char *param, struct m88k_insn *insn));
+
+
extern char *myname;
static struct hash_control *op_hash = NULL;
@@ -154,7 +161,6 @@ const char FLT_CHARS[] = "dDfF";
extern void float_cons (), cons (), s_globl (), s_space (),
s_set (), s_lcomm ();
-static void s_file ();
const pseudo_typeS md_pseudo_table[] =
{
@@ -176,7 +182,7 @@ const pseudo_typeS md_pseudo_table[] =
void
md_begin ()
{
- char *retval = NULL;
+ const char *retval = NULL;
unsigned int i = 0;
/* initialize hash table */
@@ -317,7 +323,7 @@ md_assemble (op)
}
}
-int
+static int
calcop (format, param, insn)
struct m88k_opcode *format;
char *param;
@@ -341,7 +347,7 @@ calcop (format, param, insn)
{
case 0:
insn->opcode |= opcode;
- return *param == 0;
+ return (*param == 0 || *param == '\n');
default:
if (f != *param++)
@@ -354,6 +360,11 @@ calcop (format, param, insn)
opcode |= val << 21;
break;
+ case 'o':
+ param = get_o6 (param, &val);
+ opcode |= ((val >> 2) << 7);
+ break;
+
case 'x':
reg_prefix = 'x';
break;
@@ -426,7 +437,7 @@ calcop (format, param, insn)
}
}
-char *
+static char *
match_name (param, assoc_tab, valp)
char *param;
struct field_val_assoc *assoc_tab;
@@ -450,7 +461,7 @@ match_name (param, assoc_tab, valp)
}
}
-char *
+static char *
get_reg (param, regnop, reg_prefix)
char *param;
unsigned *regnop;
@@ -497,7 +508,7 @@ get_reg (param, regnop, reg_prefix)
return 0;
}
-char *
+static char *
get_imm16 (param, insn)
char *param;
struct m88k_insn *insn;
@@ -556,7 +567,7 @@ get_imm16 (param, insn)
return param;
}
-char *
+static char *
get_pcr (param, insn, reloc)
char *param;
struct m88k_insn *insn;
@@ -578,7 +589,7 @@ get_pcr (param, insn, reloc)
return saveparam;
}
-char *
+static char *
get_cmp (param, valp)
char *param;
unsigned *valp;
@@ -612,7 +623,7 @@ get_cmp (param, valp)
return param;
}
-char *
+static char *
get_cnd (param, valp)
char *param;
unsigned *valp;
@@ -649,7 +660,7 @@ get_cnd (param, valp)
return param;
}
-char *
+static char *
get_bf2 (param, bc)
char *param;
int bc;
@@ -672,7 +683,7 @@ get_bf2 (param, bc)
}
}
-char *
+static char *
get_bf_offset_expression (param, offsetp)
char *param;
unsigned *offsetp;
@@ -701,7 +712,7 @@ get_bf_offset_expression (param, offsetp)
return param;
}
-char *
+static char *
get_bf (param, valp)
char *param;
unsigned *valp;
@@ -744,15 +755,13 @@ get_bf (param, valp)
return param;
}
-char *
+static char *
get_cr (param, regnop)
char *param;
unsigned *regnop;
{
unsigned regno;
unsigned c;
- int i;
- int name_len;
if (!strncmp (param, "cr", 2))
{
@@ -790,15 +799,13 @@ get_cr (param, regnop)
return param;
}
-char *
+static char *
get_fcr (param, regnop)
char *param;
unsigned *regnop;
{
unsigned regno;
unsigned c;
- int i;
- int name_len;
if (!strncmp (param, "fcr", 3))
{
@@ -836,7 +843,7 @@ get_fcr (param, regnop)
return param;
}
-char *
+static char *
get_vec9 (param, valp)
char *param;
unsigned *valp;
@@ -858,12 +865,34 @@ get_vec9 (param, valp)
return param;
}
+static char *
+get_o6 (param, valp)
+ char *param;
+ unsigned *valp;
+{
+ unsigned val;
+ char *save_ptr;
+
+ save_ptr = input_line_pointer;
+ input_line_pointer = param;
+ val = get_absolute_expression ();
+ param = input_line_pointer;
+ input_line_pointer = save_ptr;
+
+ if (val & 0x3)
+ as_warn ("Removed lower 2 bits of expression");
+
+ *valp = val;
+
+ return(param);
+}
+
#define hexval(z) \
(isdigit (z) ? (z) - '0' : \
islower (z) ? (z) - 'a' + 10 : \
isupper (z) ? (z) - 'A' + 10 : -1)
-char *
+static char *
getval (param, valp)
char *param;
unsigned int *valp;
@@ -1141,6 +1170,7 @@ md_estimate_size_before_relax (fragP, segment_type)
segT segment_type;
{
as_fatal ("Relaxation should never occur");
+ return (-1);
}
const relax_typeS md_relax_table[] =