![IDEC OpenNet series User Manual Download Page 180](http://html.mh-extra.com/html/idec/opennet-series/opennet-series_user-manual_617384180.webp)
12: B
OOLEAN
C
OMPUTATION
I
NSTRUCTIONS
O
PEN
N
ET
C
ONTROLLER
U
SER
’
S
M
ANUAL
12-3
Repeat Operation in the ANDW, ORW, and XORW Instructions
Source operands S1 and S2 and destination operand D1 can be designated to repeat individually or in combination. When
destination operand D1 is not designated to repeat, the final result is set to destination operand D1. When repeat is desig-
nated, consecutive operands as many as the repeat cycles starting with the designated operand are used. Since the repeat
operation works similarly on the ANDW (AND word), ORW (OR word), and XORW (exclusive OR word) instructions,
the following examples are described using the ANDW instruction.
Repeat One Source Operand
• Data Type: Word
When only S1 (source) is designated to repeat, the final result is set to destination operand D1.
• Data Type: Double Word
When only S1 (source) is designated to repeat, the final result is set to destination operand D1·D1+1.
Repeat Destination Operand Only
• Data Type: Word
When only D1 (destination) is designated to repeat, the same result is set to 3 operands starting with D1.
• Data Type: Double Word
When only D1 (destination) is designated to repeat, the same result is set to 3 operands starting with D1·D1+1.
Repeat Two Source Operands
• Data Type: Word
When S1 and S2 (source) are designated to repeat, the final result is set to destination operand D1.
• Data Type: Double Word
When S1 and S2 (source) are designated to repeat, the final result is set to destination operand D1·D1+1.
I1
D10
S1 (Repeat = 3)
D1 (Repeat = 0)
S2 (Repeat = 0)
·
(D30)
D20
D11
D12
·
·
D20
D20
(D30)
D30
SOTU
REP
3
S1 R
D10
D1 –
D30
S2 –
D20
ANDW(W)
D12·D13
D10·D11
D14·D15
S1 (Repeat = 3)
D1 (Repeat = 0)
S2 (Repeat = 0)
·
·
·
(D30·D31)
(D30·D31)
D30·D31
D20·D21
D20·D21
D20·D21
I1
SOTU
REP
3
S1 R
D10
D1 –
D30
S2 –
D20
ANDW(D)
I1
REP
3
S1 –
D10
D1 R
D30
S2 –
D20
SOTU
ANDW(W)
D10
S1 (Repeat = 0)
D1 (Repeat = 3)
S2 (Repeat = 0)
·
D30
D20
D10
D10
·
·
D20
D20
D31
D32
I1
REP
3
S1 –
D10
D1 R
D30
D10·D11
D10·D11
D10·D11
S1 (Repeat = 0)
D1 (Repeat = 3)
S2 –
D20
S2 (Repeat = 0)
·
·
·
D32·D33
D30·D31
D34·D35
D20·D21
D20·D21
D20·D21
SOTU
ANDW(D)
I1
REP
3
D1 –
D30
S2 R
D20
SOTU
D10
S1 (Repeat = 3)
D1 (Repeat = 0)
S2 (Repeat = 3)
·
(D30)
D20
D11
D12
·
·
D21
D22
(D30)
D30
S1 R
D10
ANDW(W)
I1
REP
3
D1 –
D30
D12·D13
D10·D11
D14·D15
S1 (Repeat = 3)
D1 (Repeat = 0)
S2 R
D20
S2 (Repeat = 3)
·
·
·
(D30·D31)
(D30·D31)
D30·D31
D22·D23
D20·D21
D24·D25
SOTU
S1 R
D10
ANDW(D)
Phone: 800.894.0412 - Fax: 888.723.4773 - Web: www.clrwtr.com - Email: [email protected]