Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
18 Applied Instructions (Floating Point)
18.4 DESTR / Floating Point to Character String Conversion
451
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
11
Applied Instructions
(Data Operation)
12
Applied Instructions
(High Speed
Processing)
13
Applied Instructions
(Handy
Instruction)
14
Applied Instructions
(External FX I/O
Device)
15
Applied Instructions
(External Device
(optional device))
16
Applied Instructions
(External Device)
17
Applied Instructions
(Data Transfer 2)
18
Applied Instructions
(Floating Point)
19
Applied Instructions
(Data Operation 2)
20
Applied Instructions
(Positioning
Control)
The converted character string data is stored in the device after as follows.
- For the sign of integer part, "20H" (space) is stored when the binary floating decimal point data is
positive, and "2DH" (-) is stored when negative.
- The integer part is fixed in one digit.
Between the integer part and the sign, "20H" (space) is inserted.
- When the decimal part of binary floating decimal point data does not settle within the decimal digits, the
lower decimal digits are rounded off.
- When the number of decimal digits is set in other than "0", automatically "2EH" (.) is stored at the
specified decimal digits + 1 digit.
However, when the number of decimal digits is "0", "2EH" (.) is not stored.
- For the sign of exponential part, "2BH" (+) is stored when the index is positive, and "2DH" (-) is stored
when negative.
- The exponential part is fixed in two digits.
When the exponential part is one digit, between the exponential part and the sign, "30H" (0) is inserted.
- "00H" or "0000H" is automatically stored at the end of the converted character string.
Related instructions
Instruction Content
EVAL This instruction converts the character string (ASCII code) data into binary floating decimal point data.
STR This instruction converts BIN data into character string (ASCII code).
VAL This instruction converts the character string (ASCII code) data into BIN data.
1
12
4
+1
+2
All digits (12)
0
"20H" (space) is inserted.
2 3 4 6 E + 11
1 digit fixed
+1
-12.34567
s1
s2
s1
s2
s2
1
12
4
+1
+2
All digits (12)
02 3 4 6 E + 11 67
Number of digits
below decimal point (4)
Rounded and discarded.
+1
-12.34567
s1
s2
s1
s2
s2
1
12
4
+1
+2
All digits (12)
02 3 4 6 E + 11
Number of digits below decimal point (4)
Added automatically.
+1
-12.34567
s1
s2
s1
s2
s2
1
12
4
+1
+2
All digits (12)
0
"30H" (0) is inserted.
2 3 4 6 E + 11
2 digits fixed
+1
-12.34567
s1
s2
s1
s2
s2