This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: More macro processing weirdness


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]