DL06 Micro PLC User Manual, 3rd Edition, Rev. E
5-96
Chapter 5: Standard RLL Instructions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
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 the accumulator is divided
by the value in V1420 and V1421 using the Divide Double instruction. The first part of the
quotient resides in the accumulator and the remainder resides in the first stack location. The
value in the accumulator is copied to V1500 and V1501 using the Out Double instruction.
DIVD
A aaa
Handheld Programmer Keystrokes
LDD
V1400
X1
Load the value in V1400 and
V1401 into the accumulator
DIVD
V1420
The value in the accumulator
is divided by the value in
V1420 and V1421
OUTD
V1500
Copy the value in the
accumulator to V1500
and V1501
0000003
0000150
0
(Accumulator)
(V1421 and V1420)
0
?
0
1
50 0000
0
V1500
V1400
0
000
V1401
V1501
0003
0000050
0000000 0
First stack location contains
the remainder
The unused accumulator
bits are set to zero
Acc.
STR
$
SHFT
ANDST
L
3
D
SHFT
3
D
8
I
AND
V
OUT
GX
SHFT
0
A
ENT
1
B
ENT
2
C
ENT
0
A
3
D
ENT
1
B
4
E
0
A
0
A
1
B
4
E
3
D
1
B
5
F
0
A
POP
Retrieve the remainder
OUTD
V1502
Copy the value into
V1502 and V1503
Operand Data Type DL06 Range
A
aaa
V-memory V See memory map
Pointer P See memory map
Discrete Bit Flags Description
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.
DS Used
HPP Used
DirectSOFT
Divide Double (DIVD)
Divide Double is a 32-bit instruction that divides the BCD
value in the accumulator by a BCD value (Aaaa), which must
be obtained from two consecutive V-memory locations. (You
cannot use a constant as the parameter in the box.) The first part
of the quotient resides in the accumulator and the remainder
resides in the first stack location.