10: D
ATA
C
OMPARISON
I
NSTRUCTIONS
O
PEN
N
ET
C
ONTROLLER
U
SER
’
S
M
ANUAL
10-3
Repeat Operation in the Data Comparison Instructions
Repeat One Source Operand
When only S1 (source) is designated to repeat, source operands (as many as the repeat cycles, starting with the operand
designated by S1) are compared with the operand designated by S2. The comparison results are ANDed and set to the des-
tination operand designated by D1.
• Data Type: Word
• Data Type: Double Word
Repeat Two Source Operands
When S1 (source) and S2 (source) are designated to repeat, source operands (as many as the repeat cycles, starting with
the operands designated by S1 and S2) are compared with each other. The comparison results are ANDed and set to the
destination operand designated by D1.
• Data Type: Word
• Data Type: Double Word
Repeat Source and Destination Operands
When S1, S2 (source), and D1 (destination) are designated to repeat, source operands (as many as the repeat cycles, start-
ing with the operands designated by S1 and S2) are compared with each other. The comparison results are set to destina-
tion operands (as many as the repeat cycles, starting with the operand designated by D1).
• Data Type: Word
• Data Type: Double Word
I0
REP
3
S1 R
D10
D1 –
M10
CMP>=(W)
S2 –
15
AND
15
D11
10
D10
20
D12
M10
S1 (Repeat = 3)
D1 (Repeat = 0)
S2 (Repeat = 0)
15
15
15
I0
REP
3
S1 R
D20
D1 –
M50
CMP>=(D)
S2 –
D30
D22·D23
D20·D21
D24·D25
AND
S1 (Repeat = 3)
D1 (Repeat = 0)
S2 (Repeat = 0)
D30·D31
D30·D31
D30·D31
M50
AND
M10
I0
REP
3
S1 R
D10
D1 –
M10
CMP>=(W)
S2 R
D20
20
D21
0
D20
100
D22
S2 (Repeat = 3)
D1 (Repeat = 0)
20
D11
10
D10
30
D12
S1 (Repeat = 3)
D22·D23
D20·D21
D24·D25
AND
S1 (Repeat = 3)
D1 (Repeat = 0)
S2 (Repeat = 3)
D30·D31
D32·D33
D34·D35
M50
I0
REP
3
S1 R
D20
D1 –
M50
CMP>=(D)
S2 R
D30
I0
REP
3
S1 R
D10
D1 R
M10
CMP>=(W)
S2 R
D20
20
D21
0
D20
100
D22
M11 turned on
M10 turned on
M12 turned off
S2 (Repeat = 3)
D1 (Repeat = 3)
20
D11
10
D10
30
D12
S1 (Repeat = 3)
D22·D23
D20·D21
D24·D25
S1 (Repeat = 3)
D1 (Repeat = 3)
S2 (Repeat = 3)
D30·D31
D32·D33
D34·D35
M51
M50
M52
I0
REP
3
S1 R
D20
D1 R
M50
CMP>=(D)
S2 R
D30
Phone: 800.894.0412 - Fax: 888.723.4773 - Web: www.clrwtr.com - Email: [email protected]