[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] How to do multi-line assembler macros?

From: Brian Dean
Subject: Re: [avr-gcc-list] How to do multi-line assembler macros?
Date: Tue, 9 Sep 2003 17:43:21 -0400
User-agent: Mutt/1.4.1i

Hi Oleksandr,

On Tue, Sep 09, 2003 at 10:22:55PM +0300, Oleksandr Redchuk wrote:

> Why do you not use "native" assembler macro capabilities?
> (and local labels inside macro)

Yes, I learned of the '.macro' directive while I was trying to figure
out how to use the C preprocessor to acheive my goal, and wrote a very
similar looking macro to the one you suggested and it works fine.
Thanks though!

However, there is one advantage to using the C preprocessor and that
is that you can preprocess the file to stdout and see exactly what is
being sent to the assembler.  For example, given my input file of
foo.S, I can say 'make foo.s' and see how the macro expands.  I
couldn't seem to figure out how to do the equivalent when using the
'.macro' directive, even when turning on the assembly listing (the -a
flag).  As a result, I'd get cryptic assembly errors due to errors in
my '.macro' but was only able to guess as what may be causing them.
Eventually, by trial and error, I figured it out, but it would have
been easier had the assembler been able to print out the macro
expansion in the listing file.

Brian Dean, address@hidden
BDMICRO - Maker of the MAVRIC ATmega128 Dev Board

reply via email to

[Prev in Thread] Current Thread [Next in Thread]