Hi.
Alas, there is a circumstance which does preservation of register RAMPZ
obligatory. At least, obligatory by default. The 128KB-flash crystal has
semidocumented feature (IMHO, bug): at performance of reading from memory
the command 'LD R,Z+' modifies the RAMPZ register in case of wrapping. The
same is for other 3 combinations (ST, -Z). I have checked up it on the
AT90CAN128. Thus, absolutely harmless pure C code, like
while (*dst++ = *src++);
where both of a file are located in the SRAM, can destroy the RAMPZ if
one of arrays is located with edge.
Strictly speaking, absence of preservation of the RAMPZ (by default)
is a mistake which should be corrected in all Avr-gcc versions.
Let's notice, that in all known crystals the RAMPZ does not influence
in any way operations from the RAM.
Dmitry.
_______________________________________________
AVR-GCC-list mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list