I'm try to develop my first C application on PIC 16F676. Normally I use MPASM from microchip.
I'm using the Uregistred version of the compiler.
I'm usually check the assembler generated by the compiler to check the quality of code due the uC used have so little RAM/FLASH.
I have found two strange behavoiur:
FIRST:
check this piece of code
Code: Select all
do {
// Make SomeThing
} while (1);
Normally all the compiler substitute the while with a unconditioned jump.
SECOND:
Code: Select all
while (!INTCON.T0IF);
Cast bit to short integer
(Make an bittest and load STACK1 with the value 1 if bit asserted)
Load STACK2 with the value 0
Make a test beetwen short integer.
It's better make a bit-test like
Code: Select all
REP BTFSC INTCON,T0IF
GOTO REP
There's any work-around to do the compiler uses bit-tests?