165
4
4 Instructions 4.5.1 Data Conversion
◆
Operands
Operand
Bit Element Word Element
System·User System·User Bit Designation Indexed Address Constant
Real
Number
S X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
D X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
n X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
Note: The elements in gray background are supported.
◆
Function
The value in S is encoded in ASCII format. The result is stored in variables from head address D.
S is the address of the variable or the numeric constant to be converted.
D is the head address for storing the ASCII characters after conversion
n is the number of converted characters, in the range 1 to 256.
The ASCI instruction conforms to the ASCII-HEX mapping table. For example, 0 in ASCII format
corresponds to H30 in hexadecimal format, and F in ASCII format corresponds to H46 in hexadecimal
format. For details about HEX-ASCII mapping, see
“ASC: ASCII code conversion” on Page 322
.
◆
Example:
$%&
D10
D11
D12
þ6ÿ
þ5ÿ
þ4ÿ
þ3ÿ
þ2ÿ
þ1ÿ
þ5ÿ
þ4ÿ
þ3ÿ
þ2ÿ
þ1ÿ
þ4ÿ
þ3ÿ
þ2ÿ
þ1ÿ
þ3ÿ
þ2ÿ
þ1ÿ
þ2ÿ
þ1ÿ
þ1ÿ
þ7ÿ
þ6ÿ
þ5ÿ
þ4ÿ
þ3ÿ
þ2ÿ
þ1ÿ
H
1
2
3
4
5
6
7
'()
0
D13
D100D101D102D103
L
HLHL
HL
n
Unchanged
D
S
þ6ÿ
þ5ÿ
þ4ÿ
þ3ÿ
þ2ÿ
þ1ÿ
þ5ÿ
þ4ÿ
þ3ÿ
þ2ÿ
þ1ÿ
þ4ÿ
þ3ÿ
þ2ÿ
þ1ÿ
þ3ÿ
þ2ÿ
þ1ÿ
þ2ÿ
þ1ÿ
þ1ÿ
þ7ÿ
þ6ÿ
þ5ÿ
þ4ÿ
þ3ÿ
þ2ÿ
þ1ÿ
1
2
3
4
5
6
7
D100
n
Unchanged
n
D
D101D102D103D104D105D106D107
M8161 = ON, 32-bit mode
ǒASCI D10 D100 K5Ǔ
X15
S D n
M8161 = OFF, 16-bit mode
n
(Hexadecimal)
The M8161 ag determines the width mode of the target variable that stores the calculation result. When
M8161 = OFF, the 16-bit mode is enabled, whereby the calculation result is stored in the higher and lower
bytes of the variable separately. When M8161 = ON, the 8-bit mode is enabled, whereby the calculation
result is stored only in the lower byte of the variable. Therefore, the length of the actually used variable area
is increased.