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

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

Re: [avr-gcc-list] inline assembler


From: Philippe GIACINTI
Subject: Re: [avr-gcc-list] inline assembler
Date: Thu, 11 Oct 2001 11:02:03 +0200

on October 11 2001 Torsten Hahn <address@hidden> wrote:
 > Hi,
 > 
 > i have a c-file like this:
 > 
 > #define myreg r16
 > 
 > .
 > .
 > .
 > 
 > int main(void)
 > {
 > ...
 > asm ("
 >      LDI myreg, 0xff
 > ");
 > }
 > 
 > But this does not work ! How can i tell avr-gcc, to use the #define(ed) 
 > statements also in the inlined assembler sections ?
 > Or is there a directitive for the as like .define myreg r16 ?
 > 
 > CU,
 > Torsten.
 > -- 
 > Torsten Hahn / Chemnitzer Str. 4 / 09599 Freiberg / Germany
 > mail: address@hidden
 > phone: (+49) 177 2181338
 > pgp key avaiable at: http://math-www.uni-paderborn.de/pgpnet/wwwkeys.html
 > 
 > _______________________________________________
 > avr-gcc-list mailing list
 > address@hidden
 > http://avr.jpk.co.nz/mailman/listinfo/avr-gcc-list
 > 
Hello,

If you want that the preprocessor does its job, you have to put the
macro outside double quote ...

#define myreg r16
int main(void)
{
 ...
 __asm__("LDI "myreg",0xFF\n");
 ...
}
        
Regards.
-- 
Philippe Giacinti - Alcatel Business Systems
mailto:address@hidden



reply via email to

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