CJNE compares the value of operand1 and operand2 and branches to the indicated relative address if operand1 and operand2 are not equal. If the two operands are equal program flow continues with the instruction following the CJNE instruction.
Syntax : CJNE operand1,operand2,addr
Example : CJNE R1,#50H,krm
It will compare if the data in R1 is equal to 50H or not. If they both are not equal then PC will jump to the kr. If data in R1 is less than 50H then carry flag will be set. If it is greater than 50H then carry flag will be cleared.
Syntax : CJNE operand1,operand2,addr
Example : CJNE R1,#50H,krm
It will compare if the data in R1 is equal to 50H or not. If they both are not equal then PC will jump to the kr. If data in R1 is less than 50H then carry flag will be set. If it is greater than 50H then carry flag will be cleared.
- Instruction
- Opcode
- Bytes
- Flags
- CJNE A,#data,addr
- 0xB4
- 3
- C
- CJNE A,iram_addr,addr
- 0xB5
- 3
- C
- CJNE @R0,#data,addr
- 0xB6
- 3
- C
- CJNE @R1,#data,addr
- 0xB7
- 3
- C
- CJNE R0,#data,addr
- 0xB8
- 3
- C
- CJNE R1,#data,addr
- 0xB9
- 3
- C
- CJNE R2,#data,addr
- 0xBA
- 3
- C
- CJNE R3,#data,addr
- 0xBB
- 3
- C
- CJNE R4,#data,addr
- 0xBC
- 3
- C
- CJNE R5,#data,addr
- 0xBD
- 3
- C
- CJNE R6,#data,addr
- 0xBE
- 3
- C
- CJNE R7,#data,addr
- 0xBF
- 3
- C