This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: More macro processing weirdness
- To: "Andrew E. Mileski" <andrewm at netwinder dot org>
- Subject: Re: More macro processing weirdness
- From: Alan Modra <alan at linuxcare dot com dot au>
- Date: Fri, 13 Oct 2000 12:12:11 +1100 (EST)
- cc: binutils at sourceware dot cygnus dot com
On Thu, 12 Oct 2000, Andrew E. Mileski wrote:
> It seems expressions with whitespace padding are interpreted as
> separate args. This seems pretty strange to me.
Yes, I broke this in June 1998 when fudging the assembler pre-preprocessor
on x86 for opcode prefixes.
The problem is that the assembler was written with this sort of syntax in
mind:
[label:] <whitespace> mnemonic <whitespace> [operands]
Preprocessing magic collapses all whitespace into single spaces, and
removes all whitespace in the operands. Many places in the assembler thus
don't expect whitespace in operands, and you hit one of these with your
macros. I had to stop the preprocessor removing all whitespace in
operands because otherwise a line like "1: addr32 jmp $1234" was
pre-processed to "1: addr32 jmp$1234" and "jmp$1234" isn't recognized as a
valid instruction.
It's probably not too hard to fix, but I'm wondering why the macro code is
treating a space as a separator in light of the pre-processing I described
above.
Alan Modra
--
Linuxcare. Support for the Revolution.