> * r1 always has the value zero > * A function can freely modify r0, BUT!..... > Moreover, an ISR must preserve all register values and cannot rely on > r1 being zero. Maybe I'm missing something here, but what's the point of "almost always having 0 in R1" In ASM, I allocate a register to hold 0, but it is ALWAYS zero, and I have a sanity check routine that looks for any non-zero values in R0, stack other than a predefined value in main, as well as other values that I can know in advance. > The code that was generated for the ISR is reasonable with respect to > these assumptions. It is a known issue, however, that generated ISR > code sometimes goes to the trouble of saving and zeroing r1 when it > doesn't use r1 itself and doesn't call any external functions. That seems like a trivial thing to fix.
Message
Re: [AVR-Chat] Re: Arrays and pointers in GCC
2009-01-12 by David VanHorn
Attachments
- No local attachments were found for this message.