284
Comparison Instructions
Section 5-19
Example
The following example shows the comparisons made and the results provided
for BCMP(68). Here, the comparison is made during each cycle when IR
00000 is ON.
5-19-4 DOUBLE COMPARE – CMPL(60)
Limitations
Cp1 and Cp1+1 must be in the same data area.
Cp2 and Cp2+1 must be in the same data area.
Set the third operand to 000.
Description
When the execution condition is OFF, CMPL(60) is not executed. When the
execution condition is ON, CMPL(60) joins the 4-digit hexadecimal content of
Cp1+1 with that of Cp1, and that of Cp2+1 with that of Cp2 to create two 8-
digit hexadecimal numbers, Cp+1,Cp1 and Cp2+1,Cp2. The two 8-digit num-
bers are then compared and the result is output to the GR, EQ, and LE flags
in the SR area.
Precautions
Placing other instructions between CMPL(60) and the operation which
accesses the EQ, LE, and GR flags may change the status of these flags. Be
sure to access them before the desired status is changed.
R:LR 05
001
0210
DM 0010
0000
DM 0011
0100
LR 0500
0
DM 0012
0101
DM 0013
0200
LR 0501
0
DM 0014
0201
DM 0015
0300
LR 0502
1
DM 0016
0301
DM 0017
0400
LR 0503
0
DM 0018
0401
DM 0019
0500
LR 0504
0
DM 0020
0501
DM 0021
0600
LR 0505
0
DM 0022
0601
DM 0023
0700
LR 0506
0
DM 0024
0701
DM 0025
0800
LR 0507
0
DM 0026
0801
DM 0027
0900
LR 0508
0
DM 0028
0901
DM 0029
1000
LR 0509
0
DM 0030
1001
DM 0031
1100
LR 0510
0
DM 0032
1101
DM 0033
1200
LR 0511
0
DM 0034
1201
DM 0035
1300
LR 0512
0
DM 0036
1301
DM 0037
1400
LR 0513
0
DM 0038
1401
DM 0039
1500
LR 0514
0
DM 0040
1501
DM 0041
1600
LR 0515
0
BCMP(68)
001
DM 0010
LR 05
00000
Compare data in IR 001
(which contains 0210) with
the given ranges.
Address Instruction
Operands
00000
LD
00000
00001
BCMP(68)
001
DM
0010
LR
05
CD 001
Lower limits
Upper limits
Cp2
:
First word of second compare word pair
IR, SR, AR, DM, EM, HR, TIM/CNT, LR
Cp1
:
First word of first compare word pair
IR, SR, AR, DM, EM, HR, TIM/CNT, LR
Ladder Symbols
Operand Data Areas
CMPL(60)
Cp1
Cp2
−−