EasyManuals Logo

Automationdirect.com DirectLOGIC DL205 Series User Manual

Automationdirect.com DirectLOGIC DL205 Series
587 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #331 background imageLoading...
Page #331 background image
DL205 User Manual, 4th Edition, Rev. B
5–114
Chapter 5: Standard RLL Instructions - Math
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
Subtract Top of Stack (SUBS)
Subtract Top of Stack is a 32-bit instruction that subtracts
the BCD value in the first level of the accumulator stack
from the BCD value in the accumulator. The result resides in
the accumulator. The value in the first level of the
accumulator stack is removed and all stack values are moved
up one level.
NOTE: Status flags are valid only until another instruction uses the same flag.
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
loaded into the accumulator using the Load Double instruction, pushing the value previously
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
Subtract Stack instruction. The value in the accumulator is copied to V1500 and V1501
using the Out Double instruction.
ý
ý
ý
þ
230
240
250-1
260
S UB S
Discrete Bit Flags Description
SP63 On when the result of the instruction causes the value in the accumulator to be zero.
SP64 On when the 16-bit subtraction instruction results in a borrow.
SP65 On when the 32-bit subtraction 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.
LDD
V1400
X1 Load the value i n V1400 and
V1401 i nto the accumulator
LDD
V1420
Load the val ue in V1420 and
V1421 i nto the accumulator
OUTD
V1500
Copy the value i n the
accum ul ator to V1500
and V1501
XXX XXXXXLevel 1
XXX XXXXXLevel 2
XXX XXXXXLevel 3
XXX XXXXXLevel 4
XXX XXXXXLevel 5
XXX XXXXXLevel 6
XXX XXXXXLevel 7
XXX XXXXXLevel 8
001 72056Level 1
XXX XXXXX
Level 2
XXX XXXXXLevel 3
XXX XXXXX
Level 4
XXX XXXXXLevel 5
XXX XXXXX
Level 6
XXX XXXXXLevel 7
XXX XXXXX
Level 8
SUBS
Subtr act the value i n the first
level of the accumulator
stack from the value i n the
accum ul ator
Acc.
V1400
2056
0017 2056
V1401
0017
Acc.
V1420
5026
0039 5026
V1421
0039
Accum ulator stack
after 1st LD D
Accum ulator stack
after 2nd LDD
Acc.
0022 2970
0022 2970
Handheld Programmer Keystrokes
SHFT
ANDST
L
3
D
STR
$
SHFT
ISG
U
1
B
OUT
GX
SHFT
3
D
1
B
5
F
0
A
0
A
ENT
1
B
ENT
1
B
4
E
0
A
0
A
ENT
ENT
SHFT
ANDST
L
3
D
1
B
4
E
2
C
0
A
ENT
3
D
RST
S
3
D
RST
S
SHFT
V1501 V1500
DirectSOFT
DS Used
HPP Used

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

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

Automationdirect.com DirectLOGIC DL205 Series Specifications

General IconGeneral
BrandAutomationdirect.com
ModelDirectLOGIC DL205 Series
CategoryController
LanguageEnglish

Related product manuals