7 APPLICATION INSTRUCTIONS
7.8 String Processing Instructions
663
7
• These instructions add a decimal point to the 32-bit binary data in the device specified by (s2) at the location specified by
(s1), convert the data to character string data, and store the converted data in the device areas specified by (d) and later.
When converting data "-654321" in (s2) into a string assuming that the number of decimal places is three ("-654.321")
• The total number of digits that can be specified by (s1) is 2 to 13.
• The number of digits in the decimal part that can be specified by (s1)+1 is 0 to 10. Note that the number of digits in the
decimal part must be smaller than the total number of digits minus 3.
(s1)+1
b15 b8 b7 b0
00H
(d)+4
(d)+3
(d)+6
(d)+5
(d)+2
(d)+1
(d)
(s1)
b0 b31 b16 b15
(s2)+1 (s2)
.
Total number of digits
Number of digits in the
decimal part
A null character, 00H, is automatically stored at the end of string.
Sign
Upper 16 bits Lower 16 bits
ASCII code ((total number of
digits - 1)th digit)
ASCII code ((total number of
digits - 3)th digit)
ASCII code ((total number of
digits - 5)th digit)
ASCII code ((total number of
digits - 7)th digit)
ASCII code (sign data)
ASCII code ((total number of
digits - 2)th digit)
ASCII code ((total number of
digits - 4)th digit)
ASCII code ((total number of
digits - 6)th digit)
ASCII code ((total number of
digits - 9)th digit)
ASCII code ((total number of
digits - 11)th digit)
ASCII code ((total number of
digits - 8)th digit)
ASCII code ((total number of
digits - 10)th digit)
ASCII code ((total number of
digits - 12)th digit)
Device area for
the total number
of digits
32-bit binary data
36H (6)
34H (4)
33H (3)
00H
2DH (-)
35H (5)
31H (1) 32H (2)
2EH (.)
b7 b0b15 b8
8
3
5-6 .4132
-654321
(d)
(d)+1
(d)+2
(d)+3
(d)+4
(s1)
(s1)+1
(s2)+1 (s2)
b0b15 b16b31
BIN32