--- On Sun, 2/22/09, Georg-Johann Lay <a...@gjlay.de> wrote:
> You can do this by introducing two global register
> variables like
> 
> register foo_t * pfoo asm ("r2");
> 
> 
> Also note the command line option -ffixed-2 -ffixed-3 that
> turn R2/R3 into fixed registers (in contrast to R2/R3 beeing
> call-saved-regs, which is the default for them).
> 
> Also note that you most probably won't experience the
> desired reduction of program memory and/or execution time.
> This is because the compiler must move R2 to X, Y, or Z to
> access a location.
> 
> Making Y or Z global regs will crash the compiler sooner or
> later. I would not recommend to make X global, either.
 
 

In your sample code above only R2 (8 bit) is bound to the variable. I had a 
similar requirement for using 16 bit (say X register) as pointer, can you post 
a sample line of code on how to do this? Thank you.

Nayani



      


_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to