avr-gcc-list
[Top][All Lists]
Advanced

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

Re: [avr-gcc-list] Accessing C sram locations in inline asm


From: Theodore A. Roth
Subject: Re: [avr-gcc-list] Accessing C sram locations in inline asm
Date: Fri, 6 Sep 2002 13:21:01 -0700 (PDT)

On Fri, 6 Sep 2002, Grant Stockly wrote:

:) I tried.   asm volatile("lds r24, %1" :: "label" (sram_byte) ); failed no
:) matter what I tried.  (Subtracting the memory start offset, etc.

How about this:

  asm volatile("lds r24, %0" :: "r" (sram_byte) );

sram_byte should end up in a register. Perform a disassemble with
`avr-objdump -D -S' and examine the generated asm. It's usually very
educational as to what the compiler is doing.

Ted Roth

avr-gcc-list at http://avr1.org



reply via email to

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