[Top][All Lists]

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

[avr-gcc-list] Problems with avr-gcc vers 3.0

From: Maurizio Ferraris
Subject: [avr-gcc-list] Problems with avr-gcc vers 3.0
Date: Mon, 06 Aug 2001 13:45:51 +0200

I just switched to avr-gcc version 3.0 and successfully recompiled all my old code.
I even had a small reduction in code size.
The problem is that the code is not working anymore.
Looking around and trying to figure what happened, I came across this piece of code. The delay routine is simply an empty loop from 0 to 4999. The implementation is something that I don't understand and I feel that it is wrong. The counter seems to be initialized at 4999 and not at zero (ok, since it is not used inside the loop, it doesn't really matters), and it is decremented toward zero, but not by one, but by 625. I used the packed installation found on avrfreaks for win32, and using the makefiles found in the gcctest.zip (I didn't dare change any switches ... I only added my files and include directories).
Is there something I must know?

 102:../Common/Util.c **** void delay(void)
 103:../Common/Util.c **** {
 104:../Common/Util.c ****   int counter;
 105:../Common/Util.c ****
 106:../Common/Util.c ****   for(counter = 0; counter < 5000; counter++)
 347 0104 87E8                  ldi r24,lo8(4999)
 348 0106 93E1                  ldi r25,hi8(4999)
 349                    .L35:
 350 0108 8157                  subi r24,lo8(-(-625))
 351 010a 9240                  sbci r25,hi8(-(-625))
 352 010c EAF7                  brpl .L35
 355 010e 0895                  ret
 107:../Common/Util.c ****     ;
 108:../Common/Util.c **** }

Thanks in advance.

Maurizio Ferraris                mailto:address@hidden
Via Borgonuovo 27                mailto:address@hidden
10040 GIVOLETTO TO ITALY         http://www.studioferraris.it

reply via email to

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