Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
15 Applied Instructions (External Device (optional device))
15.3 ASCI / Hexadecimal to ASCII Conversion
397
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)
Bit composition in the case of n=K4
When issuing as BCD data by printer or the like, before execution of this instruction, you must convert from
BIN to BCD.
3. <8-bit conversion mode> When M8161=ON (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, and stored in lower 8
bits (bytes) in each device after the one specified by . The number of digits (characters) to be converted
is specified by n.
In the device specified by , higher 8 bits are 0.
M8161 is used commonly with RS, HEX, 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.
0000110010000010
0100001011000010
0011110101010000
D 100=ABCH
0ABC
D 200
C) 43H
A) 41H 0) 30H
B) 42H
D 201
ASCII code
0)=30H
A)=41H
B)=42H
C)=43H
1)=31H
2)=32H
3)=33H
4)=34H
5)=35H
6)=36H
7)=37H
8)=38H
0
16 bits
Lower 8 bits
When M8161=ON, 8-bit mode is established,
and the conversion is executed as follows.
Destination
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
8-bit mode
M8161
M8000
X10
ASCI
EN
s
ENO
d
n
D100
D200
K4
8-bit mode
M8161