Hi,
I just realized that there migth be a bug in the generated assempler...
do
{
} while (ABC == 0x01 );
166: 80 91 60 00 lds r24, 0x0060
16a: 81 30 cpi r24, 0x01 ; 1
16c: f1 f3 breq .-4 ; 0x16a
ABC is updated by an interrupt routine. breq.-4 only jumps back to the
cpi statement, so the updated ABC is not taken into account. Loops
forever!
do
{
} while (somefunction() != 0);
132: 86 d1 rcall .+780 ; 0x440
134: 88 23 and r24, r24
136: e9 f7 brne .-6 ; 0x132
somefunction() returns ABC. Here brne.-6 jumps back to rcall. It works!
I currently use these packages:
binutils-2.11.2
gcc-3.0
avr-libc-20011208
Questions:
Where is this error located? binutils, gcc or avr-libc?
Could it be corrected in later versions, if so which one?
Where to report the error?
Best regards
Arne
avr-gcc-list at http://avr1.org
.