4/17/98 6-77 Addressing Modes and Data Types
CJNE Compare and jump if not equal
Syntax: CJNE dest, src, rel8
Operation: (PC) <-- (PC) + # of instruction bytes
(dest) - (direct) (result not stored)
if (Z) = 0 then
(PC) <-- (PC + rel8*2); (PC.0) <-- 0
Description: The byte or word specified by the source operand is compared to the variable
specified by the destination operand and the status flags are updated. Jump to the specified address
if the values are not equal. The source and destination data are not affected by the operation. The
branch range is +254 bytes to -256 bytes, with the limitation that the target address is word aligned
in code memory.
Note: Refer to section 6.3 for details of jump range
Size: Byte-Byte, Word-Word
Flags Updated: C, N, Z
(Note: this particular type of compare must not update the V or AC flags to duplicate the 80C51
function.)
CJNE Rd, direct, rel8
Bytes: 4
Clocks: 10t/7nt
Encoding:
byte 3: lower 8 bits of direct
byte 4: rel8
1 1 1 0 SZ 0 1 0
d d d d 0 direct: 3 bits