Bcd Calculation Instructions - Omron SYSMAC CVM1 Series Operation Manual

Duplex system
Hide thumbs Also See for SYSMAC CVM1 Series:
Table of Contents

Advertisement

BCD Calculation Instructions

Precautions
Flags
Example
0000
00
(278)
BDSL
#0003
5-18

BCD Calculation Instructions

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.
ER (A50003):
EQ (A50006)
N (A50008)
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.
D00100
D00200
S+1: D00101
D+1: D00201
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.
Data to be converted is not within range for data format.
Content of a*DM word is not BCD when set for BCD.
Content of the converted data is all zeroes.
Data to be converted is a negative number.
S: D00100
F F 8 B
3 4 4 F
D: D00200
F 7 6 5
4 3 2 1
Section 5-18
Address Instruction
00000
LD
00001
BDSL(278)
Double signed binary data
Double signed BCD data
(–7654321)
Operands
000000
#0003
D00100
D00200
237

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac cv seriesSysmac cvm1d series

Table of Contents