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

When CIO 0.00 is ON in the following example, the 8-digit BCD value in CIO 0010 and CIO 0011 is con-

verted to hexadecimal and stored in D200 and D201.

BIN

BIN(023) converts the BCD data in S to binary data

and writes the result to R.

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

BINL

BINL(058) converts the 8-digit BCD data in S and

S+1 to 8-digit hexadecimal (32-bit binary) data and

writes the result to R and R+1.

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

(BCD) (BIN)RS
×103×102×101×100×163×162×161×160
RS 3452 0D7C
0347811121503478111215
RR+1
(BCD) (BCD)
S+1 S
(BIN) (BIN)
×103×102×101×100
×107×106×105×104
S+1 S
×163×162×161×160
×167×166×165×164
R+1 R
00 000 0520030D270
0
×107
0
×106
2
×105
0
×104
0
×103
0
×102
5
×101
0
×100
200050=3×164+13×162+7×161+2×160
0
×167
0
×166
0
×165
3
×164
0
×163
D
×162
7
×161
2
×160
BINL
10
D200
0.00
R : D200R+1 : D201
S+1 : CIO 11 S : CIO 10