max2009tiny wrote: > Ok thanks i use gcc 4.3.2 > secondary question is if i remove volatile from code > > register unsigned char lastrec asm("r8") > > then while generate asm efficient but dont work why? > a0: 88 11 cpse r24, r8 > a2: ff cf rjmp .-2 ; 0xa2 <waitACK+0x2>
My educated guess (since you're not providing a full working example) is that the interrupt routine that is supposed to change r8 is saving and restoring its state in the prologue / epilogue. You might need to do a naked interrupt routine or write it all in assembly. As others have said, unless you're really desperate to shave off a few cycles, all the issues that arise from trying to tweak the compiler's behavior are really not worth it. IMHO, you'd be better of trying some compiler options like David Brown suggested. -- Paulo Marques Software Development Department - Grupo PIE, S.A. Phone: +351 252 290600, Fax: +351 252 290601 Web: www.grupopie.com "I have not yet begun to procrastinate" _______________________________________________ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list