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.
ý
ý
þ
þ
230
240
2
5
0
-1
2
6
0
SUM
Direct
SOFT
LDF
X10
K8
X1
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
X10
X11
X12
X13
ON
ON
OFF
ON
X14
X15
X16
X17
OFF
OFF
ON
ON
0 0 0 0 0 0 0 0 1 1 0 0 1 0 1 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
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 16
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Acc.
V1500
Acc.
0 0 0 5
0 0 0 0
0 0 0 5
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
ENT
PREV
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