2 Instructions
2-188 CP1E CPU Unit Instructions Reference Manual(W483)
Function
Sample program

When CIO 0.00 is ON in the following example, the hexadecimal value in CIO 11 and CIO 10 is con-

verted to a BCD value and stored in D100 and D101.

BCD

BCD(024) converts the binary data in S to BCD data

and writes the result to R.

The following diagram shows an example BCD-to-binary conversion.

BCDL

BCDL(059) converts the 8-digit hexadecimal (32-bit

binary) data in S and S+1 to 8-digit BCD data and

writes the result to R and R+1.

The following diagram shows an example of 8-digit BCD-to-binary conversion.

(BIN) (BCD)
RS
×163×162×161×160
RS 10EC 4332
0347811121503478111215
×103×102×101×100
RR+1
(BCD) (BCD)
S+1 S
(BIN) (BIN)
×103×102×101×100
×107×106×105×104
S+1 S R+1 R
00 D32 A02 02 619 039
×163×162×161×160
×167×166×165×164
BCDL
10
D100
0.00
0
×167
0
×166
2
×165
D
×164
3
×163
2
×162
0
×161
A
×160
2×16513×1643×1632×16210 2961930
0
×107
2
×106
9
×105
6
×104
1
×103
9
×102
3
×101
0
×100
MBS
MBS LSB
LSB
S+1 : CIO 11 S: CIO 10
R+1 : D101 R : D100