Basic Function Instruction
6-33
FUN 16 D P
(-1)
DECREMENT
(Subtracts 1 from the D value)
FUN 16 D P
(-1)
Operand
D : The register to be decreased
D may combine with V, Z, P0~P9 to
serve indirect addressing
WY WM WS TMR CTR HR OR HR HSCR RTCR SR ROR DR
XR
Range
Ope-
rand
WY0
∣
WY240
WM0
∣
WM1896
WS0
∣
WS984
T0
∣
T255
C0
∣
C255
R0
∣
R3839
R3904
∣
R3919
R3920
∣
R4047
R4096
∣
R4127
R4128
∣
R4135
R4136
∣
R4167
R5000
∣
R8071
D0
∣
D4095
V、 Z
P0~P9
D ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○* ○* ○
○
Description
● Subtracts 1 from the register D when the decrement control input "EN" =1 or "EN↑" ( P instruction) from 0
to 1. If the value of D is already at the lower limit of negative number -32768 or -2147483648, subtracting
one from this value will change it to the upper limit of positive number 32767 or 2147483647. At the same
time, the underflow flag FO0 (UDF) is set to 1.
Example 16-bit decrement register
Ladder diagram Key operations Mnemonic code
X0
EN
16P.
(-1)
R 0
UDF
ORG
ORG X 0
FUN 16P
D : R 0
D R0 0
Ø
X0=
D
R0 -1