gc80c520a CORERIVER Semiconductor, gc80c520a Datasheet - Page 100

no-image

gc80c520a

Manufacturer Part Number
gc80c520a
Description
Midas1.0 Family Mask Rom/eprom/romless 8-bit Turbo Microcontrollers
Manufacturer
CORERIVER Semiconductor
Datasheet
CJNE A, direct, rel
CJNE
Description:
Operation:
Encoding:
Function:
Example:
<dest-byte>, <src-byte>, rel
Cycles:
Bytes:
Compare and Jump if Not Equal.
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.
The Accumulator contains 34h. Register 7 contains 56h. The first instruction in
the sequence,
;
NOT_EQ:
;
sets the carry flag and branches to the instruction at label NOT_EQ. By testing
the carry flag, this instruction determines whether R7 is greater or less than
60h.
If the data being presented to Port 1 is also 34h, then the instruction,
WAIT:
clears the carry flag and continues with the next instruction in sequence, since
the Accumulator does equal the data read from P1. (If some other value was
being input on P1, the program will loop at this point until the P1 data changes
to 34h.)
3
4
(PC)
IF (A)
THEN
IF (A)
THEN
ELSE
1
Preliminary
0
(PC) + 3
< >
<
(PC)
(C)
(C)
(direct)
1
(direct)
1
1
0
(PC) + relative offset
CJNE
• • •
JC
• • •
CJNE
0 1 0 1
Page 100 of 187
. .
R7, #60h, NOT_EQ
• • • •
REQ_LOW
• • • •
A, P1, WAIT
direct address
; R7 = 60h.
; IF R7 < 60h.
; R7 > 60h.
Instruction Set
relative

Related parts for gc80c520a