avr-chat
[Top][All Lists]
Advanced

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

Re: [avr-chat] Inline assembler warning: asm operand 2 probably doesn't


From: Joerg Wunsch
Subject: Re: [avr-chat] Inline assembler warning: asm operand 2 probably doesn't match constraints
Date: Tue, 8 Feb 2011 22:50:36 +0100 (MET)

Rick Mann <address@hidden> wrote:

>         asm volatile (  "in     %0, %1"         "\n\t"
>                         "andi   %0, %2"         "\n\t"
>                         "out    %1, %0"         "\n\t"

"andi" requires an immediate operand.  So it takes the "r24" that is
passed by the compiler as an immediate rather than a register.  The
value of "r24" is not known to the assembler by that time, thus the
assembler marks the symbol as "global undefined" in the object file.
The linker then eventually complains because it cannot resolve that
symbol ...

My guess is you'd like to use "and" rather than "andi". ;-)

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)



reply via email to

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