Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
26 Applied Instructions (Character String Control)
26.1 STR / BIN to Character String Conversion
619
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
21
Applied Instructions
(Real Time
Clock Control)
22
Applied Instructions
(External Device)
23
Applied Instructions
(Extension
Function)
24
Applied Instructions
(Others)
25
Applied Instructions
(Block Data
Operation)
26
Applied Instructions
(Character
String Control)
27
Applied Instructions
(Data Operation 3)
28
Applied Instructions
(Data Comparison)
29
Applied Instructions
(Data Table
Operation)
30
Applied Instructions
(External Device
Communication)
d) When the number of all digits stored
in excluding the sign and
decimal point is larger than the
number of digits of 16-bit binary data
stored in , "space" (20H) is
stored in each digit between the sign
and the numeric value.
When the number of all digits stored
in excluding the sign and
decimal point is smaller than the
number of digits of 16-bit binary data
stored in , an error is caused.
e) "00H" indicating the end of a character string is automatically stored at the end of a converted
character string.
When the number of all digits is even, "0000H" is stored in the device after the last character.
When the number of all digits is odd, "00H" is stored in the high-order byte (8 bits) of the device storing
the last character.
2. 32-bit operation (DSTR/DSTRP)
1) All digits (specified by ) of 32-bit binary data stored in the device specified by are converted into
ASCII codes while the decimal point is added to the position specified by the device storing the number of
digits of the decimal part ( + 1), and stored in the device specified by and later.
2) Set the number of all digits in the range from 2 to 13.
3) Set the number of digits of the decimal part + 1 in the range from 0 to 10.
Be sure to satisfy "(Number of digits of decimal part) (Number of all digits - 3)".
4) 32-bit binary data to be converted stored in should be within the range from -2,147,483,648 to
+2,147,483,647.
12 3
Number of all digits
"20H" (space) is
stored in each digit
Number of digits
of decimal part
16-bit binary data
8
1
-123
-
8
3
4 3 2 1
+0
+1
56-
+1
-654321
32-bit
binary data
Number of
all digits
Number of digits
of decimal part
Sign
+0
+1
High order 16 bits Low order 16 bits
b31 b16 b15 b0
+1
32-bit binary data
s1
s2 s2
s2
s1
s2 s2
b15
+0
+2
b8 b7 b0
0000H is automatically
stored at the end of a
character string.
+1
For numbe
r
of all digits
=8
36H(6)
34H(4)
33H(3)
2DH(-)
35H(5)
2EH(.)
+4
+3
31H(1)
0000H
32H(2)
+0
b15
+2
+3
+5
b8 b7 b0
00H is automatically stored at the
end of a character string.
+1
For numbe
r
of all
digits
For value
stored
in
ASCII code in "(Value
specifying number of
all digits - 1)"th digit
ASCII code in "(Value
specifying number of
all digits - 3)"th digit
ASCII code in "(Value
specifying number of
all digits - 2)"th digit
ASCII code in "(Value
specifying number of
all digits - 4)"th digit
ASCII code in "(Value
specifying number of
all digits - 6)"th digit
ASCII code in "(Value
specifying number of
all digits - 8)"th digit
ASCII code in "(Value
specifying number of
all digits - 10)"th digit
ASCII code in "(Value
specifying number of
all digits - 5)"th digit
ASCII code in "(Value
specifying number of
all digits - 7)"th digit
ASCII code in "(Value
specifying number of
all digits - 9)"th digit
ASCII code
indicating sign
00H
+4
d
d
s1
s1
DSTR
EN ENO
d
s1
s2
Head device storing the number of digits
of a numeric value to be converted
Command
input
Head device storing converted character string
Device storing binary
data to be converted