Comparison Instructions
Precautions
Flags
Example
TR
0
00000
25505
25506
25507
Address
Instruction
00000
LD
00001
OUT
00002
ZCP(––)
00003
AND
LL: #0010
0
0
1
7-19-6 DOUBLE AREA RANGE COMPARE – ZCPL(––)
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.
Indirectly addressed DM word is non-existent. (Content of *DM word is
ER:
not BCD, or the DM area boundary has been exceeded.)
LL is greater than UL.
EQ:
ON if LL
LE:
ON if CD < LL.
GR:
ON if CD > UL.
In the following example, the content of IR 200 (#6FA4) is compared to the range
#0010 to #AB1F. Since #0010
turned ON.
Operands
00000
TR
0
200
#
0010
#
AB1F
25505
CD: 200
<
0
6
F
A
Ladder Symbol
ZCPL(––)
CD
LL
UL
CD
UL
#6FA4
#AB1F, the EQ flag and IR 10101 are
ZCP(––)
200
#0010
#AB1F
01000
01001
01002
Address
Instruction
00004
OUT
00005
LD
00006
AND
00007
OUT
00008
LD
00009
AND
00010
OUT
UL: #AB1F
<
4
A
B
1
Section
Greater Than
(above range)
Equal
(within range)
Less Than
(below range)
Operands
01000
TR
0
25506
01001
TR
0
25507
01002
20000: OFF
20001: ON
F
20002: OFF
Operand Data Areas
CD: Compare data
IR, SR, AR, DM, HR, LR
LL: Lower limit of range
IR, SR, AR, DM, HR, LR
UL: Upper limit of range
IR, SR, AR, DM, HR, LR
7-19
Need help?
Do you have a question about the CPM1 - PROGRAMING MANUAL 02-2001 and is the answer not in the manual?