![Omron CVM1D Скачать руководство пользователя страница 242](http://html1.mh-extra.com/html/omron/cvm1d/cvm1d_operation-manual_742532242.webp)
(278)
BDSL
#0003
D00100
D00200
0000
00
237
First the signed BCD data format and range in words S+1 and S are checked
against the data control word (C). If the check is okay, the signed BCD data in
words S+1 and S is converted to binary and output to the designated words D+1
and D. If the check is not okay, the Error Flag (A50003) will turn ON and the
instruction will not be executed.
In signed BCD data, –0 is treated as +0.
Refer to page 101 for general precautions on operand data areas.
Flags
ER (A50003):
Data to be converted is not within range for data format.
Content of a
*
DM word is not BCD when set for BCD.
EQ (A50006)
Content of the converted data is all zeroes.
N (A50008)
Data to be converted is a negative number.
Example
When CIO 000000 is ON in the following example, first the data format and
range in D00101 and D00100 are checked against data control word “0003”
(first operand). If the check is okay, the double signed binary data in D00101 and
D00100 is converted to BCD and output to D00201 and D00200.
Address
Instruction
Operands
00000
LD
000000
00001
BDSL(278)
#0003
D00100
D00200
Double signed binary data
S+1: D00101
F F 8 B
Double signed BCD data
(–7654321)
D+1: D00201
F 7 6 5
S: D00100
3 4 4 F
D: D00200
4 3 2 1
5-18
BCD Calculation Instructions
The BCD Calculation Instructions perform arithmetic operations on BCD data.
The CVM1D CPUs also support BCD symbol math instructions. Refer to 5-20
Symbol Math Instructions for details.
STC(078) and CLC(079), which set and clear the carry flag, are included in this
group because most of the BCD operations make use of the carry flag (CY) in
their results. Binary calculations and shift operations also use CY.
The addition and subtraction instructions include CY in the calculation as well as
in the result. Be sure to clear CY if its previous status is not required in the cal-
culation, and to use the result placed in CY, if required, before it is changed by
execution of any other instruction.
Precautions
BCD Calculation Instructions
Section 5-18
Содержание CVM1D
Страница 462: ...SYSMAC CVM1D Duplex System Programmable Controllers Operation Manual Revised August 2001...
Страница 463: ...iv...
Страница 465: ...vi...