[Top][All Lists]

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

Re: [avr-gcc-list] Inline assembler question

From: Iztok Zupet
Subject: Re: [avr-gcc-list] Inline assembler question
Date: Tue, 17 Jun 2003 09:03:53 +0200
User-agent: KMail/1.4.3

On Tuesday 17 June 2003 00:00, Marko Panger wrote:
> Hi all,
> My nervous are satrting to, because I am unable to load and address of a
> global defined variable in the inline assembler. I would like to do
> something like that:
> Global var:
> uint8 myVar;
> later...in a function..
> -------------------------
> asm volatile "ldi r22, %A1 \n" \
>                                       "ldi r23, %B1 \n" \
>                                       ::"m"(myVar));
> But the thing doesn't want to know to copile. I must be doing something
> wrong with the variable constraint and I would ask if someone knows how to
> solve this.

Dont use the Load Imediate instruction, rather use the lds. It's as simple as 

        asm volatile "lds r23,myVar\n"


reply via email to

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