Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
15 Applied Instructions (External Device (optional device))
15.3 ASCI / Hexadecimal to ASCII Conversion
396
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
2. <16-bit conversion mode> When M8161=OFF(M8161 is used commonly with RS, HEX, CCD,
CRC instructions)
Each digit of HEX data stored after the device specified by is converted into ASCII code, and transferred
to lower and higher 8 bits (bytes) each in each device after the one specified by . The number of digits
(characters) to be converted is specified by n.
The device specified by is divided into lower 8 bits and higher 8 bits, and ASCII data is stored.
M8161 is used commonly with RS, HEX, CCD, CRC instructions. When using in 16 bits, you must keep
always OFF.
M8161 is cleared when changed from RUN to STOP.
Operation
In the case of the program shown below, the conversion is executed as follows.
Devices after
(D100)=0ABCH
(D101)=1234H
(D102)=5678H
Number of digits (characters) specified and result of conversion
K1 K2 K3 K4 K5 K6 K7 K8 K9
D 200 lowerC)B)A)0)4)3)2)1)8)
D 200 higher C) B) A) 0) 4) 3) 2) 1)
D 201 lower C)B)A)0)4)3)2)
D 201 higher C) B) A) 0) 4) 3)
D 202 lower C) B) A) 0) 4)
D 202 higher C) B) A) 0)
D 203 lower Not changed C) B) A)
D 203 higher C) B)
D 204 lower C)
M8000
Command input
Head device in which HEX
code to be converted is stored
Head device for storing
converted ASCII code
Number of characters in
HEX code to be converted
(number of digits)
ASCI
EN
s
n
ENO
d1
16-bit mode
M8161
M8000
X10
ASCI
EN
s
ENO
d
n
D100
D200
K4
16-bit mode
M8161