Conversion Instructions - Omron CPM1 Programming Manual

Hide thumbs Also See for CPM1:
Table of Contents

Advertisement

Limitations
Description
Precautions
Flags

7-19 Conversion Instructions

7-19-1 BCD-TO-BINARY - - BIN(23)
Limitations
Description
This instruction is available in the CPM2A/CPM2C only.
The 8-digit value in LL+1,LL must be less than or equal to UL+1,UL.
When the execution condition is OFF, ZCPL(----) is not executed. When the
execution condition is ON, ZCPL(----) compares the 8-digit value in CD, CD+1 to
the range defined by lower limit LL+1,LL and upper limit UL+1,UL and outputs
the result to the GR, EQ, and LE flags in the SR area. The resulting flag status is
shown in the following table.
Comparison result
p
CD , CD+1< LL+1,LL
LL+1,LL ≤ CD, CD+1 ≤ UL+1,UL
UL+1,UL < CD, CD+1
Placing other instructions between ZCPL(----) and the operation which accesses
the EQ, LE, and GR flags may change the status of these flags. Be sure to ac-
cess them before the desired status is changed.
ER:
Indirectly addressed DM word is non-existent. (Content of
not BCD, or the DM area boundary has been exceeded.)
LL+1,LL is greater than UL+1,UL.
ON if LL+1,LL ≤ CD, CD+1 ≤ UL+1,UL
EQ:
LE:
ON if CD, CD+1 < LL+1,LL.
GR:
ON if CD, CD+1 > UL+1,UL.
Ladder Symbols
BIN(23)
@BIN(23)
S
R
DM 6144 to DM 6655 cannot be used for R.
When the execution condition is OFF, BIN(23) is not executed. When the execu-
tion condition is ON, BIN(23) converts the BCD content of S into the numerically
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 Program-
ming Console or any other programming device will appear in hexadecimal rath-
er than decimal. It can also be used to convert to binary to perform binary arith-
metic operations rather than BCD arithmetic operations, e.g., when BCD and
binary values must be added.
GR
(SR 25505)
0
0
0
1
1
0
Operand Data Areas
S: Source word (BCD)
IR, SR, AR, DM, HR, TC, LR
S
R
IR, SR, AR, DM, HR, LR
S
BCD
R
Binary
Section
7-19
Flag status
EQ
LE
(SR 25506)
(SR 25507)
1
0
0

DM word is
R: Result word

Advertisement

Table of Contents
loading

This manual is also suitable for:

Srm-v2Cpm1aCpm2aSrm1Cpm2c

Table of Contents