226
6 BASIC INSTRUCTIONS
6.2 Arithmetic Operation Instructions
D+(P), D-(P) [When three data are set]
■D+
• Adds 32-bit BIN data designated by (S1) to 32-bit BIN data designated by (S2), and stores the result of the addition at the
device designated by (D).
• The values for (S1), (S2) and (D) can be designated at between -2147483648 and 2147483647 (BIN 32 bits).
• Judgment of whether the data is positive or negative is made on the basis of the most significant bit (b31).
• The following will happen when an underflow or overflow is generated in an operation result: The carry flag (SM700) in this
case does not turn ON.
(S1): 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 32 bits)
(S2): Data for adding/subtracting or head number of the devices where the data for adding/subtracting is stored (BIN 32 bits)
(D): Head number of the devices where the multiplication/division operation result will be stored (BIN 32 bits)
Setting
data
Internal device R, ZR J\ U\G Zn Constant
K, H
Others
Bit Word Bit Word
(S1)
(S2)
(D)
•0 Positive
•1 Negative
Command
Command
P
S1
S2
D
S1
S2
D
D
+/ D
D+, D
D+P, D P
indicates an instruction symbol of .
+1
123456 (BIN)
b0b16 b15
+1
567890 (BIN)
b31
+1
691346 (BIN)
D
b0b16 b15b31 b0b16 b15b31
S1 S1
S2 S2
D
Since bit 31 value is "0",
result of operation takes a positive value.
Since bit 31 value is "1",
result of operation takes a negative value.
K2147483647
(7FFFFFFFH)
K 2147483648
(80000000H)
+K2
(00000002
H)
+K 2
(FFFFFFFEH)
K2
147483647
K2
147483646
(7FFFFFFEH)
(80000001
H)