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

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

Re: [avr-gcc-list] Trying to learn Interrupts


From: Dmitry K.
Subject: Re: [avr-gcc-list] Trying to learn Interrupts
Date: Sun, 4 Jul 2004 12:06:49 +1100
User-agent: KMail/1.5

Laszlo wrote:
> ----------------
> ext_int_0:
>     in r16,TCNT1H
>     st X+,r16
>     in r16,TCNT1L
>     st X+,r16
>
>     rol r0;   rol r1;   rol r2;   rol r3;   rol r4;   rol r5;   rol
> r6;   rol r7;   rol r8;   rol r9;
>     clt
>     bld r0,0
>
>     reti
>
> ext_int_1:
>     in r16,TCNT1H
>     st X+,r16
>     in r16,TCNT1L
>     st X+,r16
>
>     rol r0;   rol r1;   rol r2;   rol r3;   rol r4;   rol r5;   rol
> r6;   rol r7;   rol r8;   rol r9;
>     set
>     bld r0,0
>
>     reti
> ----------------
> I should always get 9 registers full of
> "...010101010101010101010101010101..."
> In stead, I get 9 registers full of "...000000000001001000000000000010..."
> UNLESS...I take out the two "st X,TCNT1x" lines. If I do that it works
> great.

It is difficult to understand results of `st X+,TCNT1*' instructions with
values less than 0x60 or higher than 0x15F (for 2313 chip) of r26.
(Value of r27 is ignored in such instruction by this chip).

Regards.



reply via email to

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