DL205 User Manual, 4th Edition, Rev. D
5-106
Chapter 5: Standard RLL Instructions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
Divide Binary (DIVB)
The Divide Binary instruction divides a 16-bit number
(Aaaa) into the value stored in the accumulator. The number
in the accumulator can be up to 32 bits long. The source of
the 16-bit divisor can be a constant or a data value located
in V-memory. Divide Binary performs the division operation on the full binary representation
of the operands, which distinguishes it from the Divide instruction (see page 5-97), which
treats the operands as BCD numbers. Although the division operation is performed on the
underlying binary values, the native display format is hexadecimal. For that reason you will
need to load constants in hex.
At the completion of the division operation, the quotient resides in the accumulator and the
remainder resides in the first stack location.
The quotient occupies the full 32-bit accumulator and requires an Out Double to move the
quotient to V-memory. If the value in the accumulator occupies fewer than 32 bits, leading
zeros are loaded in the left-most empty bit positions.
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 will be loaded into the accumulator
using the Load instruction. The binary value in the accumulator is divided by the binary value
in V1420 using the Divide Binary instruction. The value in the accumulator is copied to
V1500 using the Out Double instruction.
230
240
250-1
260
DIVB
A aaa
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
V1500
0
(Accumulator)F
0
0
F
(V1420)
0
V1400
A01
320
000 A0 1
05 0
320
Theunusedaccumulator
bits areset to zero
00 10000 0
STR1
D 140 0
OUT
V1500
14 0
D
2
SHFT B
SHFT
ENT
SHFT
LENT
IV
ENT
ENT
_
.
.
0000
0000
V1501
FA01 (Hex) = 64001 (decimal)
50 (Hex) = 80 (decimal)
320 (Hex) = 800 (decimal)
1 (Hex) = 1 (decimal)
(Accumulator)
Top of stack holds remainder
LD
V1400
X1
DIVB
V1420
Thebinar yval ue in the
accumulatorisdivided by
thebinaryval ue in V1420
OUT
V1500
Copy thevalue in thelow er 16
bits of theaccumulatortoV1500