Arithmetic Operation Instructions; Bin 16-Bit Addition And Subtraction Operations - Mitsubishi MELSEC-Q/L Programming Manual

Table of Contents

Advertisement

+, +P, -, -P
6.2

Arithmetic Operation Instructions

6.2.1
+, +P, -, -P

BIN 16-bit addition and subtraction operations

6.2.1
+, +P, -, -P
When two data are set (
+,
+P, P
: Data for additing/subtracting or head number of the devices where the data for additing/subtracting is stored (BIN 16 bits)
S
: Head number of the devices where the data to be added to/subtracted from is stored (BIN 16 bits)
D
Setting
Internal Devices
Data
Bit
Word
S
D
Function
+
(1) Adds 16-bit BIN data designated by
device designated by
D
(2) Values for
and
can be designated between -32768 and 32767 (BIN, 16 bits).
S
D
(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 +K2
(0002
)
(7FFF
)
(8001
H
H
K 32768 +K 2
(FFFE
)
(7FFE
(8000
)
H
H
(1) Subtracts 16-bit BIN data designated by
at the device designated by
(2) Values for
and
can be designated between -32768 and 32767 (BIN, 16 bits).
S
D
(3) The judgment of whether data is positive or negative is made by the most significant bit (b15).
• 0: Positive
• 1: Negative
188
+
,
-
)
D
S
D
D
S
D
Command
Command
J
R, ZR
Bit
to 16-bit BIN data designated by
D
.
D
b15
b0
b15
5678 (BIN)
K 32767
Since bit 15 value is "1",
)
H
result of operation takes a negative value.
Since bit 15 value is "0",
K32766
)
result of operation takes a positive value.
H
from 16-bit BIN data designated by
D
.
D
D
b15
b0
b15
5678 (BIN)
Basic
indicates an instruction symbol of
S
P
S
\
U
\G
Word
and stores the result of the addition at the
S
S
D
b0
b15
1234 (BIN)
6912 (BIN)
S
S
D
b0
b15
1234 (BIN)
4444 (BIN)
High
Process
Redundant Universal
performance
+/
.
D
D
Constants
Zn
K, H
––
b0
and stores the result of the subtraction
b0
LCPU
Other
––
––

Advertisement

Table of Contents
loading

Table of Contents