however the recommendation is:
From the Data sheet:
---------------
It is recommended to have
the Global Interrupt Flag cleared during the four last steps to avoid
these problems.
--------------
Well.. There's no reason to do it until you need to.. Atmel data sheets have been known to be less than completely accurate. :)
>This does assume that your ISR preserves Z
I'm very careful in my ISRs to preserve ALL registers used
within. Sure miss the automatic register save of the HC11
though. :-)
Sometimes I don't save ANY registers in an int.
Just depends what's going on.
Sometimes I only need to do things that won't affect the SREG.
I do reserve a pair of registers for the ISRs, and one to store SREG in, so that a typical ISR has no pushes or pops.
Int:
in STEMP,SREG
ldi ITEMP,stuff
ldi itemp2.stuff
.... code happens
out SREG,STEMP
reti
Sorry, gmail dosen't do tabs.
--
Feel the power of the dark side! Atmel AVR