From 20710f1c0ccbba776cfb966cbb41fd7b7cf6cbb1 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 13 Feb 1996 00:20:13 +0000 Subject: * 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. --- gas/read.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'gas/read.c') diff --git a/gas/read.c b/gas/read.c index ba392c0..8e0a1c9 100644 --- a/gas/read.c +++ b/gas/read.c @@ -333,6 +333,8 @@ static const pseudo_typeS potable[] = {"lsym", s_lsym, 0}, {"macro", s_macro, 0}, {"mexit", s_mexit, 0}, + {"mri", s_mri, 0}, + {".mri", s_mri, 0}, /* Special case so .mri works in MRI mode. */ {"name", s_ignore, 0}, {"noformat", s_ignore, 0}, {"nolist", listing_list, 0}, /* Turn listing off */ @@ -1994,6 +1996,37 @@ s_mexit (ignore) buffer_limit = input_scrub_next_buffer (&input_line_pointer); } +/* Switch in and out of MRI mode. */ + +void +s_mri (ignore) + int ignore; +{ + int on, old_flag; + + on = get_absolute_expression (); + old_flag = flag_mri; + if (on != 0) + { + flag_mri = 1; +#ifdef TC_M68K + flag_m68k_mri = 1; +#endif + } + else + { + flag_mri = 0; + flag_m68k_mri = 0; + } + +#ifdef MRI_MODE_CHANGE + if (on != old_flag) + MRI_MODE_CHANGE (on); +#endif + + demand_empty_rest_of_line (); +} + /* Handle changing the location counter. */ static void -- cgit v1.1