Chapter 6 Instruction Details
XBC E-Type Main Unit 6-139 Ve r. 1
6.24.6 DECU, DECUP, DDECU, DDECUP
Instruction
Step
P M K F L T C S Z D.x
R.x
U N D R
D O O O - O O O - O - - - O O O O 2/3 - O O
Data address to perform operation.
[Flag Set]
To be set if (D)DEC(P) is executed when D is 1.
To be set when D is 0 ~ hFFFF.
1) DECU (Decrement)
(1) Saves the result of D minus 1 and it save in D again.
(2) D is processed as Unsigned operation.
(3) If DECU(P) is executed when D is 0(h0000), 65,535(hFFFF) will be output, and Carry Flag will be set.
(4) If (D)DECU(P) is executed when D is 1, 0 will be output, and Zero Flag will be set.
2) DDECU (Double Decrement)
(1) It saves the result of D, D+1 minus 1 again in D, D+1.
(2) D is processed as Unsigned operation.
(3) If (D)DECU(P) is executed when D, D+1 is 1, 0 will be output and Zero Flag will be set.
(4) If DDECU(P) is executed when D, D+1 is 0(h00000000), 4,294,967,295(hFFFFFFFF) will be output and
Carry Flag will be set.
3) Program Example
(1) If P1000=100, when Input Signal P00000 is repeated changing to On from Off status, the saved value in
P1000 is decreased 1.