Download Instructions & Programming

Transcript
Chapter 5. Application instructions
5.9.2
SUBB, SUBBP, DSUBB, DSUBBP
SUBB
FUN(134)
SUBB
FUN(136)
(BCD subtraction)
FUN(135)
SUBBP FUN(137)
M
P
K
L
F
T
C
S1
O
O
O O
O
O
S2
O
O
O O
O
D
O
O
O O*
DSUBB(P)
Applicable
All CPUs
CPU
DSUBBP
Flag
Available Device
Instructions
SUBB(P)
DSUBB
S1
S2
S
D
#D Integer
O
O
O
O
O
O
O
O
O
O
O
O
O
Zero
(F111)
Carry
(F112)
7/9/11
O
O
O
S1
The device storing minuend
S2
The device storing
subtrahend
D
The device at which the
subtraction result is stored
DSUBB
S2
Error
(F110)
Operand setting
D
SUBB
S1
Steps
D
SUBBP
DSUBBP
* Available only when do not use computer link module or data link module
1)
Functions
SUBB(P) : Performs the subtraction of 16-bits BCD data specified at [ S1 ] and [ S2 ]. The
subtraction result is stored at the device specified at [ D ].
DSUBB(P) : Performs the subtraction of 32-bits BCD data specified at [ S1+1, S1 ] and [ S2+1, S2 ].
The subtraction result is stored at the device specified at [ D1+1, D1 ].
When the minuend is less than subtrahend, the LSB will underflow, and the carry flag (F112) will be
set.
When the subtraction result is 0, the zero flag is set.
If indirect address specified by #D format is out of device range or contents of [ S1 ] and [ S2 ] are
invalid BCD format (out of 0 ~ 9), the operation error occurs and the error flag (F110) is set.
5-58