FX Series Programmable Controlers Applied Instructions 5
5-98
5.9.3 ASCI (FNC 82)
Operation:
This instruction reads n hexadecimal data
characters from head source address (S) and
converts them in to the equivalent ASCII code.
This is then stored at the destination (D) for n
number of b
tes.
Points to note:
Please note that data is converted ‘as read’, i.e. usin
the example above with the followin
data in (D9,D8) AB
CD
H
,
EF26
H
. Takin
the first n hexadecimal characters (di
its) from the ri
ht
(in this case n= 6) and convertin
them to ASCI will store values in 6 consecutive b
tes from
D20, i.e. D20 = (67, 68), D21 = (69, 70) and D22 = (50, 54) respectivel
. In true characters
s
mbols that would be read as
CDEF26
.
This can be shown
raphicall
as in the table
to the ri
ht. Please take special note that the
source data (S) read from the most si
nificant
device to the least si
nificant. While the
destination data (D) is read in the opposite
direction.
The ASCI instruction can be used with the
M8161, 8 bit/16bit mode fla
. The effect of this
fla
is exactl
the same as that detailed on
pa
e 10-20. The example to the ri
ht shows
the effect when M8161 is OFF.
If M8161 was set ON, then onl
the lower
destination b
te (b0-7) would be used to store data and hence 6 data re
isters would be
required (D20 throu
h D25).
Mnemonic Function
Operands
Program steps
SD n
ASCI
FNC 82
(Converts
HEX to
ASCII)
Converts a data
value from
hexadecimal to
ASCII
K, H, KnX,
KnY,
KnM, KnS
T, C, D, V, Z
KnY, KnM,
KnS
T, C, D
K, H
Note:
n = 1 to 256
ASCI,
ASCIP:
7 steps
HEX
Character
0123456789ABCDEF
ASCII
Code
HEX
30 31 32 33 34 35 36 37 38 39 41 42 43 44 45 46
DEC
48 49 50 51 52 53 54 55 56 57 65 66 67 68 69 70
Character
Symbol
’0’ ’1’ ’2’ ’3’ ’4’ ’5’ ’6’ ’7’ ’8’ ’9’ ’A’ ’B’ ’C’ ’D’ ’E’ ’F’
X7
K 6
[ S ] [ D ]
D20ASCI D8
[ n ]
ASCII Character Codes
The table below identifies the usable hexadecimal di
its and their associated ASCII codes