
7700 FAMILY SOFTWARE MANUAL
4–40
DIV
Divide
DIV
Function
:
Division (Unsigned)
Operation
:
A(quotient), B(remainder)
←
(B, A) / M
When m=0
A
,
B
B
A
M(n+1,n)
Quotient
Remainder
←
Dividend
÷
Divisor
When m=1
A
L
B
L
B
L
A
L
M(n)
Quotient
,
Remainder
←
Dividend
÷
Divisor
Description
:
When the data length selection flag m is set to 0, a 32-bit data stored in the accumulators B
(upper 16 bits) and A (lower 16 bits) are divided by a 16-bit data in memory. The quotient
is placed in the accumulator A, and the remainder is placed in the accumulator B.
When the data length selection flag m is set to 1, a 16-bit data stored in the lower 8 bits of
the accumulators B (upper 8 bits) and A (lower 8 bits) are divided by an 8 bit data in memory.
The quotient is placed in the lower 8 bits of the accumulator A, and the remainder is placed
in the lower 8 bits of the accumulator B.
If an overflow occurs as a result of the operation, the V flag is set and the content of the
accumulator is unpredictable.
When divisor is 0, the zero division interrupt is generated, in which case the contents of the
program bank register, program counter, and processor status register are saved on the stack
and a branch occurs to the address in bank-0 as specified by the zero division interrupt vector.
Accumulator contents are not changed. In this case, the content of the accumulator is
unchanged.
Status flags
IPL
N
:
:
Not affected.
Set to 1 when bit 15 (or bit 7 if the data length selection flag m is set to 1) of quotient from
the operation is 1. Otherwise, cleared to 0.
E
When an overflow occurs as a result of the operation or divisor is 0, N flag is not affected.
Clear to 0.
E
Set to 1 when an overflow occurs
V
:
E
Not affected when divisor is 0
Not affected.
Not affected.
Not affected.
Not affected.
m
x
D
I
:
:
:
:
Z
:
Set to 1 when the quotient from the operation is 0. Otherwise, cleared to 0. No changes occur
when divisor is 0.
E
When an overflow occurs as a result of the operation or divisor is 0, Z flag is not affected.
Clear to 0.
E
Set to 1 when an overflow occurs
E
Not affected when divisor is 0
C
: