Hi!
I have an unresponsive LPC flash BIOS chip which I want to program via an ATmega168. Since adding nops has resolved a timing problem before, I tried to add blocks of 4 nops, but they got optimized away, I guess.
For instance the example from
http://www.nongnu.org/avr-libc/u... produces no nop instead of 4:
void main(void) { asm volatile("nop\n\t" "nop\n\t" "nop\n\t" "nop\n\t" ::); }
Same thing with more than 3
asm volatile("nop"::);
It seems that any sequence of 4 or more nops produces no nops if it is an even number and one nop if it is odd.
This now explains how avr-gcc magically only included the original nops as it was then the 5th with the 4 nop block added.