Divide (DIV)
Divide is a 16-bit instruction that divides the BCD value in
230
the accumulator by a BCD value (Aaaa), which is either a
240
V-memory location or a 4-digit (max.) constant. The first
250-1
part of the quotient resides in the accumulator and the
remainder resides in the first stack location.
260
Operand Data Type
A
V-memory
V
All (See page 3 - 53)
Pointer
P
Constant
K
Discrete Bit Flags
SP53
SP63
SP70
SP75
NOTE: The status flags are only valid until another instruction that uses the same flags is executed.
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 the accumulator will be divided by the
value in V2006 using the Divide instruction. The value in the accumulator is copied to
V2010 using the Out instruction.
DS
Used
DirectSOFT
HPP Used
X1
Handheld Programmer Keystrokes
$
STR
SHFT
SHFT
GX
OUT
DL230 Range
DL240 Range
aaa
All (See page 3 - 54)
All V-memory
-
(See page 3 - 54)
1-9999
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.
LD
V2000
Load the value in V2000 into
the lower 16 bits of the
accumulator
DIV
V2006
The value in the
accumulator is divided by
the value in V2006
OUT
V2010
Copy the value in the lower
16 bits of the accumulator to
V2010
B
ENT
1
L
D
C
A
ANDST
3
2
0
D
I
V
C
3
8
AND
2
V
C
A
SHFT
AND
2
0
Chapter 5: Standard RLL Instructions - Math
DL250-1 Range
aaa
aaa
All (See page 3 - 55)
All V-memory
(See page 3 - 55)
1-9999
1-9999
Description
V2000
5
0
0
0
The unused accumulator
bits are set to zero
0
0
0
0
5
0
0
0
÷
5
0
Acc.
1
0
0
1
0
0
V2010
A
A
ENT
0
0
A
A
G
ENT
0
0
6
B
A
ENT
1
0
DL205 User Manual, 4th Edition, Rev. B
DIV
A aaa
DL260 Range
aaa
All (See page 3 - 56)
All V-memory
(See page 3 - 56)
1-9999
(Accumulator)
(V2006)
0
0
0
0
0
0
0
0
First stack location contains
the remainder
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
5–97
Need help?
Do you have a question about the DirectLOGIC DL205 Series and is the answer not in the manual?