Chapter 5: Standard RLL Instructions - Math
Divide by Top of Stack (DIVS)
1
Divide Top of Stack is a 32-bit instruction that divides the
230
8-digit BCD value in the accumulator by a 4-digit BCD
240
value in the first level of the accumulator stack. The result
2
250-1
resides in the accumulator and the remainder resides in the
first level of the accumulator stack.
260
3
Discrete Bit Flags
SP53
4
SP63
SP70
5
SP75
NOTE: Status flags are valid only until another instruction uses the same flag.
6
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
7
DS
Used
instruction, pushing the value previously loaded in the accumulator onto the accumulator
HPP Used
stack. The BCD value in the accumulator is divided by the BCD value in the first level of the
8
accumulator stack using the Divide Stack instruction. The Out Double instruction copies the
value in the accumulator to V1500 and V1501.
9
DirectSOFT
X1
10
11
12
13
14
A
Handheld Programmer Keystrokes
$
STR
B
SHFT
SHFT
C
SHFT
GX
OUT
D
5–116
DL205 User Manual, 4th Edition, Rev. B
On when the value of the operand is larger than the accumulator can work with.
On when the result of the instruction causes the value in the accumulator to be zero.
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 into
LD
the accumulator
V1400
Load the value V1420 and
LDD
V1421 into the accumulator
V1420
Divide the value in the
DIVS
accumulator by the value in
the first level of the
accumulator stack
Copy the value in the
OUTD
accumulator to V1500
V1500
and V1501
B
ENT
1
L
D
B
E
A
ANDST
3
1
4
L
D
D
B
E
ANDST
3
3
1
D
I
V
S
ENT
3
8
AND
RST
D
B
F
A
SHFT
3
1
5
Description
0
The unused accumulator
bits are set to zero
0
0
0
0
0
Acc.
V1421
0
0
5
0
0
0
0
5
0
0
Acc.
0
0
0
2
5
Acc.
0
0
0
2
5
V1501
A
ENT
0
0
C
A
ENT
4
2
0
A
ENT
0
0
DIVS
V1400
Accumulator stack
after 1st L DD
0
2
0
Level 1
X
X
Level 2
X
X
0
2
0
Level 3
X
X
Level 4
X
X
V1420
Level 5
X
X
0
0
0
Level 6
X
X
Level 7
X
X
Level 8
X
X
0
0
0
Accumulator stack
after 2nd L DD
0
0
0
Level 1
0
0
X
X
Level 2
Level 3
X
X
X
X
Level 4
Level 5
X
X
0
0
0
X
X
Level 6
V1500
Level 7
X
X
X
X
Level 8
The remainder resides in the
first stack location
Level 1
0
0
X
X
Level 2
Level 3
X
X
X
X
Level 4
Level 5
X
X
X
X
Level 6
Level 7
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
X
X
X
X X
X
X
X
0
0 0
0
2
0
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
X
X
0
0 0
0
0
0
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
X
X
Need help?
Do you have a question about the DirectLOGIC DL205 Series and is the answer not in the manual?