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

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

Re: [avr-gcc-list] Gcc bug??


From: Kang Tin LAI
Subject: Re: [avr-gcc-list] Gcc bug??
Date: Wed, 03 Mar 2004 22:19:32 +0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1

<x-flowed>

What I then determined is that the "0" register (r1) contained the value 8!


Joerg Wunsch wrote:
> As Anich Gregor <address@hidden> wrote:
>
>
>>When the program is interrupted it is absolutely possible that the
>>zero-reg is not zero at this time because it is defined to be zero
>>whenever a C function is called - you can do with it whatever you
>>want to as long as you make sure that you set it to zero again before
>>giving control back to compiler-generated code because it depends on
>>that ;)
>
>
> The biggest problem is that zero_reg as r0 is a poor choice because it
> can be clobbered by the hardware multiplication result in the ATmega.
> (IMHO, this detail has been unknown to the AVR-GCC developers by the
> time they've chosen about zero_reg.)


If you define your own interrupt, you need to take care the "0" register:
push and clear after entering isr, and then pop back before leaving isr.

--
---
Kang Tin LAI <address@hidden>
-----


_______________________________________________
avr-gcc-list mailing list
address@hidden
http://www.avr1.org/mailman/listinfo/avr-gcc-list

</x-flowed>

reply via email to

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