I have a question about AVR-LIBC FAQ #27:

http://www.nongnu.org/avr-libc/user-manual/FAQ.html#faq_spman

"Why are interrupts re-enabled in the middle of writing the stack pointer?"

I understand that when the SEI instruction is used,
"The instruction following SEI will be executed before any pending interrupts".
I'm fine with that.  So using out __SP_H_,r29 SEI, out __SP_L_,r28 would
always be safe.  Might not be what you wanted if interrupts where off.

However I have missed any Atmel documentation that says a 'out' to SREG
applies that same protection?  Does that mean all 'out' instructions
delay pending interrupts, or just 'out' instructions to SREG?
What document did I miss reading?

        in __tmp_reg__,__SREG__
        cli
        out __SP_H__,r29
        out __SREG__,__tmp_reg__
        out __SP_L__,r28



_______________________________________________
AVR-libc-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-libc-dev

Reply via email to