Binary Coded Decimal (BCD)
The Binary Coded Decimal instruction converts a binary value
230
in the accumulator to the equivalent BCD value. The result
240
resides in the accumulator.
250-1
In the following example, when X1 is on, the binary (HEX) value in V2000 and V2001 is
260
loaded into the accumulator using the Load Double instruction. The binary value in the
accumulator is converted to the BCD equivalent value using the BCD instruction. The BCD
value in the accumulator is copied to V2010 and V2011 using the Out Double instruction.
DS
Used
HPP Used
DirectSOFT
X1
LDD
V2000
Load the value in V2000 and
V2001 into the accumulator
BCD
Convert the binary value in
the accumulator to the BCD
equivalent value
OUTD
V2010
Copy the BCD value in the
accumulator to V2010 and V2011
Chapter 5: Standard RLL Instructions - Number Conversion
Binary Value
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.
0
0
0
0 0
0
0
0
0 0
2
1
5
2
1
6
3
1
8
4
1
0
3
6
3
7
3
6
3
1
4
7
6
8
4
1
5
7
8
9
7
3
8
4
2
0
5
7
8
4
4
7
7
3
1
8
4
7
6
3
4
4
0
5
7
8
4
2
0
0
8
1
9
4
7
6
3
1
8
4
3
8
1
5
2
4
2
6
6
2
2
6
8
4
4
8
16384 + 8192 + 2048 + 1024 + 512 + 256 + 64 + 32 + 16 + 1 = 28529
8
4 2
1
8
4
2 1
8
4
Acc.
0
0
0
0 0
0
0
0
0 0
Handheld Programmer Keystrokes
$
B
ENT
STR
1
L
D
D
SHFT
ANDST
3
3
B
C
D
SHFT
1
2
3
GX
D
SHFT
OUT
3
DL205 User Manual, 4th Edition, Rev. B
V2001
V2000
0
0
0
0
6
F
7
1
15 14 13 12 11 10 9
0
0
0
0 0
0
0
1
1
0 1
1
2
1
5
2
1
6
3
1
8
4
2
1
0
0
2
6
3
5
2
6
1
0
0
0
9
4
4
2
1
5
7
3
9
9
4
2
7
8
2
1
0
3
6
8
2
6
8
4
1
5
8
4
7
6
8
4
5
7
8
4
2
2
6
BCD Equivalent Value
2
1 8
4
2
1
8
4 2
1
8
4
0
0
0
0 1
0
1
0
0
0 0
1
The BCD value
0
0
0
2
8
5
2
9
copied to
V2011
V2010
V2010 and V2011
C
A
A
A
2
0
0
ENT
C
A
B
A
ENT
2
0
1
0
BCD
8
7 6 5
4 3
2
1
0
1
1
0 1
1
1
0
0 0
1
5
2
1
6
3
1
8
4
2
1
1
5
2
4
2
6
2
6
8
2 1
8
4
2
1 8
4
2
1
0
1
0 0
1
0
1
0 0
1
ENT
0
5–131
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
Need help?
Do you have a question about the DirectLOGIC DL205 Series and is the answer not in the manual?