37
TSC8x251G2D
4135C–8051–04/05
Table 30. Summary of Conditional Jump Instructions (2/2)
Notes: 1. A shaded cell denotes an instruction in the C51 Architecture.
2. States are given as jump not-taken/taken.
3. If this instruction ad dresses an I/O Port (Px, x = 0- 3), add 1 to the number of states.
Add 2 if it addresses a Peripheral SFR.
4. If this instruction ad dresses an I/O Port (Px, x = 0- 3), add 2 to the number of states.
Jump if bitJB <src>, rel(PC) ← (PC) + size (instr);
IF [src opnd = 1] THEN (PC) ← (PC) + rel
Jump if not bitJNB <src>, rel(PC) ← (PC) + size (i nstr);
IF [src opnd = 0] THEN (PC) ← (PC) + rel
Jump if bit and clearJBC <dest>, rel(PC) ← (PC) + size (instr);
IF [dest opnd = 1] THEN
dest opnd ← 0
(PC) ← (PC) + rel
Jump if accumulator is zeroJZ rel(PC) ← (PC) + size (instr);
IF [(A) = 0] THEN (PC) ← (PC) + rel
Jump if accumulator is not zeroJNZ rel(PC) ← (PC) + size (instr);
IF [(A) ≠ 0] THEN (PC) ← (PC) + rel
Compare and jump if not equalCJNE <src1>, <src2>, rel(PC) ← (PC) + size (instr);
IF [src opnd1 < src opnd2] THEN (CY) ← 1
IF [src opnd1 ≥ src opnd2] THEN (CY) ← 0
IF [src opnd1 ≠ src opnd2] THEN (PC) ← (PC) + rel
Decrement and jump if not zeroDJNZ <dest>, rel(PC) ← (PC) + size (instr); dest opnd ← dest opnd -1;
IF [ϕ (Z)] THEN (PC) ← (PC) + rel
Mnemonic <dest>, <src>(1) Comments
Binary Mode(2) Source Mode (2)
Bytes States Bytes States
JB
bit51, rel Jump if direct bit is set 3 2/5(3)(6) 32/5
(3)(6)
bit, rel Jump if direct bit of 8-bit address
location is set 54/7
(3)(6) 43/6
(3)(6)
JNB
bit51, rel Jump if direct bit is not set 3 2/5(3)(6) 32/5
(3)(6)
bit, rel Jump if direct bit of 8-bit address
location is not set 54/7
(3)(6) 43/6
(3)
JBC
bit51, rel Jump if direct bit is set & clear bit 3 4/7(5)(6) 34/7
(5)(6)
bit, rel Jump if direct bit of 8-bit address
location is set and clear 57/10(5)(
6) 46/9
(5)(6)
JZ rel Jump if ACC is zero 2 2/5(6) 22/5
(6)
JNZ rel Jump if ACC is not zero 2 2/5(6) 22/5
(6)
CJNE
A, dir8, rel Compare direct address to ACC and
jump if not equal 32/5
(3)(6) 32/5
(3)(6)
A, #data, rel Compare immediate to ACC and
jump if not equal 32/5
(6) 32/5
(6)
Rn, #data, rel Compare immediate to register and
jump if not equal 32/5
(6) 43/6
(6)
at Ri, #data, rel Compare immediate to indirect and
jump if not equal 33/6
(6) 44/7
(6)
DJNZ
Rn, rel Decrement register and jump if not
zero 22/5
(6) 33/6
(6)
dir8, rel Decrement direct address and jump
if not zero 33/6
(4)(6) 33/6
(4)(6)