Chapter 5: Standard RLL Instructions
Subtract (SUB)
1
1
Subtract is a 16 bit instruction that subtracts the BCD value (Aaaa) in
DS5
Used
a V-memory location from the BCD value in the lower 16 bits of the
2
2
HPP
Used
accumulator. The result resides in the accumulator.
3
3
⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠A
V-memory ⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠V
4
4
Pointer ⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠⸠P
Discrete Bit Flags
5
5
6
6
7
7
NOTE: The status flags are only valid until another instruction that uses the same flags is executed.
8
8
In the following example, when X1 is on, the value in V2000 will be loaded into the accumulator
using the Load instruction. The value in V2006 is subtracted from the value in the accumulator
9
9
using the Subtract instruction. The value in the accumulator is copied to V2010 using the Out
instruction.
10
10
DirectSOFT
11
11
Direct SOFT32
12
12
13
13
14
14
A
a
b
B
Handheld Programmer Keystrokes
C
c
$
STR
SHFT
D
D
SHFT
GX
OUT
5-70
DL05 Micro PLC User Manual, 6th Edition, Rev. D
Operand Data Type
SP63
On when the result of the instruction causes the value in the accumulator to be zero.
SP64
On when the 16 bit addition instruction results in a borrow
SP65
On when the 32 bit addition instruction results in a borrow
SP70
On anytime the value in the accumulator is negative.
SP75
On when a BCD instruction is executed and a NON–BCD number was encountered.
X1
LD
V2000
Load the value in V2000 into
the lower 16 bits of the
accumulator
SUB
V2006
Subtract the value in V2006
from the value in the lower
16 bits of the accumulator
OUT
V2010
Copy the value in the lower
16 bits of the accumulator to
V2010
B
ENT
1
L
D
C
ANDST
3
S
U
B
RST
ISG
1
V
C
SHFT
AND
Description
The unused accumulator
bits are set to zero
0
_
Acc.
A
A
A
ENT
2
0
0
0
V
C
A
SHFT
AND
2
A
B
A
ENT
2
0
1
0
SUB
DL05 Range
aaa
See memory map
See memory map
V2000
2
4
7
5
0
0
0
2
4
7
5
(Accumulator)
1
5
9
2
(V2006)
0
8
8
3
0
8
8
3
V2010
A
G
ENT
0
0
6
A aaa
Need help?
Do you have a question about the DL05 and is the answer not in the manual?