aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1996-02-13 00:20:13 +0000
committerIan Lance Taylor <ian@airs.com>1996-02-13 00:20:13 +0000
commit20710f1c0ccbba776cfb966cbb41fd7b7cf6cbb1 (patch)
tree432a076ab1435f1d148a46b8d23413281db62cb8 /gas/config
parent229b2c8788d8faf894c99fbf346a2613c760b1c3 (diff)
downloadgdb-20710f1c0ccbba776cfb966cbb41fd7b7cf6cbb1.zip
gdb-20710f1c0ccbba776cfb966cbb41fd7b7cf6cbb1.tar.gz
gdb-20710f1c0ccbba776cfb966cbb41fd7b7cf6cbb1.tar.bz2
* read.c (potable): Add "mri" and ".mri".
(s_mri): New function. * read.h (s_mri): Declare. * app.c (scrub_m68k_mri): New static variable. (mri_pseudo): New static variable. (do_scrub_begin): Add m68k_mri parameter. Use it rather than flag_m68k_mri. Initialize scrub_m68k_mri. (mri_state, mri_last_ch): New static variables. (struct app_save): Add scrub_m68k_mri, mri_state, and mri_last_ch fields. (app_push): Save new fields. (app_pop): Restore new fields. (do_scrub_chars): Check scrub_m68k_mri rather than flag_mri_mri. If TC_M68K, use a trivial state machine to look for occurrences of the .mri pseudo-op, and change the mode appropriately. * as.h (do_scrub_begin): Update prototype. * input-scrub.c (input_scrub_begin): Pass flag_m68k_mri to do_scrub_begin. * config/tc-m68k.c (reg_prefix_optional_seen): New static variable. (m68k_mri_mode_change): New function. (md_parse_option): Set reg_prefix_optional_seen. * config/tc-m68k.h (m68k_mri_mode_change): Declare. (MRI_MODE_CHANGE): Define. * doc/as.texinfo: Document .mri pseudo-op.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-m68k.c41
-rw-r--r--gas/config/tc-m68k.h3
2 files changed, 44 insertions, 0 deletions
diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c
index 8b31283..5235db4 100644
--- a/gas/config/tc-m68k.c
+++ b/gas/config/tc-m68k.c
@@ -74,6 +74,9 @@ int flag_reg_prefix_optional = REGISTER_PREFIX_OPTIONAL;
int flag_reg_prefix_optional;
#endif
+/* Whether --register-prefix-optional was used on the command line. */
+static int reg_prefix_optional_seen;
+
/* The floating point coprocessor to use by default. */
static enum m68k_register m68k_float_copnum = COP1;
@@ -3488,6 +3491,43 @@ m68k_init_after_args ()
md_relax_table[TAB (PCINDEX, BYTE)].rlx_more = 0;
}
+/* This is called if we go in or out of MRI mode because of the .mri
+ pseudo-op. */
+
+void
+m68k_mri_mode_change (on)
+ int on;
+{
+ if (on)
+ {
+ if (! flag_reg_prefix_optional)
+ {
+ flag_reg_prefix_optional = 1;
+#ifdef REGISTER_PREFIX
+ init_regtable ();
+#endif
+ }
+ m68k_abspcadd = 1;
+ m68k_rel32 = 0;
+ }
+ else
+ {
+ if (! reg_prefix_optional_seen)
+ {
+#ifdef REGISTER_PREFIX_OPTIONAL
+ flag_reg_prefix_optional = REGISTER_PREFIX_OPTIONAL;
+#else
+ flag_reg_prefix_optional = 0;
+#endif
+#ifdef REGISTER_PREFIX
+ init_regtable ();
+#endif
+ }
+ m68k_abspcadd = 0;
+ m68k_rel32 = 1;
+ }
+}
+
/* Equal to MAX_PRECISION in atof-ieee.c */
#define MAX_LITTLENUMS 6
@@ -6189,6 +6229,7 @@ md_parse_option (c, arg)
case OPTION_REGISTER_PREFIX_OPTIONAL:
flag_reg_prefix_optional = 1;
+ reg_prefix_optional_seen = 1;
break;
/* -V: SVR4 argument to print version ID. */
diff --git a/gas/config/tc-m68k.h b/gas/config/tc-m68k.h
index 3f99de9..5602857 100644
--- a/gas/config/tc-m68k.h
+++ b/gas/config/tc-m68k.h
@@ -116,6 +116,9 @@ extern int m68k_aout_machtype;
#define NO_PSEUDO_DOT
#endif
+extern void m68k_mri_mode_change PARAMS ((int));
+#define MRI_MODE_CHANGE(i) m68k_mri_mode_change (i)
+
#ifdef BFD_ASSEMBLER
#define tc_frob_symbol(sym,punt) \