|
|
CJNE
Compare and jump if not equal
Description |
|
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.
|
See Also |
|
DJNZ |
CJNE @Rn, #immediate_data, relative_offset |
|
Bytes |
|
3 |
Cycles |
|
2 |
Encoding |
|
1011011n, immediate, relative_offset |
Operation |
|
CJNE
PC = PC + 3
IF (Rn) <> immedate
PC = PC + relative_offset
IF (Rn) < immediate
C = 1
ELSE
C = 0
|
Example |
|
CJNE @R1, #24H, LABEL
|
CJNE A, #immediate_data, relative_offset |
|
Bytes |
|
3 |
Cycles |
|
2 |
Encoding |
|
10110100, immediate, relative_offset |
Operation |
|
CJNE
PC = PC + 3
IF A <> immediate
PC = PC + relative_offset
IF A < immediate
C = 1
ELSE
C = 0
|
Example |
|
CJNE A, #01H, LABEL
|
CJNE A, direct_address, relative_offset |
|
Bytes |
|
3 |
Cycles |
|
2 |
Encoding |
|
10110101, direct_address, relative_offset |
Operation |
|
CJNE
PC = PC + 3
IF A <> (direct_address)
PC = PC + relative_offset
IF A < (direct_address)
C = 1
ELSE
C = 0
|
Example |
|
CJNE A, 60h, LABEL
|
CJNE Rn, #immediate_data, relative_offset |
|
Bytes |
|
3 |
Cycles |
|
2 |
Encoding |
|
10111nnn, immediate, relative_offset |
Operation |
|
CJNE
PC = PC + 3
IF Rn <> immedate
PC = PC + relative_offset
IF Rn < immediate
C = 1
ELSE
C = 0
|
Example |
|
CJNE R6, #12H, LABEL
|
|
|