Dear avr-gcc-ers: It appears that a global SRAM uint8_t variable is placed at address 0x060 by avr-gcc versions 4.6.2 and 7.3.2. The avr-gcc compiler was compiled on cygwin. For example, given the followign AVR cpp code:
volatile uint8_t latchingFlag; int main() { LED_PORT &= ~(1<<LED_BIT); DDRD = 0xFF; for (;;) { latchingFlag=1; if (latchingFlag==0) { LED_PORT ^= 1<<LED_BIT; // Toggle the LED _delay_ms(100); latchingFlag = 1; } } } The disassembly for the conditional looks as follows: if (latchingFlag==0) { a0: 80 91 60 00 lds r24, 0x0060 a4: 81 11 cpse r24, r1 a6: fa cf rjmp .-12 ; 0x9c <main+0xc> At the same time, compiling this on avr-gcc 4.7.0 on Ubuntu I get: lds r24, 0x0100 Presumably 0x0100 is correct, since on ATmega 0x0060 is actually mapped to the WDTCSR register, if I understand it correctly. Is this a problem with the way I built avr-gcc or is this not an avr-gcc issue? Any help would be appreciated. Kirill _______________________________________________ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org https://lists.nongnu.org/mailman/listinfo/avr-gcc-list