Automationdirect.com DirectLOGIC DL205 Series User Manual page 331

Table of Contents

Advertisement

Chapter 5: Standard RLL Instructions - Math
Subtract Top of Stack (SUBS)
1
Subtract Top of Stack is a 32-bit instruction that subtracts
230
the BCD value in the first level of the accumulator stack
240
from the BCD value in the accumulator. The result resides in
2
250-1
the accumulator. The value in the first level of the
accumulator stack is removed and all stack values are moved
260
3
up one level.
Discrete Bit Flags
4
SP63
SP64
5
SP65
SP70
SP75
6
NOTE: Status flags are valid only until another instruction uses the same flag.
7
In the following example, when X1 is on, the value in V1400 and V1401 will be loaded into
the accumulator using the Load Double instruction. The value in V1420 and V1421 is
DS
Used
8
loaded into the accumulator using the Load Double instruction, pushing the value previously
HPP Used
loaded into the accumulator onto the accumulator stack. The BCD value in the first level of
the accumulator stack is subtracted from the BCD value in the accumulator using the
9
Subtract Stack instruction. The value in the accumulator is copied to V1500 and V1501
using the Out Double instruction.
10
DirectSOFT
X1
11
12
13
14
A
B
Handheld Programmer Keystrokes
$
STR
C
SHFT
SHFT
D
SHFT
GX
OUT
5–114
DL205 User Manual, 4th Edition, Rev. B
On when the result of the instruction causes the value in the accumulator to be zero.
On when the 16-bit subtraction instruction results in a borrow.
On when the 32-bit subtraction instruction results in a borrow.
On anytime the value in the accumulator is negative.
On when a BCD instruction is executed and a NON-BCD number was encountered.
Load the value in V1400 and
LDD
V1401 into the accumulator
V1400
Load the value in V1420 and
LDD
V1421 into the accumulator
V1420
Subtract the value in the first
SUBS
level of the accumulator
stack from the value in the
accumulator
Copy the value in the
OUTD
accumulator to V1500
V1500
and V1501
B
ENT
1
L
D
B
D
ANDST
3
3
1
L
D
D
B
ANDST
3
3
1
U
B
S
S
SHFT
RST
ISG
1
RST
D
B
F
SHFT
3
1
5
Description
V1401
0
0
1
7
0
0
1
7
Acc.
V1421
0
0
3
9
0
0
3
9
Acc.
0
0
2
2
Acc.
0
0
2
2
V1501
E
A
A
ENT
4
0
0
E
C
A
ENT
4
2
0
ENT
A
A
ENT
0
0
S UBS
V1400
2
0
5
6
Accumulator stack
after 1st LDD
Level 1
X
X X
2
0
5
6
Level 2
X
X X
Level 3
X
X X
Level 4
X
X X
V1420
5
0
2
6
Level 5
X
X X
Level 6
X
X X
Level 7
X
X X
5
0
2
6
Level 8
X
X X
2
9
7
0
Accumulator stack
after 2nd LDD
Level 1
0
0
X
X X
Level 2
2
9
7
0
Level 3
X
X X
X
X X
V1500
Level 4
Level 5
X
X X
X
X X
Level 6
Level 7
X
X X
X
X X
Level 8
X X
X X
X
X X
X X
X
X X
X X
X
X X
X X
X
X X
X X
X
X X
X X
X
X X
X X
X
X X
X X
X
1
7
2
0
5
6
X X
X X
X
X X
X X
X
X X
X X
X
X X
X X
X
X X
X X
X
X X
X X
X
X X
X X
X

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DirectLOGIC DL205 Series and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents

Save PDF