is it possible to change compiler options in a way that it doesn't use specific AVR registers? Is it possible to use a different calling convention? (default is R25 - R16 + stack, isn't it?)
For obvious reasons, you can't change the calling convention without
modifying the compiler source code. (IIRC, you can choose a different
register allocation algorithm, but I've got no ideas how much value
this would really have.)
You can globally bind a variable to a register though (see the
avr-libc FAQ), but you gotta be careful about this feature. If you
exaggerate this, you're likely to cause the compiler to pessimize your
code since it is no longer free in its register allocator. Also, not
all registers are safe for global allocation, IIRC you can only use
regs r2 through r15.
Please don't send me PMs, use email if you want to approach me personally.
© 2018 Microchip Technology Inc.