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}.
Thanks for the feedback. it works flawlessly in assembly, i was just trying to stick with C, to make readabillity and debugging easier.
"i was just trying to stick with C, to make readabillity and debugging easier."
Exactly - that's the (potential) programmer productivity gain from using a HLL.
But, when absolute timing control is critical, you have nothing to trade - you must stick with assembler.
But be sure to be extra careful in the documentation of your assembler - well documented, well structured assembler need not be hard to debug or maintain!