|
From: | Johannes Bauer |
Subject: | Re: [avr-gcc-list] Compiler error creating ISR prologue? |
Date: | Thu, 12 Aug 2010 19:45:02 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.11) Gecko/20100713 Thunderbird/3.0.6 |
Hi, On 12.08.2010 19:13, István wrote:
if I am not deluded by my memory, r1 permanently holds 0. Actually clr r1 is redundant.
Not in an ISR. http://www.nongnu.org/avr-libc/user-manual/FAQ.html says under "What registers are used by the C compiler?"
r1 - assumed to be always zero in any C code, may be used to remember something for a while within one piece of assembler code, but must then be cleared after use (clr r1). This includes any use of the [f]mul[s[u]] instructions, which return their result in r1:r0. Interrupt handlers save and clear r1 on entry, and restore r1 on exit (in case it was non-zero).
Regards, Johannes
[Prev in Thread] | Current Thread | [Next in Thread] |