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

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

[avr-gcc-list] Problem with Bit Shift using WinAVR20071221rc1


From: Moritz Federspiel
Subject: [avr-gcc-list] Problem with Bit Shift using WinAVR20071221rc1
Date: Tue, 25 Mar 2008 15:41:05 +0100

Hello everyone!
I got a little Problem on this simple Code:

/-------------code start-------------------/

uint32_t i; t;

for(i=0; i<20; i++)
  t = (1<<i);

/-------------code stop-------------------/

The results of this should be:
1
2
4
8
16
32
64
128
256
512
1024
2048
4096
8192
16384
-->4294934528

after the 16384 i get 4294934528, I dont know where the problem is.

I cant code in asm, but i watched the produced asm code in AVR-Studios Debugger and i noticed that only 2 of the 4 bits are copied in the used registers.
This might be a Compiler failure, or my Code is wrong, or my Compiler Flags are not correct.


Have you got any solutions for me? I'm not able to write inline asm code :(


regards MoFe

reply via email to

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