2-203

2 Instructions
CP1E CPU Unit Instructions Reference Manual(W483)
Conversion Instructions
2
ASC
Sample program

When CIO 0.00 is ON in the following example, ASC(086) converts three hexadecimal digits in D100

(beginning with digit 1) into their ASCII equivalents and writes this data to D200 and D201 beginning

with the leftmost byte in D200. In this case, a digit designator of #0121 specifies no parity, the starting

byte (when writing) = leftmost byte, the number of digits to read = 3, and the starting digit (when read-

ing) = digit 1.

Example of ASCII code conversion

* Parity bit - changes according to the parity specification.

Content of conversion data digits Conversion output data
Value Bit content Code (MSB) bit content (LSB)
00000#30*0110000
10001#31*0110001
20010#32*0110010
30011#33*0110011
40100#34*0110100
50101#35*0110101
60110#36*0110110
70111#37*0110111
81000#38*0111000
91001#39*0111001
A1010#41*1000001
B1011#42*1000010
C1100#43*1000011
D1101#44*1000100
E1110#45*1000101
F1111#46*1000110
D: D200
D201
ASC
D100
#0121
D200
0.00
S
Di
D
0347815 1211
0347815 1211
1210
0123
321
07815
33
3231
S: D100
Di: #
Number of digits
Digits
HEX
ASCII
Starting digit
Starting byte
(leftmost byte)