English
Language : 

DR805X Datasheet, PDF (23/79 Pages) Digital Core Design – 8-bit RISC Microcontroller Instructions set details ver 3.10
DR805x Instructions set details
3.6. CJNE
- 23 -
Instruction: CJNE <dest-byte >, < src-byte >, rel
Function: Compare and jump if not equal.
Description:
CJNE compares the magnitudes of the first two operands, and
branches if their values are not equal. The branch destination is
computed by adding the signed relative displacement in the last
instruction byte to the PC, after incrementing the PC to the start of the
next instruction. The carry flag is set if the unsigned integer value of
<dest-byte> is less than the unsigned integer value of <src-byte>;
otherwise, the carry is cleared. Neither operand is affected. The first two
operands allow four addressing mode combinations: the accumulator
may be compared with any directly addressed byte or immediate data,
and any indirect RAM location or working register can be compared with
an immediate constant.
3.6.1. CJNE A, DIRECT, REL
Operation: (PC) ← (PC) + 3
if (A) < > (direct) then
(PC) ← (PC) + relative offset
if (A) < (direct) then
(C) ← 1
else
(C) ← 0
Bytes:
3
Cycles:
5
Encoding:
10110101
direct address
relative address
All trademarks mentioned in this document
are trademarks of their respective owners.
http://www.DigitalCoreDesign.com
http://www.dcd.pl
Copyright 1999-2003 DCD – Digital Core Design. All Rights Reserved.