[Top][All Lists]

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

[avr-gcc-list] Array element in inline assembly

From: Matt McLellan
Subject: [avr-gcc-list] Array element in inline assembly
Date: Mon, 6 Jun 2005 14:33:54 -0700 (PDT)

Could someone help me out, I want to use the load an
array element into a register.  When I do this:

asm("lds r16, array+n"::);

Where n is the array element I want, it works fine. 
But what I want to do it this:

asm("lds r16, array[element]"::);

That gives me the following error:

Error: garbage at end of file

I've also tried passing it as an arguement, but can't
seem to figure out what constraint to use:

asm("lds r16, %0": "=x" (array[element]):);

I've tried every constraint for x in the manual, but
none of them seem to work.  Is there a newer version
of the inline assembly manual that I haven't found? 
The one I'm using is:

Any help would be appreciated.


reply via email to

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