
Chapter 5. Application instructions
5-77
5.11.3 BSUM, BSUMP, DBSUM, DBSUMP
BSUM
(Bit summary)
FUN(170) BSUM
FUN(172) DBSUM
FUN(171) BSUMP
FUN(173) DBSUMP
Applicable
CPU
All CPUs
Available Device
Flag
Instructions
M
P
K
L
F
T
C
S
D
#D Integer
Steps
Error
(F110)
Zero
(F111)
Carry
(F112)
O O O O O O O
O
O
O
BSUM(P)
DBSUM(P)
O O O O
*
O
O
O
O
5
O
O
* Available only when do not use computer link module or data link module
1) Functions
-
BSUM(P) : Counts the numbers of ‘1’ in the device specified as [ S ], then stores the result into the
device specified as [ D ] in hexadecimal format.
-
DBSUM(P) : Counts the numbers of ‘1’ in the device specified as [ S+1, S ], then stores the result
into the device specified as [ D ] in hexadecimal format.
-
If the count result is 0, the zero flag is set.
-
If the indirect address specified by #D format is out of device range, the operation error occurs and
the error flag (F110) is set.
-
Execution conditions
Operand setting
D
S
BSUM
BSUMP
DBSUM
DBSUMP
S
D
S
D
The device counted the
total numbers of bits that
are ‘1’.
The device at which stores
the count result.
D
S
Input condition
BSUM, DBSUM
BSUMP, DBSUMP
Executed only once
Executed only once
Executed per scan
Executed per scan