Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
26 Applied Instructions (Character String Control)
26.2 VAL / Character String to BIN Conversion
623
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)
Function and operation explanation
1. 16-bit operation (VAL/VALP)
1) A character string stored in the device specified by and later is converted into 16-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
converted 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 "-123.45" is specified in the device specified by and later, the
conversion result is stored in the devices specified by and as shown below.
2) Character string to be converted
a) Number of characters of character string and the numeric range when the decimal point is ignored.
b) Character types used in characters to be converted
Description
Number of all characters (digits) 2 to 8
Number of characters (digits) of decimal part 0 to 5 and smaller than "number of all digits - 3"
Numeric range when decimal point is ignored
-32768 to 32767
Example) "123.45" "12345"
Character type
Sign
Positive numeric value "Space (20H)"
Negative numeric value "-(2DH)"
Decimal point ".(2EH)"
Number "0(30H)" to 9(39H)"
Head device storing a character string
to be converted into binary data
VAL
EN ENO
d1
d2
s
Head device storing the binary data acquired by conversion.
Command
input
Head device storing the number of digits of the binary data
acquired by conversion.
+0
Number of
all digits
Number of digits
of decimal part
-
Sign
+0
+1
b15
+2
+3
+4
b8 b7 b0
It indicates the end of character string.
Integer value in
which decimal
point is ignored.
+1
16-bit binary data
1st character
2nd character
7th character
ASCII code of 1st character
ASCII code of 3rd character
ASCII code of 5th character
ASCII code of 7th character
ASCII code indicating sign
ASCII code of 2nd character
ASCII code of 4th character
ASCII code of 6th character
00H
d1
d2
s
+0
7
2
- 1 2 3 4 5
+0
+1
b15
+2
+3
b8 b7 b0
It indicates the end of character string.
-12345
+1
31H(1)
33H(3)
34H(4)
00H
2DH(-)
32H(2)
2EH( )
35H(5)
d1
d2
s