This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Problem with symbol definitions in recursive macros (gas)
- From: John Graham <johngavingraham at googlemail dot com>
- To: binutils at sourceware dot org
- Date: Sat, 6 Mar 2010 02:42:41 +0000
- Subject: Problem with symbol definitions in recursive macros (gas)
Hi there,
I'm trying to adapt the example of a recursive macro in the gas manual
(http://sourceware.org/binutils/docs-2.20/as/Macro.html#Macro) to
include a .global directive and a symbol definition. A cut-down
example would look like:
.macro example from, to
thing\from :
.long \from
.if \to-\from
example "(\from+1)",\to
.endif
.endm
Which I would've thought would be fine, but gas generates the errors
"Error: junk at end of line, first unrecognized character is `('" and
"Error: invalid character '(' in mnemonic" when I come to assemble. I
read the bit in the manual about the ':' or '.' being a potential
problem, but no number of spaces or \() escapes helps.
The error doesn't occur when the symbol name is static (i.e. doesn't
use the \from argument), so I assume this is the problem - is there
any way to "escape it more" (or something...)?
Thanks in advance for any advice anyone can give!
John G