Yahoo Groups archive

AVR-Chat

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

Message

Re: Claiming global registers in WinAVR / assembly

2007-07-18 by organix80

Thanks for all usefull answers!

This one: "register char foo asm("r2");" is exactly what I searched
for. It works fine!

Best regards Laurens

--- In AVR-Chat@yahoogroups.com, "Don Kinzer" <dkinzer@...> wrote:
>
> --- In AVR-Chat@yahoogroups.com, "organix80" <organix@> wrote:
> > Is it possible to claim registers that not should be
> > used by the C compiler?
> I believe that this will work:
> 
> register char foo asm("r2");
> 
> The avr-libc documentation indicates that this usage should be 
> restricted to registers r2 through r15.  You should minimize the 
> dedication of registers like this, however, since it infringes on the 
> e compiler's ablility to optimize your code.
> 
> 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.