35.3.6.11. INTEGER COMPARES AND CONDITIONAL JUMPS ON MCS51





JC	rel		0100 0000 	PC <- PC + 2
						if (C == 1)
							PC <- PC + rel

JNC	rel		0101 0000 	PC <- PC + 2
						if (C == 0)
							PC <- PC + rel


JZ	rel		0110 0000 	PC <- PC + 2
						if (Z == 1)
							PC <- PC + rel

JNZ	rel		0111 0000 	PC <- PC + 2
						if (Z == 0)
							PC <- PC + rel

CJNE	A,direct,rel  1011 0101    PC <- PC + 3
						if (A != direct)
							PC <- PC + rel

CJNE	A,#data,rel   1011 0100  	PC <- PC + 3
						if (A != data)
							PC <- PC + rel

CJNE	Ri,#data,rel  1011 1rrr      PC <- PC + 3
						if (Ri != data)
							PC <- PC + rel

CJNE	@Ri,#data,rel 1011 011i  	PC <- PC + 3
						if ((Ri) != data)
							PC <- PC + rel
						 								
Note: CJNE: if operand1 < operand 2 then C <-1 else C <- 0

DJNZ	Ri,rel	 	1101 1rrr 		PC <- PC + 2
						Rn <- Rn - 1
						if (Rn != 0)
							PC <- PC + rel

DJNZ	direct,rel	1101 0101  	PC <- PC + 2
						(direct) <- (direct) - 1						


Additional:
JB	bit,rel		Jump if Bit set
JNB	bit,rel		Jump if Bit Not set
JBC	bit,rel		Jump and clear bit







Index Prev Next