This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to use JNC or JC from C

I want to generate very efficient code using the carry-bit from C-code, and the instructions JNC or JC.

...
sbit PinBit= P0^0;              //port-IO bit
...
CY=PinBit;              //generates MOV C,PinBit
...
if(CY)
{
        //do something
}
IfNotCY:
...

The if(CY) instructiuons generates JNB CY,IfNotCY

How can i get it to use the more efficient JNC IfNotCY?

Analogously, if(!CY) should generate JC {label}.

0