[Top][All Lists]

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

Re: [avr-gcc-list] Assembler programs with avr-as

From: Bruce D. Lightner
Subject: Re: [avr-gcc-list] Assembler programs with avr-as
Date: Tue, 10 Dec 2002 16:07:34 -0800


> To the best of my knowledge, you _could_ use avr-as standalone.
> Although doing so, you can't use the C preprocessor (ok, you could
> run it manually, but that'd be a royal pain) and you'd have to write
> (or port) include files.

My tests show that the following works under both Win32 and Linux...

   avr-gcc -c -x assembler foo.s

where "foo.s" is your AVR assembly source file.  The gcc pre-processor
will be run on the source file *before* the assembler is invoked. 

Under my Linux version, the preprocessor is run even if the "-x assembler"
option is left off.  (Under Unix (i.e., SunOS and Solaris), as I recall,
".s" files did not get preprocessing, but ".S" files did.)

If you do this and then add the proper collection of "#include" directives
to your assembly source code, you will likely get all the important I/O
definitions, like PORTB, PINB, etc.

I've been unable to get rid of all of my old AVR assembly code, but I'm

BEWARE: AVR *assembler* macro expansion (not gcc preprocessor macros) was
"broken" in a few areas by the switch to gcc 3.x.  If you have any
"tricky" AVRASM macros, you may encounter problems, as we did.

Best regards,


 Bruce D. Lightner
 Lightner Engineering
 La Jolla, California
 Email: address@hidden
 URL: http://www.lightner.net/lightner/bruce/
avr-gcc-list at http://avr1.org

reply via email to

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