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 #333 background imageLoading...
Page #333 background image
DL205 User Manual, 4th Edition, Rev. B
5–116
Chapter 5: Standard RLL Instructions - Math
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
Divide by Top of Stack (DIVS)
Divide Top of Stack is a 32-bit instruction that divides the
8-digit BCD value in the accumulator by a 4-digit BCD
value in the first level of the accumulator stack. The result
resides in the accumulator and the remainder resides in the
first level of the accumulator stack.
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X1 is on, the Load instruction loads the value in V1400 into
the accumulator. The value in V1420 is loaded into the accumulator using the Load Double
instruction, pushing the value previously loaded in the accumulator onto the accumulator
stack. The BCD value in the accumulator is divided by the BCD value in the first level of the
accumulator stack using the Divide Stack instruction. The Out Double instruction copies the
value in the accumulator to V1500 and V1501.
ý
ý
ý
þ
230
240
250-1
260
DIVS
Discrete Bit Flags Description
SP53 On when the value of the operand is larger than the accumulator can work with.
SP63 On when the result of the instruction causes the value in the accumulator to be zero.
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.
LD
V1400
X1
Load the val ue in V1400 i nto
the accumulator
LDD
V1420
Load the value V1420 and
V1421 into the accumulator
OUTD
V1500
Copy the value i n the
accum ul ator to V1500
and V1501
XXXXXXXXLevel 1
XXXXXXXXLevel 2
XXXXXXXXLevel 3
XXXXXXXXLevel 4
XXXXXXXXLevel 5
XXXXXXXXLevel 6
XXXXXXXXLevel 7
XXXXXXXXLevel 8
00000 020Level 1
XXXXXXXX
Level 2
XXXXXXXXLevel 3
XXXXXXXX
Level 4
XXXXXXXXLevel 5
XXXXXXXX
Level 6
XXXXXXXXLevel 7
XXXXXXXX
Level 8
DIVS
Divide the value in the
accumulator by the value in
the first level of the
accumulator stack
Acc.
V1400
0020
0000 0 020
Acc.
V1420
0000
0050 0000
Accum ulator stack
after 1st L DD
Accum ulator stack
after 2nd L DD
Acc.
0002 5000
0002 5000
V1500V1501
The unused accum ulator
bits are set to zero
Handheld Programmer Keystrokes
SHFT
ANDST
L
3
D
STR
$
SHFT
3
D
8
I
AND
V
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
RST
S
ENT
3
D
V1421
0050
00000 000Level 1
XXXXXXXX
Level 2
XXXXXXXXLevel 3
XXXXXXXX
Level 4
XXXXXXXXLevel 5
XXXXXXXX
Level 6
XXXXXXXXLevel 7
XXXXXXXX
Level 8
The remainder resides in the
first stack location
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