High−level Instructions
3 − 166
Explanation of example
Converts BCD code that express a 4-digit decimal number (4-digit BCD H code) stored in data register DT0 to
ASCII code when trigger R0 turns on. The converted data is stored in data registers DT10 and DT11.
When S2 = H2 (normal direction, 2 bytes convertion)
DT0
BCD
H code
DT11
ASCII
HEX code
1234
3231
ASCII
character
21
DT10
3433
43
When S2 = H1002 (reverse direction, 2 bytes convertion)
DT0
BCD
data
DT11
ASCII
HEX code
1234
3433
ASCII
character
43
DT10
3231
21
Description
Converts the BCD code starting from the 16-bit area specified by S1 to ASCII code that expresses the
equivalent decimals as specified by S2. The converted result is stored in the area starting from the 16-bit area
specified by D.
A maximum of four bytes (8−figure of data) can be converted.
S2 specifies the number of source data bytes and the direction of converted data (normal/reverse).
The data length when converted to ASCII code becomes double the BCD source data.