Hi to all,
a question on xmega.
I ma made a simple C program that blink a led using the virtual port1. I don't use the toggle bit but I SET and CLEAR the bit.
so if I write
VPORT1.OUT |= (1<<1);
WHY THE COMPILER DOESEN'T USE THE sbi INSTRUCTION AND WRITE SO MUCH INSTRUCTIONS?
IN R24,0x15 In from I/O location
ORI R24,0x02 Logical OR with immediate
STD Z+1,R24 Store indirect with
SER R24 Set Register
SER R25 Set Register
LDI R18,0x00 Load immediate
And so also for to clear the bit?
what I've to write for to permit at the compiler to optimize and use the SBI instruction?
I'm using the "Os" optimization.