Chapter 6 Instruction Details
XBC E-Type Main Unit
6-174
Ver. 1
6.28.14 GADD, GADDP, GSUB, GSUBP
Instruction
Area Available
Step
Flag
P M K F L T C S Z D.x R.x
Co
nst.
U N D R
Error
(F110)
Zero
(F111)
Carry
(F112)
GADD(P)
GSUB(P)
S1 O O O O O O O - O -
-
O O O O
4~7
O
-
-
S2 O O O O O O O - O -
- O O O O O
D O O O - O O O - O -
-
O O O O
N O O O - O O O -
-
-
- O O O O O
Operand
Description
Data Type
S1
Data address to be added to S2
INT
S2
Data address to be added to S1
INT
D
Address to save operation result in
INT
N
Number of words to add
WORD
[Flag Set]
Flag
Description
Device
Number
Error
To be set when N’s value exceeds specified area.
F110
1) GADD (Group Add)
(1) Saves the result of N word data from specified device S1 and N word data from S2 respectively added in N
word data from specified device D.
+
1234
b15
b0
S1
5555
S1+1
1000
S1+(N-1)
1111
b15
b0
S2
2222
S2+1
-1000
S2+(N-1)
=
2345
b15
D
7777
D+1
0
D+(N-1)
b0
.
.
.
.
.
.
.
.
.
(2) A constant can be used for S2.
+
1234
b15
b0
S1
5555
S1+1
1000
S1+(N-1)
100
b15
b0
S2
.
.
.
=
1334
b15
D
5655
D+1
1100
D+(N-1)
b0
.
.
.
(3) If specified device’s area is exceeded due to N value, error will occur.
GADD, GSUB
P S1 S2
GADDP, GSUBP
S1 S2
means
D
D
N
N
Summary of Contents for XBC-DN10E
Page 1: ......
Page 10: ...Table of Contents Table of Contents 6 10 10 CLEAR ALL PLC 29...