189
+, +P, -, -P
1
2
3
4
6
7
8
6.2
A
rithmetic Opera
tion In
str
uctions
6.2.1
+
, +P
,
-, -P
(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.
Operation Error
(1) There is no operation error in the +(P) or -(P) instruction.
When three data are set ( +
, -
)
:
Data to be added to/subtracted from or head number of the devices where the data to be added to/subtracted from is stored (BIN 16 bits)
:
Data for additing/subtracting or head number of the devices where the data for additing/subtracting is stored (BIN 16 bits)
:
Head number of the devices where the addition/subtraction operation result will be stored (BIN 16 bits)
Function
+
(1) Adds 16-bit BIN data designated by to 16-bit BIN data designated by and stores the result of the addition at the
device designated by .
(2) Values for , and can be designated between -32768 and 32767 (BIN, 16 bits).
(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.
Setting
Data
Internal Devices
R, ZR
J \
U \G
Zn
Constants
K, H
Other
Bit
Word
Bit
Word
––
––
––
––
S
i
nce
b
i
t
15
va
l
ue
i
s
"
0
",
resu
l
t
of
operat
i
on
ta
k
es
a
pos
i
t
i
ve
va
l
ue
.
S
i
nce
b
i
t
15
va
l
ue
i
s
"
1
",
resu
l
t
of
operat
i
on
ta
k
es
a
negat
i
ve
va
l
ue
.
K
32767
K
2
(
7
FFF
H
)
K
32767
K
2
K
32766
(
7
FFE
H
)
(
8001
H
)
(FFFE
H
)
(
8000
H
)
(
0002
H
)
K
32768
S1
S2
D
S1
S2
D
Command
Command
P
+,
+/
+P, P
S1
S2
D
S1
S2
D
indicates an instruction s
y
mbol of .
S1
S2
D
S1
S2
D
S1
S2
D
b0
5678
(
B
IN)
b15
b0
6912
(
B
IN)
b15
b0
123
4 (
B
IN)
b15
S1
S2
D
S1
S2
D
D
S
i
nce
b
i
t
15
va
l
ue
i
s
"
0
",
resu
l
t
of
operat
i
on
ta
k
es
a
pos
i
t
i
ve
va
l
ue
.
S
i
nce
b
i
t
15
va
l
ue
i
s
"
1
",
resu
l
t
of
operat
i
on
ta
k
es
a
negat
i
ve
va
l
ue
.
K
32767
+K
2
K
32768
+K
2
K
32767
(
7
FFF
H
)
(
0002
H
)
(
8001
H
)
(
8000
H
)
(FFFE
H
)
K
32766
(
7
FFE
H
)