This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[PATCH] add directive to enter/leave alternate macro mode
- From: "Jan Beulich" <JBeulich at novell dot com>
- To: <binutils at sources dot redhat dot com>
- Date: Thu, 03 Jun 2004 11:50:15 +0200
- Subject: [PATCH] add directive to enter/leave alternate macro mode
2004-06-03 Jan Beulich <jbeulich@novell.com>
* gas/macro.c: New function macro_set_alternate.
* gas/macro.h: Declare macro_set_alternate.
* gas/read.c: Add and handle new .altmacro directive.
---
/home/jbeulich/src/binutils/mainline/2004-06-03.09.12/gas/macro.c 2003-11-24
18:52:33.000000000 +0100
+++ 2004-06-03.09.12/gas/macro.c 2004-05-26 13:52:01.000000000
+0200
@@ -132,6 +132,15 @@
macro_expr = expr;
}
+/* Switch in and out of alternate mode on the fly. */
+
+void
+macro_set_alternate(alternate)
+ int alternate;
+{
+ macro_alternate = alternate;
+}
+
/* Switch in and out of MRI mode on the fly. */
void
---
/home/jbeulich/src/binutils/mainline/2004-06-03.09.12/gas/macro.h 2003-11-24
18:52:33.000000000 +0100
+++ 2004-06-03.09.12/gas/macro.h 2004-05-26 14:05:27.000000000
+0200
@@ -73,6 +73,7 @@
extern int buffer_and_nest (const char *, const char *, sb *, int (*)
(sb *));
extern void macro_init
(int, int, int, int (*) (const char *, int, sb *, int *));
+extern void macro_set_alternate (int);
extern void macro_mri_mode (int);
extern const char *define_macro
(int, sb *, sb *, int (*) (sb *), const char **);
---
/home/jbeulich/src/binutils/mainline/2004-06-03.09.12/gas/read.c 2004-04-19
11:32:55.000000000 +0200
+++ 2004-06-03.09.12/gas/read.c 2004-06-03 10:12:02.109358360
+0200
@@ -216,6 +216,7 @@
static void do_align (int, char *, int, int);
static void s_align (int, int);
+static void s_altmacro (int);
static int hex_float (int, char *);
static segT get_known_segmented_expression (expressionS * expP);
static void pobegin (void);
@@ -251,6 +252,7 @@
static const pseudo_typeS potable[] = {
{"abort", s_abort, 0},
{"align", s_align_ptwo, 0},
+ {"altmacro", s_altmacro, 1},
{"ascii", stringer, 0},
{"asciz", stringer, 1},
{"balign", s_align_bytes, 0},
@@ -351,6 +353,7 @@
{"mri", s_mri, 0},
{".mri", s_mri, 0}, /* Special case so .mri works in MRI mode. */
{"name", s_ignore, 0},
+ {"noaltmacro", s_altmacro, 0},
{"noformat", s_ignore, 0},
{"nolist", listing_list, 0}, /* Turn listing off. */
{"nopage", listing_nopage, 0},
@@ -1320,6 +1323,15 @@
s_align (arg, 0);
}
+/* Switch in and out of alternate macro mode. */
+
+void
+s_altmacro (int on)
+{
+ demand_empty_rest_of_line ();
+ macro_set_alternate (on);
+}
+
symbolS *
s_comm_internal (int param,
symbolS *(*comm_parse_extra) (int, symbolS *,
addressT))