You are here : assembly8051CJNE

CJNE - 8051

The CJNE instruction compares the first two operands and branches to the specified destination if their values are not equal.

If the values are the same, execution continues with the next instruction.


Syntax

CJNE @R1,#24h,LABEL


Example

;Compare jump when not equal to
CJNE @R1,#24h,LABEL	;3 bytes 2 cycles
CJNE A,#10h,LABEL	;3 bytes 2 cycles
CJNE A,60h,LABEL	;3 bytes 2 cycles
CJNE R6,#12h,LABEL	;3 bytes 2 cycles


Output / Return Value


Limitations


Alternatives / See Also

8051 DJNZ (Decrement, Jump if not Zero) - https://wikidev.in/wiki/assembly/8051/DJNZ

8051 SJMP (Short Jump) - https://wikidev.in/wiki/assembly/8051/SJMP

8051 AJMP (Jump) - https://wikidev.in/wiki/assembly/8051/AJMP


Reference

http://www.keil.com/support/man/docs/is51/is51_cjne.htm