On Wed, 28 Apr 2004 at 23:50 +0200, Robert Seczkowski <rs...@poczta.onet.pl...:

>        ... ret += 1<<(3*j) * k; ...

> Compiler doesn't report error. However code is not working as expected

I doesn't return the correct results because you need
to add parenthesis
>        ... ret += (1<<(3*j)) * k; ...
   you were getting
               1<<((3*j) * k); ...

> To my suprise the code disables interrupts for ever.

How did you determine that?  Chris already showed how
R2 (containing the GIE bit) is saved and restored.

Reply via email to