Hi all,
Also did some quick experiments, the results are:

test_snipped = 0, Code 15, data 3
test_snipped = 1, Code 21, data 3
test_snipped = 2, Code 16, data 3

So by writing two explicit if statements can help a lot (difference is
even more dramastic when changing an if ( x and y ) evalutation by an
If x followed by an if y statement. Seems that the compiler can be
improved quite a bit on the expression evalution
Albert



include 16f628

const test_snipped = 0

forever loop
        if test_snipped == 0 then
                        if ( (RCSTA & 0x11) != 0 ) then
                                PORTA = 0xFF
                        end if
        end if

        if test_snipped == 1 then
                        if ((RCSTA_OERR == TRUE) | (RCSTA_FERR == TRUE)) then
                                PORTA = 0xFF
                        end if
        end if

        if test_snipped == 2 then
                        var bit tst_bit = false
                        if ((RCSTA_OERR == TRUE) ) then tst_bit = true end if
                        if ((RCSTA_FERR == TRUE) ) then tst_bit = true end if
                        if tst_bit then
                                PORTA = 0xFF
                        end if
        end if
end loop
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to