[Icc-430] Re: Interrupt handler wrapper preserves R8,9 - repost

Richard richard-lists at imagecraft.com
Thu Jan 25 13:06:12 PST 2007


The problem here is that the compiler does not compute the total register 
usage of all functions nor generate a call graph (it can't anyway) so if 
your ISR calls out to another routine, that routine can be anything! C, 
asm, who knows that may eventually touch preserved registers etc. In 
theory, we can ignore the preserved registers IF the users read the manual 
and obey the calling convention. However, if they don't, their ISR may fail 
randomly and usually the compiler gets blamed for random failures :-) [ 
Just have a case where a user says: hey the AVR compiler is unreliable when 
my program gets bigger than 64K bytes on the AVR, and it turns out to be 
his hardware power supply problem... The worst is people are very keen on 
blaming the compiler and usually not tell me when they found out it's not 
the compiler problem after all, leaving me wondering whether it is a 
compiler .... but I digress. sorry]

Anyway, I know what you are saying, I am just weighting the PROs and CONs...

At 12:10 PM 1/25/2007, Kris Heidenstrom wrote:
...Sorry, I was not clear. I should have said... my interrupt handler
>calls a function. That's all it does. (The function is also called from
>elsewhere.) So the interrupt handler code itself doesn't destroy
>any registers, it is only the called function that does. That's why I
>listed the descriptions of the "preserved registers" and "volatile
>registers" from the help.
>
>...

// richard (This email is for mailing lists. To reach me directly, please 
use richard at imagecraft.com) 



More information about the Icc-430 mailing list