DL205 User Manual, 4th Edition, Rev. B
5–123
Chapter 5: Standard RLL Instructions - Bit Operation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
Bit Operation Instructions
Sum (SUM)
The Sum instruction counts number of bits that are set to “1”
in the accumulator. The HEX result resides in the accumulator.
In the following example, when X1 is on, the value formed by discrete locations X10–X17 is
loaded into the accumulator using the Load Formatted instruction. The number of bits in the
accumulator set to “1” is counted using the Sum instruction. The value in the accumulator is
copied to V1500 using the Out instruction.
DirectSOFT
LDF X10
K8
X
1
Load the value represented by
discrete locations X10–X17
into the accumulator
SUM
Sum the number of bits in
the accumulator set to “1”
OUT
V1500
Copy the value in the lower
16 bits of the accumulator
to V1500
X10X11X12X13
ONONOFFON
X14X15X16X17
OFFOFFONON
00000000110010110000000000000000
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 1631 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Acc.
V1500
Acc.
0005
0000 0005
The unused accumulator
bits are set to zero
STR
$
ENT
SHFT
ANDST
L
3
D
5
F
SHFT
RST
S
ISG
U
ORST
M
ENT
1
B
1
B
0
A
8
I
ENT
SHFT
OUT
GX
PREV
1
B
5
F
0
A
0
A
ENTPREV PREV
Handheld Programmer Keystrokes
Math Function Range of Argument
SP63 On when the result of the instruction causes the value in the accumulator to be zero.
DS Used
HPP Used