2-187

2 Instructions
CP1E CPU Unit Instructions Reference Manual(W483)
Conversion Instructions
2
BCD/BCDL
BCD/BCDL
Applicable Program Areas
Operands

S: Source Word (BCD)/First Source Word (BCDL)

BCD

S must be between 0000 and 270F hexadecimal (0000 and 9999 decimal).

BCDL

The content of S+1 and S must be between 0000 0000 and 05F5 E0FF hexadecimal (0000 0000

and 9999 9999 decimal).

Operand Specifications
Flags
Instruction Mnemonic Variations Function
code Function
BINARY TO BCD BCD @BCD 024 Converts a word of binary data to a word of BCD
data.
DOUBLE BINARY TO
DOUBLE BCD BCDL @BCDL 059 Converts 8-digit hexadecimal (32-bit binary) data
to 8-digit BCD data.
Symbol
BCD BCDL
Area Step program areas Subroutines Interrupt tasks
Usage OK OK OK
Operand Description Data type Size
BCD BCDL BCD BCDL
SBCD: Source word
BCDL: First source word UINT UDINT 1 2
RBCD: Result word
BCDL: First result word WORD DWORD 1 2
Area Word addresses Indirect DM addresses Constants CF Pulse bits TR bits
CIO WR HR AR T C DM @DM *DM
S,R OK OK OK OK OK OK OK OK OK --- --- --- ---
Name Label Operation
BCD BCDL
Error Flag P_ER ON if the content of S exceeds 270F (9999 dec-
imal).
OFF in all other cases.
ON if the contents of S and S+1 exceed 05F5
E0FF (9999 9999 decimal).
OFF in all other cases.
Equals Flag P_EQ ON if the result is 0000.
OFF in all other cases.
ON if the result is 0.
OFF in all other cases.
S: Source word
D: Result word
BCD(024)
S
R
S: First source word
D: First result word
BCDL(059)
S
R