We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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}.
"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!