
HT80C51 User Manual
80C51 Family Instruction Set – Instruction definitions
Handshake Solutions
© Philips Electronics N.V. 2005
Page 107 of 132
JBC bit,rel
Function: Jump if Bit is set and Clear bit
Description: If the indicated bit is a one, branch to the address indicated; otherwise proceed with the next in-
struction. The bit will not be cleared if it is already a zero. The branch destination is computed by
adding the signed relative-displacement in the third instruction byte to the PC, after incrementing
the PC to the first byte of the next instruction. No flags are affected.
Note: When this instruction is used to test an output pin, the value used as the original data will
read from the output data latch, not the input pin.
Example: The Accumulator holds 56H (01010110B). The instruction sequence,
JBC ACC.3,LABEL1
JBC ACC.2,LABEL2
will cause program execution to continue at the instruction identified by the LABEL2, with the Ac-
cumulator modified to 52H (01010010B).
Bytes: 3
Cycles: 2
Encoding:
Operation: JBC
(PC)
← (PC) + 3
IF (bit) = 1
THEN
(bit)
← 0
(PC)
← (PC) + rel
JC rel
Function: Jump if Carry is set
Description: If the carry flag is set, branch to the address indicated; otherwise proceed with the next instruc-
tion. The branch destination is computed by adding the signed relative-displacement in the sec-
ond instruction byte to the PC, after incrementing the PC twice. No flags are affected.
Example: The carry flag is cleared. The instruction sequence,
JC LABEL1
CPL C
JC LABEL2
will set the carry and cause program execution to continue at the instruction identified by the label
LABEL2.
Bytes: 2
Cycles: 2
Encoding:
Operation: JC
(PC)
← (PC) + 2
IF (C) = 1
THEN
(PC)
← (PC) + rel
0
0
0
1
0
0
0
0
bit address
rel. address
0
1
0
0
0
0
0
0
rel. address