6 BASIC INSTRUCTIONS
6.2 Arithmetic Operation Instructions
283
6
• These instructions add the (n) points of 16-bit binary data from the device specified by (s1) and the (n) points of 16-bit
binary data from the device specified by (s2) or the constant, and store the operation result in the device specified by (d)
and later.
• Specify data in units of 16 bits.
When a device is specified by (s2) (signed value specification)
When a constant is specified by (s2) (signed value specification)
• If an overflow occurs, the result will be as follows. In this case, SM700 does not turn on.
When a signed value is specified When an unsigned value is specified
Error code
(SD0)
Description
2821H The device ranges starting from the ones specified by (s1) and (d) are overlapping (except when the same device is specified for (s1) and
(d)).
The device ranges starting from the ones specified by (s2) and (d) are overlapping (except when the same device is specified for (s2) and
(d)).
+
1234 (BIN)
4567 (BIN)
-2000 (BIN)
-1234 (BIN)
4000 (BIN)
(n)
(n) (n)
4000 (BIN)
1234 (BIN)
-1234 (BIN)
5000 (BIN)
4321 (BIN)
5234 (BIN)
5801 (BIN)
-3234 (BIN)
3766 (BIN)
8321 (BIN)
(s1)
(s1)+1
(s1)+(n)-2
(s1)+(n)-1
(s1)+2
(s2)
(s2)+1
(s2)+(n)-2
(s2)+(n)-1
(s2)+2
(d)
(d)+1
(d)+(n)-2
(d)+(n)-1
(d)+2
b15 b0 b15 b0 b15 b0
1234 (BIN)
4567 (BIN)
-2000 (BIN)
-1234 (BIN)
4000 (BIN)
(n)
(n)
5555 (BIN)
8888 (BIN)
2321 (BIN)
3087 (BIN)
8321 (BIN)
(s1)
(s1)+1
(s1)+(n)-2
(s1)+(n)-1
(s1)+2
(d)
(d)+1
(d)+(n)-2
(d)+(n)-1
(d)+2
b15 b0
b15 b0
b15 b0
4321 (BIN)(s2)
+
K32767
(H7FFF)
K2
(H0002)
K-32767
(H8001)
K-32767
(H8001)
K-2
(HFFFE)
+
+
K32767
(H7FFF)
K65535
(HFFFF)
K1
(H0001)
K0
(H0000)
+