7-19
Section
Comparison Instructions
438
Placing other instructions between ZCP(––) and the operation which accesses
the EQ, LE, and GR flags may change the status of these flags. Be sure to ac-
cess them before the desired status is changed.
Flags
ER:
Indirectly addressed DM word is non-existent. (Content of
*
DM word is
not BCD, or the DM area boundary has been exceeded.)
LL is greater than UL.
EQ
:
ON if LL
≤
CD
≤
UL
LE
:
ON if CD < LL.
GR
:
ON if CD > UL.
Example
In the following example, the content of IR 200 (#6FA4) is compared to the range
#0010 to #AB1F. Since #0010
≤
#6FA4
≤
#AB1F, the EQ flag and IR 10101 are
turned ON.
00000
LD
00000
00001
OUT
TR
0
00002
ZCP(––)
200
#
0010
#
AB1F
00003
AND
25505
00004
OUT
01000
00005
LD
TR
0
00006
AND
25506
00007
OUT
01001
00008
LD
TR
0
00009
AND
25507
00010
OUT
01002
ZCP(––)
#0010
200
00000
25505
01000
25507
01002
TR
0
25506
01001
Greater Than
(above range)
Equal
(within range)
Less Than
(below range)
Address
Instruction
Operands
Address
Instruction
Operands
#AB1F
UL: #AB1F
A
B
1
F
<
CD: 200
6
F
A
4
<
LL: #0010
0
0
1
0
20000: OFF
20001: ON
20002: OFF
7-19-6
DOUBLE AREA RANGE COMPARE – ZCPL(––)
CD
: Compare data
IR, SR, AR, DM, HR, LR
LL
: Lower limit of range
IR, SR, AR, DM, HR, LR
Ladder Symbol
Operand Data Areas
UL
: Upper limit of range
IR, SR, AR, DM, HR, LR
ZCPL(––)
CD
LL
UL
Precautions