538
7 APPLICATION INSTRUCTIONS
7.11 Character String Processing Instructions
■DDABIN
• Converts decimal ASCII data stored into the area starting from the device number designated by (S) into BIN 32-bit data,
and stores it in the device number designated by (D).
For example, if the ASCII code of -1234543210H is designated for the area starting from (S), the operation result would be
stored at (D)+1 and (D) in the following manner:
• The ASCII data designated by (S) to (S)+5 can be in the range of from -2147483648 to 2147483647. Further, data stored at
the upper bytes of (S)+5 will be ignored.
• The sign "20H" will be stored if the BIN data is positive, and the sign "2DH" will be stored if it is negative. (If other than "20H
" and "2DH" is set, it will be processed as positive data.)
• ASCII code can be set for each position within the range from "30H" to "39H".
• If the ASCII code set for individual positions is "20H" or "00H," it will be processed as "30H".
• In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and an error code is stored into SD0.
Error
code
Error details Q00J/
Q00/
Q01
QnH QnPH QnPRH QnU LCPU
4100 The ASCII codes specified in (S) to (S) +5 other than "30H" to "39H", "20H",
or "00H".
The ASCII data specified in (S) to (S) +5 is outside the following ranges:
• When the DABIN instruction is used: -32768 to 32767
• When the DDABIN instruction is used: -2147483648 to 2147483647
4101 The device specified in (S) exceeds the range of the corresponding device.
+1
Sign data
ASCII code for billions place
ASCII code for hundred-millions place
ASCII code for ten-millions place
b15 b8
b7
b0
+2
ASCII code for millions place
ASCII code for hundred-thousands place
ASCII code for ten-thousands place
ASCII code for thousands place
+3
ASCII code for hundreds placeASCII code for tens place
ASCII code for units place
(Ignored)
+4
+5
Upper 16 bits
Lower 16 bits
BIN 32 bits
+1
b31 b16b15 b0
S
DS
S
S
S
S
D
+1
2D
H
( )
31
H
(1)
32
H
(2)33
H
(3)
b15 b8b7 b0
+2
34
H
(4)35
H
(5)
34
H
(4)33
H
(3)
+3
32
H
(2)31
H
(1)
30
H
(0)
+4
+5
1234 3 2 1 0
+1
54
D
S
S
S
S
S
S
D