[Top][All Lists]

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

[avr-libc-dev] revised:problem with inline assembly

From: varsha
Subject: [avr-libc-dev] revised:problem with inline assembly
Date: Tue, 20 Sep 2005 10:27:34 +0530

hello everyone,
As  mentioned in the pdf avr-libc-user-manual -1.2.3, in the section 7.4.7C 
"names used in Assembler code",
that with WINAVR GCC we can specify use of specific register by using 
register unsigned char counter asm("r3");

so that assembler will use register r3 when we do operations with counter 

but i tried it one program but doesn't work....!!

if i specify say 4 variables in my c program crc0,crc1,crc3and crc4...as
register unsigned char crc0 asm("r11");
register unsigned char crc1 asm("r12");
register unsigned char crc2 asm("r13");
register unsigned char crc3 asm("r14");

crc0=crc1=crc2=crc3=0xff;              //assign some vaue to them...

__asm__ __volatile__      
    "lsl crc0"     "\n\t"                        //this doesn't work
    "rol crc1"     "\n\t"                        //it gives error as constant 
value required
    "rol crc2"     "\n\t" 
    "rol crc3"

__asm__ __volatile__      
    "lsl crc0"     "\n\t" 
    "rol r12"     "\n\t"                            //this works
    "rol r13"     "\n\t" 
    "rol r14"

please reply soon,
thanks and regards,

***********************Confidentiality Notice***************************

 The information contained in this electronic message and any attachments
to this message are intended for the exclusive use of the addressee(s)
and may contain confidential or privileged information. If you are not
the intended recipient, please notify the sender at Divinet or
address@hidden  immediately and destroy all copies of this
message and any attachments.


reply via email to

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