7-199
DABCD(P),DDABCD(P)
1
2
3
4
6
6
7
8
7.11 Character string processing instructions
7.11.6 Conversion from decimal ASCII to BCD 4-digit or 8-digit data (DABCD(P),DDABCD(P))
DDABCD
(1) Converts decimal ASCII data stored in the area starting from the device designated by to
8-digit BCD data, and stores it into the area starting from the device designated by .
For example, if the ASCII code of 87654321
H is designated for the area starting from , the
operation results would be stored at +1 and in the following manner:
(2) The ASCII data designated at to +3 can be in the range of from 0 to 99999999.
(3) The ASCII code set at each digit can be in the range of from "30
H" to "39H".
(4) If ASCII code for individual digits is from "20
H" to "00H", it is processed as "30H".
Operation Error
(1) In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and
an error code is stored into SD0.
• There are characters within the data at that are outside the 0 to 9 range.
(Error code: 4100)
• The device specified by exceeds the range of the corresponding device.
(For the Universal model QCPU only.) (Error code: 4101)
S
D
Ten
milli-
ons
place
ASCII code for ten-millions place
ASCII code for millions place
ASCII code for ten-thousands place
b8 b0
ASCII code for thousands place
ASCII code for hundreds place
ASCII code for tens place
ASCII code for units place
Milli-
ons
place
Hundred
thou-
sands
place
Ten
thou-
sands
place
Thou-
sands
place
Hund-
reds
place
Units
place
Tens
place
b31 b28 b24b27 b16b19b23 b20 b15 b12 b0b3
b7
b4b8b11
+1
D
+1
+2
+3
S
S
S
S
b15 b7
D
ASCII code for hundred-thousands place
S
D D
b31 b28 b24b27 b16b19b23 b20 b15 b12
38
H
(8)37
H
(7)
36
H
(6)35
H
(5)
b15 b8 b7 b0
34
H
(4)33
H
(3)
32
H
(2)31
H
(1)
b0b3b7 b4b8b11
+1
8
7
65
4
3
21
D
+1
+2
+3
S
S
S
S
D
S S
S
S