Binary Calculations; Binary Add - Adb(50) - Omron SYSMAC C200HS Operation Manual

Programmable controllers
Hide thumbs Also See for SYSMAC C200HS:
Table of Contents

Advertisement

Binary Calculations

5-20 Binary Calculations
5-20-1 BINARY ADD – ADB(50)
Description
Flags
Binary calculation instructions — ADB(50), SBB(51), MLB(52), DVB(53),
ADBL(––), SBBL(––), MBS(––), MBSL(––), DBS(––), and DBSL(––) — perform
arithmetic operations on hexadecimal data.
Four of these instructions (ADB(50), SBB(51), ADBL(––), and SBBL(––)) can
act on both normal and signed data, two (MLB(52) and DVB(53)) act only on nor-
mal data, and four (MBS(––), MBSL(––), DBS(––), and DBSL(––)) act only on
signed binary data.
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 calcu-
lation, and to use the result placed in CY, if required, before it is changed by the
execution of any other instruction. STC(40) and CLC(41) can be used to control
CY. Refer to 5-19 BCD Calculations.
Signed binary addition and subtraction instructions use the underflow and over-
flow flags (UF and OF) to indicate whether the result exceeds the acceptable
range for 16-bit or 32-bit signed binary data. Refer to page 29 for details on
signed binary data.
Ladder Symbols
ADB(50)
@ADB(50)
Au
Ad
R
When the execution condition is OFF, ADB(50) is not executed. When the ex-
ecution condition is ON, ADB(50) adds the contents of Au, Ad, and CY, and
places the result in R. CY will be set if the result is greater than FFFF.
Au + Ad + CY
ADB(50) can also be used to add signed binary data. The underflow and over-
flow flags (SR 25404 and SR 25405) indicate whether the result has exceeded
the lower or upper limits of the 16-bit signed binary data range. Refer to page 29
for details on signed binary data.
Indirectly addressed DM word is non-existent. (Content of :DM word is
ER:
not BCD, or the DM area boundary has been exceeded.)
CY:
ON when the result is greater than FFFF.
EQ:
ON when the result is 0.
OF:
ON when the result exceeds +32,767 (7FFF).
UF:
ON when the result is below –32,768 (8000).
Operand Data Areas
Au: Augend word (binary)
IR, SR, AR, DM, HR, TC, LR, #
Ad: Addend word (binary)
Au
IR, SR, AR, DM, HR, TC, LR, #
Ad
R
IR, SR, AR, DM, HR, LR
CY
R
Section 5-20
R: Result word
219

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents