6 BASIC INSTRUCTIONS
6.2 Arithmetic Operation Instructions
221
6
■-
• Subtracts 16-bit BIN data designated by (D) from 16-bit BIN data designated by (S) and stores the result of the subtraction
at the device designated by (D).
• Values for (S) and (D) can be designated between -32768 and 32767 (BIN, 16 bits).
• The judgment of whether data is positive or negative is made by the most significant bit (b15).
• 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.
• There is no operation error in the +(P) or -(P) instruction.
•0 Positive
•1 Negative
b0
5678 (BIN)
b15
b0
4444 (BIN)
b15b0
1234 (BIN)
b15
D S D
Since bit 15 value is "0",
result of operation takes a positive value.
Since bit 15 value is "1",
result of operation takes a negative value.
K32767
K2
(7FFF
H)
K 32767
K
2
K32766
(7FFE
H)
(8001
H)(FFFEH)
(8000
H) (0002H)
K
32768