DL205 User Manual, 4th Edition, Rev. B
5–120
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 Binary by Top of Stack (DIVBS)
Divide Binary Top of Stack is a 32-bit instruction that divides
the 32-bit binary value in the accumulator by the 16-bit
binary value in the first level of the accumulator stack. The
result resides in the accumulator and the remainder resides in
the first level of the accumulator stack.
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 value in V1420 and V1421 is loaded into the
accumulator using the Load Double instruction, pushing the value previously loaded in the
accumulator onto the accumulator stack. The binary value in the accumulator is divided by
the binary value in the first level of the accumulator stack using the Divide Binary Stack
instruction. The value in the accumulator is copied to V1500 and V1501 using the Out
Double instruction.
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.
LD
V1400
X1 Load the value in V1400 into
the accum ulator
LDD
V1420
Load the value in V1420 and
V1421 i nto the accumulator
OUTD
V1500
Copy the value i n the
accum ulator to V1500
and V1501
X XX XX XX XLevel 1
X XX XX XX X
Level 2
X XX XX XX XLevel 3
X XX XX XX X
Level 4
X XX XX XX XLevel 5
X XX XX XX X
Level 6
X XX XX XX XLevel 7
X XX XX XX XLevel 8
0 00 00 01 4Level 1
X XX XX XX X
Level 2
X XX XX XX XLevel 3
X XX XX XX X
Level 4
X XX XX XX XLevel 5
X XX XX XX X
Level 6
X XX XX XX XLevel 7
X XX XX XX X
Level 8
DIVBS
Divide the binar y value i n
the accum ulator by the
binary val ue in the first level
of the accumul ator stack
Acc.
0014
0000 0014
Acc.
V1420
C350
0000 C350
V1421
0000
after 1st LDD
Accumulator stack
after 2nd LDD
Acc.
0000 09C4
0000 09C4
V1500V1501
The unused accumulator
bits are set to zero
0 00 00 00 0
Level 1
X XX XX XX XLevel 2
X XX XX XX X
Level 3
X XX XX XX XLevel 4
X XX XX XX X
Level 5
X XX XX XX XLevel 6
X XX XX XX X
Level 7
X XX XX XX XLevel 8
The r em ainder resides i n the
first stack location
Handheld Programmer Keystrokes
SHFT
ANDST
L
3
D
STR
$
SHFT
3
D
8
I
AND
V
OUT
GX
SHFT
3
D
1
B
5
F
0
A
0
A
ENT
1
B
ENT
1
B
4
E
0
A
0
A
ENT
ENT
SHFT
ANDST
L
3
D
1
B
4
E
2
C
0
A
ENT
3
D
1
B
RST
S
DirectSOFT
DS Used
HPP Used