From 4e9d8deacb172d5ebcee32576ffd910c69d3a467 Mon Sep 17 00:00:00 2001 From: David Edelsohn Date: Thu, 10 Apr 1997 21:54:15 +0000 Subject: [PATCH] * config/tc-m32r.c (md_begin): Set cgen_asm_parse_operand_fn. (md_assemble): Call cgen_asm_init_parse. Update call to m32r_cgen_assemble_insn, call as_bad if assembly failed. --- gas/ChangeLog | 6 ++++++ gas/config/tc-m32r.c | 15 +++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 68c6194b39a..880e9a56c33 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +Thu Apr 10 14:40:00 1997 Doug Evans + + * config/tc-m32r.c (md_begin): Set cgen_asm_parse_operand_fn. + (md_assemble): Call cgen_asm_init_parse. + Update call to m32r_cgen_assemble_insn, call as_bad if assembly failed. + Wed Apr 9 11:49:41 1997 Ian Lance Taylor * config/tc-m68k.c (m68k_ip): Handle #j. diff --git a/gas/config/tc-m32r.c b/gas/config/tc-m32r.c index 4761e3d6475..43bf7f75dc9 100644 --- a/gas/config/tc-m32r.c +++ b/gas/config/tc-m32r.c @@ -252,6 +252,10 @@ md_begin () subsegT subseg; /* Initialize the `cgen' interface. */ + + /* This is a callback from cgen to gas to parse operands. */ + cgen_asm_parse_operand_fn = cgen_asm_parse_operand; + /* Set the machine number and endian. */ CGEN_SYM (init_asm) (0 /* mach number */, target_big_endian ? CGEN_ENDIAN_BIG : CGEN_ENDIAN_LITTLE); @@ -306,10 +310,17 @@ md_assemble (str) #endif struct cgen_fields fields; const struct cgen_insn *insn; + char *errmsg; + + /* Initialize GAS's cgen interface for a new instruction. */ + cgen_asm_init_parse (); - insn = CGEN_SYM (assemble_insn) (str, &fields, buffer); + insn = CGEN_SYM (assemble_insn) (str, &fields, buffer, &errmsg); if (!insn) - return; + { + as_bad (errmsg); + return; + } if (CGEN_INSN_BITSIZE (insn) == 32) { -- 2.30.2