DL205 User Manual, 4th Edition, Rev. B
5–112
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 Formatted (DIVF)
Divide Formatted is a 16-bit instruction that divides the BCD
value in the accumuator by the BCD value (Aaaa), a range of
discrete bits. The specified range (Kbbb) can be 1 to 16
consecutive bits. The first part of the quotient resides in the
accumulator and the remainder resides in the first stack
location.
NOTE:
Status flags are valid only until another instruction uses the same flag.
In the following example, when X6 is on, the value formed by discrete locations X0–X3 is
loaded into the accumulator using the Load Formatted instruction. The value in the
accumulator is divided by the value formed by discrete location C0–C3 using the Divide
Formatted instruction. The value in the lower four bits of the accumulator is copied to
Y10–Y13 using the Out Formatted instruction.
ý
ý
ý
þ
230
240
2
5
0
-1
2
6
0
DIVF
A aaa
K bbb
LDF
X0
K4
X6
Load the value represented
by discrete locations X0--X3
into the accumulator
DIVF
C0
K4
Divide the value in the
accumulator with the value
represented by discrete
location C0--C3
OUTF
Y10
K4
Copy the lower 4 bits of the
accumulator to discrete
locations Y10--Y13
0 4
0 0 0 0
0
0 0 0
0
0
0 0 0 8
(C0--C3)
(Accumulator)
2
X0
X1
X2
X3
OFF
OFF
OFF
ON
C0
C1
C2
C3
OFF
ON
OFF
OFF
Y10
Y11
Y12
Y13
OFF
OFF
ON
OFF
The unused accumulator
bits are set to zero
0 0 0
0 0 0 0
0
First stack location contains
the remainder
Acc.
Handheld Programmer Keystrokes
STR
$
SHFT
8
I
AND
V
OUT
GX
SHFT
5
F
0
A
4
E
ENT
6
G
ENT
1
B
4
E
0
A
ENT
SHFT
ANDST
L
3
D
0
A
4
E
ENT
5
F
5
F
3
D
NEXT
NEXT
NEXT
NEXT
_..
Direct
SOFT
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.
Operand Data Type
DL260 Range
A
aaa
bbb
Inputs X
0-1777
-
Outputs Y
0-1777
-
Control Relays C
0-3777
-
Stage Bits S
0-1777
-
Timer Bits T
0-377
-
Counter Bits CT
0-377
-
Special Relays SP
0-777
-
Global I/O GX/GY
0-3777
-
Constant K
-
1-16
DS
Used
HPP Used