Chapter 6 Instruction Details
XBC E-Type Main Unit
6-177
Ver. 1
6.29.2 SUBB, SUBBP, DSUBB, DSUBBP
Instruction
Area Available
Step
Flag
P M K F L T C S Z D.x R.x
Co
nst.
U N D R
Error
(F110)
Zero
(F111)
Carry
(F112)
SUBB(P)
DSUBB(P)
S1 O O O O O O O - O -
- O O O O O
4~6
O
O
O
S2 O O O O O O O - O -
- O O O O O
D O O O - O O O - O -
-
- O O O O
Operand
Description
Data Type
S1
BCD data to be subtracted from S2
WORD/DWORD
S2
BCD data to be subtracted from S1
WORD/DWORD
D
Address to save operation result in
WORD/DWORD
[Flag Set]
Flag
Description
Device
Number
Error
If the value of S1 and S2 is not of BCD format.
F110
Zero
To be set if operation result is Set.
F111
Carry
To be set if operation result is Set.
F112
1) SUBB (BCD Subtract)
(1) Saves the result of BCD data S1 minus S2 in D.
(2) Based on operation result, Error(F110), Zero(F111) or Carry(F112) Flag will be set.
(3) If its result is Underflow, 9999 will be set, and Carry Flag will not be ON.
0
6
7
8
D
0
2
3
4
S
2
0
4
4
4
D
-
Other places than specified will be regarded as 0
2) DSUBB (BCD Double Subtract)
(1) Saves the result of BCD data (S1 ,S1+1) minus (S2, S1+1) in (D, D+1).
(2) 0~99,999,999 (BCD 8-digit) is available for S1 and S2.
(3) If its result is Underflow, 99999999 will be set, and Carry Flag will not be ON.
0 9
8
7
1 0
6
8
0 0
3
2
3 4
5
6
0 9
7
4
7 6
1
2
+
D 1
D
Upper 4-digit
Lower 4-digit
+
S 1
S
Upper 4-digit
Lower 4-digit
-
+
D 1
D
Upper 4-digit
Lower 4-digit
Other places than specified will be regarded as 0
3) Program Example
(1) For P1000=’200’ and P1100=’100’, Input Signal P00000 is changed from Off to On, BCD data ‘100’ is
saved in P1200.
SUBB P1000 P1100 P1200
P00000
SUBB,DSUBB
P S1 S
2
SUBBP, DSUBBP
S1 S2
means
S3
S3
Summary of Contents for XBC-DN10E
Page 1: ......
Page 10: ...Table of Contents Table of Contents 6 10 10 CLEAR ALL PLC 29...