avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] incorrect function prolog/epilog?


From: Paulo Marques
Subject: Re: [avr-gcc-list] incorrect function prolog/epilog?
Date: Fri, 01 Sep 2006 12:12:56 +0100
User-agent: Thunderbird 1.5.0.4 (X11/20060516)

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."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]