diff options
author | Ian Lance Taylor <ian@airs.com> | 1995-08-21 18:35:11 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1995-08-21 18:35:11 +0000 |
commit | 7e047ac2c1fcb16f721c715a48c8d4b8b4776485 (patch) | |
tree | e564914df3cf5fa253fbf65ea8b9b36deaddd40a /gas/config/tc-m68k.c | |
parent | 7172e2266f4a25fc34dda564ac13c89c9d855cde (diff) | |
download | binutils-7e047ac2c1fcb16f721c715a48c8d4b8b4776485.zip binutils-7e047ac2c1fcb16f721c715a48c8d4b8b4776485.tar.gz binutils-7e047ac2c1fcb16f721c715a48c8d4b8b4776485.tar.bz2 |
Add support for macros.
* as.c: Include sb.h and macro.h.
(max_macro_next): New global variable.
(main): Call macro_init.
(macro_expr): New static function.
* as.h (max_macro_nest): Declare.
* read.c (line_label): Rename from mri_line_label. Change all
uses.
(potable): Add exitm, irp, irpc, macro, mexit, rept.
(read_a_source_file): Always clear line_label at the start of a
line, not just when flag_mri or LABELS_WITHOUT_COLONS. Fixup
MRI/LABELS_WITHOUT_COLONS handling. In MRI mode, permit label:
equ val. Set line_label when calling colon. In MRI mode, a
leading '.' does not imply a pseudo-op. Check for macro expansion
before calling md_assemble.
(s_irp): New function.
(get_line_sb): New static function.
(s_macro): New function.
(s_mexit): New function.
(s_rept): New function.
* read.h (line_label): Rename from mri_line_label.
(s_irp, s_rept): Declare.
(s_macro, s_mexit): Declare.
* input-scrub.c: Include sb.h.
(sb_index, from_sb): New static variables.
(macro_nest): New static variable.
(struct input_save): Add sb_index and from_sb fields. Change
next_saved_file field to be struct input_save *.
(next_saved_file): Changed to be struct input_save *.
(input_scrub_push): Change to return type struct input_save *.
Save sb_index and from_sb.
(input_scrub_pop): Change parameter type to struct input_save *.
Restore sb_index and from_sb.
(input_scrub_include_sb): New function.
(input_scrub_next_buffer): Handle reading from from_sb.
(bump_line_counters): Only increment lines if not using from_sb.
* config/tc-m68k.c (opt_table): Add nest.
(opt_nest): New static function.
* gasp.c: Include sb.h and macro.h. Move all sb related functions
and definitions to sb.h and sb.c. Move all macro related
functions and definitions to macro.h and macro.c.
* sb.h, sb.c: New files, extracted from gasp.c.
* macro.h, macro.c: Likewise.
* Makefile.in (OBJS): Add sb.o and macro.o
(GASPOBJS): Define.
(gasp.new): Depend upon $(GASPOBJS). Use $(GASPOBJS) to link.
(TARG_CPU_DEP_m68k): Depend upon subsegs.h.
(gasp.o): Depend upon sb.h and macro.h.
(sb.o): New target.
(macro.o): New target.
(as.o): Depend upon sb.h and macro.h.
(input-scrub.o): Depend upon sb.h.
(read.o): Depend upon sb.h and macro.h.
Diffstat (limited to 'gas/config/tc-m68k.c')
-rw-r--r-- | gas/config/tc-m68k.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c index b212d50..fe3ee54 100644 --- a/gas/config/tc-m68k.c +++ b/gas/config/tc-m68k.c @@ -4243,6 +4243,7 @@ struct opt_action /* The table used to handle the MRI OPT pseudo-op. */ static void skip_to_comma PARAMS ((int, int)); +static void opt_nest PARAMS ((int, int)); static void opt_chip PARAMS ((int, int)); static void opt_list PARAMS ((int, int)); static void opt_list_symbols PARAMS ((int, int)); @@ -4274,6 +4275,7 @@ static const struct opt_action opt_table[] = { "mex", 0, 0, 0, 0 }, { "mc", 0, 0, 0, 0 }, { "md", 0, 0, 0, 0 }, + { "nest", opt_nest, 0, 0, 0 }, { "next", skip_to_comma, 0, 0, 0 }, { "o", 0, 0, 0, 0 }, { "old", 0, 0, 0, 0 }, @@ -4373,6 +4375,23 @@ skip_to_comma (arg, on) ++input_line_pointer; } +/* Handle the OPT NEST=depth option. */ + +static void +opt_nest (arg, on) + int arg; + int on; +{ + if (*input_line_pointer != '=') + { + as_bad ("bad format of OPT NEST=depth"); + return; + } + + ++input_line_pointer; + max_macro_nest = get_absolute_expression (); +} + /* Handle the OPT P=chip option. */ static void @@ -4424,7 +4443,7 @@ s_reg (ignore) struct m68k_op rop; unsigned long mask; - if (mri_line_label == NULL) + if (line_label == NULL) { as_bad ("missing label"); ignore_rest_of_line (); @@ -4481,9 +4500,9 @@ s_reg (ignore) return; } - S_SET_SEGMENT (mri_line_label, absolute_section); - S_SET_VALUE (mri_line_label, mask); - mri_line_label->sy_frag = &zero_address_frag; + S_SET_SEGMENT (line_label, absolute_section); + S_SET_VALUE (line_label, mask); + line_label->sy_frag = &zero_address_frag; demand_empty_rest_of_line (); } |