------------ Původní zpráva ------------
Od: Paulo Marques <address@hidden>
Předmět: Re: [avr-gcc-list] incorrect function prolog/epilog?
Datum: 01.9.2006 13:12:58
----------------------------------------
Michal Grégr wrote:
> [...]
> I think it should restore SREG after both SPH and SPL is updated,
> otherwise an incorrect stack is used if an interrupt occurs between SPH
> and SPL write. Or am I wrong?
This is starting to be a FAQ ;)
Even if there are interrupts pending, the AVR will always execute _one_
more instruction after enabling interrupts before jumping to the
interrupt vector, so that code is safe.
Search the archives for "problem with stack" from June for a similar thread.
--
Paulo Marques
Software Development Department - Grupo PIE, S.A.
Phone: +351 252 290600, Fax: +351 252 290601
Web: www.grupopie.com
"The face of a child can say it all, especially the
mouth part of the face."