Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
29 Applied Instructions (Data Table Operation)
29.5 DABIN / Decimal ASCII to BIN Conversion
696
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
Function and operation explanation
1. 16-bit operation (DABIN/DABINP)
1) Data expressed in decimal ASCII codes (30H to 39H) and stored in the device specified by is
converted into 16-bit binary data, and stored in the device specified by .
For example, when the device specified by stores ASCII codes expressing "-25108", 16-bit binary
data is stored in the device specified by as follows:
2) The numeric range of data stored in the device specified by is from "-32768" to "32767".
3) As "sign data", "20H (space)" is set when the data to be converted is positive, and "2DH (-)" is set when
the data to be converted is negative.
4) An ASCII code for each digit is within the range from 30H to 39H.
5) When an ASCII code for each digit is "20H (space)" or "00H (NULL)", it is handled as "30H".
2. 32-bit operation (DDABIN/DDABINP)
1) Data expressed in decimal ASCII codes (30H to 39H) and stored in the device specified by is
converted into 32-bit binary data, and stored in the device specified by .
For example, when the device specified by stores ASCII codes expressing "-1,234,543,210", 32-bit
binary data is stored in the device specified by as follows:
DABIN
EN ENO
d
s
Head device storing data (ASCII codes)
to be converted into binary data
Command
input
Device storing conversion result
+0
+2
b8 b7 b0
+1
b0b15
16-bit binary data(BIN)
ASCII code for 1's digit ASCII code for 10's digit
ASCII code for 10000's digit
ASCII code for 100's digit
Sign data
ASCII code for 1000's digit
b15
d
s
+0
b15
+2
b8 b7 b0
+1
-25108
b0b15
38H(8) 30H(0)
32H(2)
31H(1)
2DH(-)
35H(5)
s
d
DDABIN_P
EN ENO
d
s
Command
input
Head device storing data (ASCII codes)
to be converted into binary data
Device storing conversion result
+0
b15
+2
b8 b7 b0
+1
High-order 16 bits
b16b31
32-bit data
+3
+5
+4
Low-order 16 bits
b0b15
+1
ASCII code for 100,000's digit
ASCII code for 1,000,000's digit
ASCII code for 1,000,000,000's digit
ASCII code for 10,000,000's digit
Sign data
ASCII code for 100,000,000's digit
(Ignored) ASCII code for 1's digit
ASCII code for 1000's digit
ASCII code for 10's digit
ASCII code for 10000's digit
ASCII code for 100's digit
d d
s
+0
b15
+2
b8 b7 b0
+1
+3
+5
+4
35H(5) 34H(4)
31H(1)
33H(3)
2DH(-)
32H(2)
(Ignored) 30H(0)
33H(3)
31H(1)
34H(4)
32H(2)
+1
-1234543210
d d
s