108
4
4 Instructions4.4.1 Four Arithmetic Operations
The carry ag M8022 is set if the absolute value of the calculation result is greater than the maximum
oating-point value.
The borrow ag M8021 is set if the absolute value of the calculation result is less than the minimum
oating-point value.
Example:
〔DEADD D2
D4 D10〕
X10
DS1 S2
〔DEADDP D20 K123 D20〕
X11
When X10 = ON, the sum of two binary oating-point numbers in (D3, D2) and (D5, D4) is stored in (D11,
D10).
When X11 switches from OFF to ON, the oating-point number in (D21, D20) is incremented by 123. The
constant K123 is changed to a binary oating-point number before the addition operation.
If the unit that stores the sum is the same as the augend or addend storage unit, use the DEADDP
instruction of the pulse execution type. If the continuous execution type is used, calculation is performed
upon every program scan.
ESUB: Binary oating point subtraction
◆
Overview
The ESUB instruction subtracts one binary oating-point number from another.
ESUB S1 S2 D
Binary floating
point subtraction
Applicable model:
H3U
S1 Subtrahend Subtrahend of a binary oating point subtraction 32-bit instruction
(13 steps)
DESUB: Continuous
execution
DESUBP: Pulse
execution
S2 Minuend Minuend of a binary oating point subtraction
D Difference
Unit that stores the difference in a binary oating point
subtraction
◆
Operands
Operand
Bit Element Word Element
System·User System·User Bit Designation Indexed Address Constant
Real
Number
S1 X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
S2 X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
D X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
Note: The elements in gray background are supported.
◆
Function
One binary oating-point number is subtracted from another.
●
S1 and S2 are respectively the subtrahend and minuend of a binary oating point subtraction.
●
D is the unit that stores the difference in a binary oating point subtraction.
●
If the constant K or H is used as the operand S1 or S2, the value is converted to a binary oating-point
number before the subtraction operation.