Binary-To-Bcd - Bcd(24) - Omron CPM1 Programming Manual

Hide thumbs Also See for CPM1:
Table of Contents

Advertisement

Conversion Instructions
Description
Flags
5-19-2 BINARY-TO-BCD – BCD(24)
Limitations
Description
When the execution condition is OFF, BIN(23) is not executed. When the exe-
cution condition is ON, BIN(23) converts the BCD content of S into the numer-
ically equivalent binary bits, and outputs the binary value to R. Only the
content of R is changed; the content of S is left unchanged.
BIN(23) can be used to convert BCD to binary so that displays on the Pro-
gramming Console or any other programming device will appear in hexadeci-
mal rather than decimal. It can also be used to convert to binary to perform
binary arithmetic operations rather than BCD arithmetic operations, e.g.,
when BCD and binary values must be added.
ER:
The content of S is not BCD.
Indirectly addressed DM word is non-existent. (Content of *DM word
is not BCD, or the DM area boundary has been exceeded.)
EQ:
ON when the result is zero.
Ladder Symbols
BCD(24)
@BCD(24)
S
R
If the content of S exceeds 270F, the converted result would exceed 9999 and
BCD(24) will not be executed. When the instruction is not executed, the con-
tent of R remains unchanged.
DM 6144 to DM 6655 cannot be used for R.
BCD(24) converts the binary (hexadecimal) content of S into the numerically
equivalent BCD bits, and outputs the BCD bits to R. Only the content of R is
changed; the content of S is left unchanged.
BCD(24) can be used to convert binary to BCD so that displays on the Pro-
gramming Console or any other programming device will appear in decimal
rather than hexadecimal. It can also be used to convert to BCD to perform
BCD arithmetic operations rather than binary arithmetic operations, e.g.,
when BCD and binary values must be added.
S
BCD
R
Binary
Operand Data Areas
IR, SR, AR, DM, HR, LR
S
R
IR, SR, AR, DM, HR, LR
Binary
S
R
BCD
Section 5-19
S: Source word (binary)
R: Result word
259

Advertisement

Table of Contents
loading

Table of Contents