
7700 FAMILY SOFTWARE MANUAL
4–42
Function
:
Division (Signed)
Operation
:
A(quotient), B(remainder)
←
(B, A) / M
When m=0
A
,
s
s
B
B
A
M(n+1,n)
Quotient
Remainder
←
Dividend
÷
Divisor
DIVS
Divide with Sign
DIVS
s
s
When m=1
A
L
B
L
B
L
A
L
M(n)
Quotient
,
Remainder
←
s
s
E
“s” means a sign bit that is the most significant bit of the data
Dividend
÷
Divisor
s
s
Description
:
When the data length selection flag m is set to 0, a signed 32-bit data stored in the
accumulators B (upper 16 bits) and A (lower 16 bits) are divided by a signed 16-bit data in
memory. As a result of the operation, the quotient is stored in accumulator A and the
remainder is stored in accumulator B as signed 16-bit data.
When the data length selection flag m is set to 1, a signed 16-bit data stored in the lower 8
bits of the accumulators B (upper 8 bits) and A (lower 8 bits) are divided by a signed 8 bit data
in memory. As a result of the operation, the quotient is stored in low-order 8 bits of
accumulator A and the remainder is stored in low-order 8 bits of accumulator B as signed 8-
bit data.
The sign of remainder becomes same as dividend.
When an overflow results from this operation (the quotient exceeds the extent –32767 to
+32767 if m=0 or –127 to +127 if m=1) neglect removed out, the V flag is set. In this case,
the content of the accumulator is unpredictable.
When divisor is 0, the zero division interrupt is generated, in which case the contents of the
processor status register are saved on the stack and a branch occurs to the address in bank
0
16
as specified by the zero division interrupt vector. And accumulator contents are not
changed.
Status flags
IPL
:
Not affected.
N
:
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
E
Not affected when divisor is 0
V
:
m
x
D
I
:
:
:
:
Not affected.
Not affected.
Not affected.
Not affected.
E
Set to 1 when divisor is 0
This instruction can be used
in the
7750 Series
only.