151
FNC
21
X Y M S
D.b R.b
KnX KnY
KnM KnS
T C
D,R
V,Z
UnG
K,H
E
" $"
S1
S2
D
1
2
M
3
○ ○ ○○
D S U B P
S1
S2
D
S1 : the minuend
S2 : the subtrahend
D : the difference
When X20 = “OFF” → “ON”, the subtrahend (D1) will be subtracted from the minuend (D0), and the difference will
be stored at the destination device (D2).
When the result of an operation stores in the and it is equal to “0”, the Addition / Subtraction Zero Flag M9020
turns “ON”.
When the result of an operation exceeds 32,767, the Carry Flag M9022 turns “ON”.
When the result of an operation is less than -32,768, the Borrow Flag M9021 turns“ON”.
When X20 = “ON”, the instruction will subtract (D3, D2) from (D1, D0) and store the difference in (D5, D4).
D0
D1
D2
10
5
5
(D1, D0)
(D3, D2)
(D5, D4)
100,000
100,100
SUBP D0 D1 D2
X20
S1
S2
D
D
DSUBP D0 D2 D4
X20
S1 S2
D
When the result of an operation stores in the and it is equal to “0”, the Addition / Subtraction Zero Flag M9020
turns “ON”.
When the result of an operation exceeds 2,147,483,647, the Carry Flag M9022 turns “ON”.
When the result of an operation is less than -2,147,483,648, the Borrow Flag M9021 turns “ON”.
D
100
Operand
Devices
Subtraction (S1) – (S2) → (D)
16-bit Operation
32-bit Operation