Perhaps I have an option wrong. Its been quite a while since I've done any AVR stuff, so its entirely possible... but...
while(!(PINA & 0x80));
sbis 0x19, 7 rjmp .-4
as it should, but
while(!(PINA & 0x40));
ldi r18, 0x01 ldi r19, 0x00 in r24, 0x19 eor r25, r25 ldi r20, 0x06 lsr r25 ror r24 dec r20 brne .-8 eor r24, r18 eor r25, r19 sbrc r24, 0 rjmp .-22
Some kind of promotion problem?, or perhaps the code just didnt get optimized?
All bits except 7 cause the problem. I have tried several different registers. Im using a clean install of WinAVR 20050214 -Os. For now Im just ignoring the issue, and if necessary I can switch to assembly for the loop.
Anyone know what Im doing wrong?