6-73
BCD(P),DBCD(P)
1
2
3
4
4
6
7
8
6.3 Data conversion instructions
6.3.1 Conversion from BIN data to 4-digit and 8-digit BCD (BCD(P),DBCD(P))
6.3 Data conversion instructions
6.3.1 Conversion from BIN data to 4-digit and 8-digit BCD
(BCD(P),DBCD(P))
BCD(P),DBCD(P)
BCD(P), DBCD(P)
Function
BCD
Converts BIN data (0 to 9999) at the device designated by to BCD data, and stores it at the
device designated by .
DBCD
Converts BIN data (0 to 99999999) at the device designated by to BCD data, and stores it at
the device designated by .
: BIN data or head number of the devices where the BIN data is stored (BIN 16/32 bits)
: Head number of the devices where BCD data will be stored (BCD 4/8 digits)
Setting
Data
Internal Devices R, ZR J\ U\G Zn Constants
K, H Other
Bit Word Bit Word
––
–– ––
Basic
Process
High
performance
Redundant
Universal
P
Command
Command
BCD, DBCD
BCDP, DBCDP
SD
S D
indicates an instruction symbol of BCD/DBCD.
S
D
S
D
S
D
-32768
0
16384
0
8192
1
4096
0
2048
0
1024
1
512
1
256
1
128
0
64
0
32
0
16
0
8
1
4
1
2
1
1
1
BIN 9999
8000
1
4000
0
2000
0
1000
1
800
1
400
0
200
0
100
1
80
1
40
0
20
0
10
1
8
1
4
0
2
0
1
1
BCD 9999
BCD conversion
Thousands digits Hundreds digits Tens digits Ones digits
Must always be "0".
S
D
S
D
BCD conversion
+1 (Upper 4 digits)
0
BIN 99999999
Must always be "0" (upper 5 digits).
00 0 0 1 0 1 1 1 1 1 0 1 0 1 1 1 1 0 0 0 0 0 1 1 1 1 1 1 1 1
0
BCD 99999999
Ten
millions
digits
1 01 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1
Millions
digits
Hundred
thousands
digits
Ten
thousands
digits
Thousands
digits
Hundreds
digits
Tens
digits
Ones
digits
+1 (Upper 16 bits)(Lower 16 bits)
(Lower 4 digits)
1
2
4
8
1
2
4
8
1
2
4
8
1
2
4
8
1
2
4
8
1
2
4
8
1
2
4
8
1
2
4
8
S
D
107
106
105
104
103
102
101
100
231
230
229
228
227
226
225
224
223
222
221
220
219
218
217
216
215
214
213
212
211
210
29
28
27
26
25
24
23
22
21
20
S S
DD