avr-gcc-list
[Top][All Lists]
Advanced

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

Re: [avr-gcc-list] Using __tmp_reg__ etc in assembly file


From: Colin Wall
Subject: Re: [avr-gcc-list] Using __tmp_reg__ etc in assembly file
Date: Fri, 23 Jan 2009 13:40:10 +1300

Georg-Johann Lay <address@hidden> wrote on 23/01/2009 01:06:01 p.m.:

> > 
> > So, from what I can see, the compiler makes these defines available to
> > C source, but not to asm (.S) source, and I need to repeat them myself
> > in the asm file to use them there.
> 
> No, these defines are not available in a C source. They are available in 

> a assembler .s source that is generated by the compiler.
> So you can use this in your inline asm.
> 
> If you like make you can make the assembler source(s) dependent on a 
> dummy header:
> 
> .INTERMEDIATE: asm-defines.h dummy.c
> 
> %.S: asm-defines.h
> 
> dummy.c:
>    touch $<
> 
> asm-defines.h: dummy.c
>    avr-gcc -mmcu=$(MCU_TARGET) -S $< -o $@
> 
> and include the generated header in your files
> 
> #include "asm-defines.h"
> 
> in order to be always in sync with the compiler and the target.
> 

Thanks Georg-Johan,
That explains it clearly, and your suggestion is just the kind of thing I
had been looking for.

Colin.



###########################################################################
This e-mail is confidential and may contain information subject to legal 
privilege.  If you are not the intended recipient please advise us of our
error by return e-mail then delete this e-mail and any attached files.  
You may not copy, disclose or use the contents in any way.  

The views expressed in this e-mail may not be those of Gallagher Group 
Ltd or subsidiary companies thereof.
###########################################################################




reply via email to

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