6 BASIC INSTRUCTIONS
6.2 Arithmetic Operation Instructions
257
6
■BK-
• Subtracts n points of BIN data from the device designated by (S1) and n-points of BIN data from the device designated by
(S2) and stores the result to the area starting from the device designated by (D).
• Block subtraction is performed in 16-bit units.
• The constant designated by (S2) can be between -32768 and 32767 (BIN 16-bit data).
• 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.
• In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and an error code is stored into SD0.
Error
code
Error details Q00J/
Q00/
Q01
QnH QnPH QnPRH QnU LCPU
4101 The points specified in n exceed those of the corresponding device specified
in (S1), (S2), or (D).
The ranges of devices starting from the one specified in (S1) and (D) overlap
by n points. (except when the same device is specified in (S1) and (D)).
The ranges of devices starting from the one specified in (S2) and (D) overlap
by n points. (except when the same device is specified in (S2) and (D)).
(BIN)
(BIN)
(BIN)
b15 b0
1234
5678
9876
(BIN)4321
(BIN)4000
(BIN)
(BIN)
(BIN)
b15 b0
7531
3210
551
(BIN)679
(BIN)352
(BIN)
(BIN)
(BIN)
b15 b0
8765
8888
9325
(BIN)5000
(BIN)4352
+1
+2
+(n 2)
+(n 1)
n
S1
S2
D
S1
S1
S1
S1
+1
+2
+(n 2)
+(n 1)
S2
S2
S2
S2
n
+1
+2
+(n 2)
+(n 1)
n
D
D
D
D
(BIN)
b15 b0
8880
(BIN)
(BIN)
(BIN)
b15 b0
8
445
(BIN)
(BIN)
(BIN)
(BIN)
(BIN)
b15 b0
8765
8888
9325
(BIN)5000
(BIN)
4352
+1
+2
+(n 2)
+(n 1)
n
S1
S2
D
S1
S1
S1
S1
+1
+2
+(n 2)
+(n 1)
n
D
D
D
D
115
4528
3880
K 32768
(8000
H
)
K32767
(7FFF
H
)
K
2
K2
K32766
32767
(0002
H
)
(8001
H
)(FFFE
H
)
(7FFE
H
)