11: BINARY ARITHMETIC INSTRUCTIONS
USER’S MANUAL 11-3
Repeat Operation in the ADD, SUB, and MUL 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 ADD (addition), SUB (subtraction), and MUL (multiplication) instructions, the following
examples are described using the ADD instruction.
When only S1 (source) is designated to repeat, the final result is set to destination operand D1.
When only S2 (source) is designated to repeat, the final result is set to destination operand D1.
When only D1 (destination) is designated to repeat, the same result is set to 3 operands starting with D1.
When S1 and S2 (source) are designated to repeat, the final result is set to destination operand D1.
When S1 (source) and D1 (dest.) are designated to repeat, different results are set to 3 operands starting with D1.
When S2 (source) and D1 (dest.) are designated to repeat, different results are set to 3 operands starting with D1.
When all operands are designated to repeat, different results are set to 3 operands starting with D1.
Note: Special internal relay M308 (carry/borrow) is turned on when a carry or borrow occurs in the last repeat operation.
When a user program error occurs in any repeat operation, error indicator ERR1 and special internal relay M304 (user pro-
gram execution error) are turned on and maintained while operation for other instructions is continued. For the advanced
instruction which has caused a user program execution error, results are not set to any destination.
I1
ADD REP
3
S1 R
D10
D1
D30
15
D11
10
D10
20
D12
S1 (Repeat = 3) D1 (Repeat = 0)
S2
D20
S2 (Repeat = 0)
+
+
+
(40)
D30
(35)
D30
45
D30
25
D20
25
D20
25
D20
SOTU
I2
ADD REP
3
S1
D10
D1
D30
10
D10
10
D10
10
D10
S1 (Repeat = 0) D1 (Repeat = 0)
S2 R
D20
S2 (Repeat = 3)
+
+
+
(45)
D30
(35)
D30
55
D30
35
D21
25
D20
45
D22
SOTU
I3
ADD REP
3
S1
D10
D1 R
D30
10
D10
10
D10
10
D10
S1 (Repeat = 0) D1 (Repeat = 3)
S2
D20
S2 (Repeat = 0)
+
+
+
35
D31
35
D30
35
D32
25
D20
25
D20
25
D20
SOTU
I4
ADD REP
3
S1 R
D10
D1
D30
15
D11
10
D10
20
D12
S1 (Repeat = 3) D1 (Repeat = 0)
S2 R
D20
S2 (Repeat = 3)
+
+
+
(50)
D30
(35)
D30
65
D30
35
D21
25
D20
45
D22
SOTU
I5
ADD REP
3
S1 R
D10
D1 R
D30
15
D11
10
D10
20
D12
S1 (Repeat = 3) D1 (Repeat = 3)
S2
D20
S2 (Repeat = 0)
+
+
+
40
D31
35
D30
45
D32
25
D20
25
D20
25
D20
SOTU
I6
ADD REP
3
S1
D10
D1 R
D30
10
D10
10
D10
10
D10
S1 (Repeat = 0) D1 (Repeat = 3)
S2 R
D20
S2 (Repeat = 3)
+
+
+
45
D31
35
D30
55
D32
35
D21
25
D20
45
D22
SOTU
I7
ADD REP
3
S1 R
D10
D1 R
D30
15
D11
10
D10
20
D12
S1 (Repeat = 3) D1 (Repeat = 3)
S2 R
D20
S2 (Repeat = 3)
+
+
+
50
D31
35
D30
65
D32
35
D21
25
D20
45
D22
SOTU