MCS@-51PROGRAMMER’SGUIDE AND INSTRUCTION SH
JNB bi~rel
Function:
Example:
Bytes:
Cycles:
Encoding:
Operation:
JNC rel
Jump if Bit Not set
If the indicatedbit is a zero,branchto the indicatedaddress;otherwiseproceedwith the next
instruction.The branchdestinationis computedby addingthe signedrelative-displacementin
the third instruction byteto the PC, after incrementingthe PC to the first byte of the next
instruction. The
bit tested is not modt~ed. No flagsare affected.
Thedata presentat inputport 1is 11W101OB.TheAccumulatorholds56H(01010110B).The
instructionsequence,
JNB P1.3,LABEL1
JNB ACC.3,LABEL2
willcause programexecutionto continueat the instructionat label LABEL2.
3
2
0011
100001 LGzEl EEl
JNB
$W:)y; +
3
THEN (PC) t (PC) + rel.
Function: Jump if Carry not set
Description:
If the carry tlag is a zero, branch to the addreasindicated;otherwise
proceedwith the next
instruction.The branchdestinationis computedby addingthe signedrelative-displacementin
the secondinstructionbyte to the PC, after incrementingthe PC twice to point to the next
inatruetion.The carry tlag is not moditled.
Example: The carrytlagis set. Theinstructionsequence,
JNC LABEL1
CPL C
JNc LABEL2
willclear the carry and causeprogramexecutionto continueat the instruction identitkd by
the label LABEL2.
Bytes 2
Cycles: 2
Encoding:
0101
100001 -
Operation: JNC
(PC) - (PC) + 2
IF (C) = O
THEN (PC) t (PC) + rel
2-49