Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
26 Applied Instructions (Character String Control)
26.2 VAL / Character String to BIN Conversion
624
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
3) The device specified by stores the number of all digits. The number of all digits indicates the number
of all characters (including the number, sign and decimal point).
4) The device specified by + 1 stores the number of digits of the decimal part. The number of digits of
the decimal part indicates the number of all characters after the decimal point "." (2EH).
5) The device specified by stores 16-bit binary data converted from a character string with the decimal
point ignored.
In the character string located in the device specified by and later, "space" (20H) and "0" (30H)
characters between the sign and the first number other than "0" are ignored in the conversion to 16-bit
binary data.
2. 32-bit operation (DVAL/DVALP)
1) A character string stored in the device specified by and later is converted into 32-bit binary data.
The number of all digits of the binary data acquired by conversion is stored in the device specified by
, the number of digits of the decimal part is stored in the device specified by + 1, and the binary
data is stored in the device specified by .
In conversion from a character string into binary data, the data from the device specified by to a
device number storing "00H" is handled as a character string in byte units.
For example, when a character string "-12345.678" is specified in the device specified by and later,
the conversion result is stored in the devices specified by and as shown below.
12
Number of
all digits
Ignored
Number of digits
of decimal part
16-bit
binary data
8
2
-12345
345-
00
Number of
all digits
Ignored
Number of digits
of decimal part
16-bit
binary data
7
4
12
012
Sign
+0
Number of
all digits
Number of digits
of decimal part
-
Sign
+0
+1
b15
+2
+3
+6
b8 b7 b0
It indicates the end of character string.
+1
32-bit binary data
1st character
2nd character
12th character
+4
+5
Integer value in which
decimal point is ignored.
+1
00H
ASCII code of
1st character
ASCII code
indicating sign
ASCII code of
3rd character
ASCII code of
5th character
ASCII code of
7th character
ASCII code of
9th character
ASCII code of
11th character
ASCII code of
2nd character
ASCII code of
4th character
ASCII code of
6th character
ASCII code of
8th character
ASCII code of
10th character
ASCII code of
12th character
s
d1
d2d2
DVAL
EN ENO
d1
d2
s
Head device storing a character string
to be converted into binary data
Head device storing the number of digits of the binary data
acquired by conversion.
Command
input
Head device storing the binary data acquired by conversion.
+0
10
3
-
2 3 5 6
+0
+1
b15
+2
+3
b8 b7 b0
+1
+4
+5
31H(1)
33H(3)
35H(5)
36H(6)
2DH(-)
32H(2)
34H(4)
2EH(.)
38H(8) 37H(7)
74 81
-12345678
+1
d1
d2
s
d2
00H