Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
15 Applied Instructions (External Device (optional device))
15.4 HEX / ASCII to Hexadecimal Conversion
401
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)
Number of characters specified and result of conversion
"." is 0.
When the input data is BCD, after execution of this instruction, you must convert from BCD to BIN.
In the case of HEX instruction, if the data stored in the device specified by is not ASCII code, it is an
operation error, and HEX conversion is disabled. In particular, if M8161 is OFF, you must store the ASCII
code also in the higher 8 bits of the device specified by .
3. <8-bit conversion mode> When M8161=ON(M8161 is used commonly with RS, ASCI, CCD,
CRC instructions)
ASCII characters stored in lower 8 bits in are converted into HEX data, and transferred to in every
four digits. The number of characters to be converted is specified by n.
M8161 is used commonly with RS, ASCI, CCD, CRC instructions. When using in 8 bits, you must keep
always ON.
M8161 is cleared when changed from RUN to STOP.
Operation
In the case of the program shown below, the conversion is executed as follows.
D 102 D 101 D 100
1
Not changed
...0H
2 ..0AH
3.0ABH
4 0ABCH
5...0HABC1H
6 ..0AH BC12H
7 .0ABH C123H
8 0ABCH 1234H
9 ...0H ABC1H 2345H
0011110101010000
D 100
0ABC
In the case of n=K4
0000110010000010
D 200
41H
0100001011000010
D 201
43H
A) 0)
B)C)
30H
42H
HEX
EN
s
n
ENO
d
M8000
Command input
Head device in which ASCII
code to be converted is stored
Head device for storing
converted HEX code
Number of characters in
ASCII code to be converted
(number of bytes)
8-bit mode
M8161
Ignored Lower 8 bits
Source data
16 bits
X010
HEX
EN
s
ENO
d
n
D200 D100
K4
M8000
8-bit mode
M8161