Chapter 6 Applied Instructions 
6-293 
API 
Instruction code  Operand  Function 
1217  D  WSUM  P 
S, n, D 
Getting the sum 
Device
X  Y  M  S  T  C  HC  D  L  SM  SR  E  PR  K  16#  “$”  DF 
16-bit instruction (7 steps) 
32-bit instruction (7 steps) 
Symbol: 
 
 
S
:
Data source  Word/Double word 
n
:
Data length  Word/Double word 
D
:
Operation result  Double word/Long word 
Explanation: 
1.  The signed decimal values in S~S+n-1 are added up, and the sum is stored in the register 
specified by D. 
S
+1
S
+2
S
+3
S
D
+4
S
+5
S
n
 
Binary values
D
+1
Binary value
 
Binary values
Binary value
S
+1
S
+2
S
+3
S
D
+4
S
+5
S
n
 
D
+1
+6
S
+7
S
+8
S
+9
S
D
D
+3
+2
 
 
2.  The operand n used in the 16-bit instruction should be within the range between 1 and 256, 
and the operand n used in the 32-bit instruction should be within the range between 1 and 128. 
3.  Only the 32-bit instructions can use the 32-bit counter.
 
Example: 
When the instruction WSUM is executed, the values in D0~D2 are added up, and the sum is stored 
in D10.