Arithmetic Operation Instructions; Bin 16-Bit Addition And Subtraction Operations (+(P), -(P)) - Mitsubishi MELSEC QS Series Programming Manual

Hide thumbs Also See for MELSEC QS Series:
Table of Contents

Advertisement

+(P), -(P)
6.2

Arithmetic Operation Instructions

6.2.1
BIN 16-bit addition and subtraction operations (+(P), –(P))
+(P), -(P)
When two data are set (
+,
+P,
P
Function
+
(1) Adds 16-bit BIN data designated by
result of the addition at the device designated by
(2) Values for
(3) The judgment of whether data is positive or negative is made by the most significant bit
(b15).
• 0: Positive
• 1: Negative
(4) The following will happen when an underflow or overflow is generated in an operation result:
The carry flag in this case does not go ON.
. K32767
(H7FFF)
. K 32768 +K 2
( H 8000)
6-6
6.2 Arithmetic Operation Instructions
6.2.1 BIN 16-bit addition and subtraction operations (+(P), –(P))
+
D
S
D
Command
Command
: Data for additing/subtracting or start number of the devices where the data for additing/subtracting is stored
S
(BIN 16 bits)
:Start number of the devices where the data to be added to/subtracted from is stored (BIN 16 bits)
S1 D
Internal Devices
Set
Data
Bit
Word
D
D
b15
b0
b15
5678 (BIN)
+
and
can be designated between
S
D
+K2
K 32767
Since b15 is "1", the judgment is
a negative value.
(H0002)
(H8001)
K32766
Since b15 is "0", the judgment is
( H FFFE)
(H7FFE)
a positive value.
,
)
D
S
D
S
P
S
Constants
Others
K, H
––
––
––
to 16-bit BIN data designated by
D
.
D
S
D
b0
b15
1234 (BIN)
6912 (BIN)
32768 and 32767 (BIN, 16 bits).
indicates "+ / -".
D
D
and stores the
S
b0

Advertisement

Table of Contents
loading

Table of Contents