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 question


From: Marko Panger
Subject: Re: [avr-gcc-list] Inline assembler question
Date: Tue, 17 Jun 2003 09:14:14 +0200

Hi Iztok,

I think the meaning is not the same. I don't want to load the content of a
variable, but the address of a variable.

Regards,
Marko

----- Original Message -----
From: "Iztok Zupet" <address@hidden>
To: "Marko Panger" <address@hidden>; <address@hidden>
Sent: Tuesday, June 17, 2003 9:03 AM
Subject: Re: [avr-gcc-list] Inline assembler question


> 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"
>
> Regards
> Iztok
>



reply via email to

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