Example 9) Converting unsigned 16-bit BCD data (2 data) to decimal ASCII data (5
digits x 2)
The low byte of DT100 is set as the beginning of the storage area. It is stored left-aligned (low
word side) for 5 significant figures. Zero padding is used.
H 35
5
30
H 3336
3 6
H 3130
H 3332
0
0 4
3 2
1 0
H 3034
H 0123
DT100
DT101
DT102
DT103
(characters)
[S2]…DT0
[D]…DT100
[D]
DT104
[i]…US
[S1]…"%05b"
[N]…H
DT0
Convert 16-bit BCD data into decimal ASCII data (5 digits) (zero padding)
① ASCII data (forward direction)
:
:
00020000
② Storage start position (0) [D]+0 bytes
③ Conversion data amount (2) Convert [S2] and [S2]+1
[S2]
[S2]+1
[S2]
② Storage start position = +0 bytes③ Conversion data amount = 2
DT0: H 0123 → DT100 to DT102: "23010" is the data that is converted from H0123.
DT1: H 3456 → DT102 to DT104: "56340" is the data that is converted from H3456.
H 3456
DT1
DT2
H 123
H 3456
DT105
Example 10) Converting unsigned 32-bit BCD data (2 data) to decimal ASCII data (10
digits x 2)
The low byte of DT100 is set as the beginning of the storage area. It is stored right-aligned
(high word side). Zero padding is used within the 7 significant figures. Spaces are inserted for
the remaining digits.
14.9 BTOA (Conversion: BIN → ASCII)
14-40 WUME-FP7CPUPGR-12