Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: Using (16-bit) labels in WinAVR inline asm

2007-07-20 by Don Kinzer

--- In AVR-Chat@yahoogroups.com, "organix80" <organix@...> wrote:
> Does anyone know the method and constrains that must be used
> to read C SRAM variables using 'lds' and 'sts' in inline assembly?

Just use the variable's name, e.g.

char myVar;

int main (void)
{
__asm__ __volatile__
(
 "lds r24, myVar" "\n\t"
 :
 :
);
 return(0);
}

Don Kinzer
ZBasic Microcontrollers
http://www.zbasic.net

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.