7-69
SUM(P),DSUM(P)
1
2
3
4
6
6
7
8
7.5 Data processing instructions
7.5.2 16-bit and 32-bit data checks (SUM(P),DSUM(P))
7.5.2
16-bit and 32-bit data checks (SUM(P),DSUM(P))
SUM(P),DSUM(P)
Function
SUM
From the 16-bit data in the device designated by , stores the total number of bits where 1
is set, in the device designated by .
DSUM
From the 32-bit data in the device designated by , stores the total number of bits where 1
is set, in the device designated by .
: Head number of the devices where the total number of bits of "1" is counted (BIN 16/32 bits)
: Head number of the devices where the total number of the bits will be stored (BIN 16/32 bits)
Setting
Data
Internal Devices
R, ZR
J\
U\G
Zn
Constants
K, H
Other
Bit Word Bit Word
––
–– ––
Basic
Process
High
performance
Redundant
Universal
Command
Command
P
S D
S D
SUM, DSUM
SUMP, DSUMP
indicates an instruction symbol of SUM/DSUM.
S
D
S
D
S
D
b15 b8
1
1 0 0 1 0 1 1 0 0 1 100 0 1
b0
b7
b15 b8
0
0 0 0 0 0 0 0 0 0 0 010 0 0
b0b7
Total number of bits where 1 is set
Stores the total number of bits where 1 is set in BIN.
(There are 8 bits where 1 is set in the example.)
S
D
S
D
S
D
1 0 0 1 1 1 0 0 1 0 1 001 1 1
b15 b8
0
0 0 0 0 0 0 0 0 0 0 100 0 0
b0b7
Total number of bits where 1 is set
Stores the total number of bits where 1 is set in BIN.
(There are 16 bits where 1 is set in the example.)
0 0 0 1 0 0 0 0 1 1 1 101 1 0
b31 b16b15 b0
S
+1