
7751 SERIES 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
Quotient
,
Remainder
←
s
E
s means a sign bit that is the most significant bit of the data
B
L
B
L
A
L
M(n)
Dividend
÷
Divisor
s
s
s
Description
:
When the data length flag is “0”, a signed 32-bit data stored in the accumulator B, which
indicates its higher 16 bits, and A, which indicates its lower 16 bits, is divided by a signed 16-
bit data in a memory. The quotient is placed in the accumulator A, and the remainder is placed
in the accumulator B. Each of them is a signed 16-bit data.
When the data length flag is “1”, a signed 16-bit data is are divided by a signed 8-bit data in
a memory. The lower 8 bits of the accumulator B indicate the higher 8 bits of the 16-bit data,
and the lower 8 bits of the accumulator A indicate the lower 8 bits of the16-bit data. 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. Each of them is a signed 8-bit data.
The sign of remainder becomes same as that of dividend.
If an overflow occurs as a result of the operation, in other words, the quotient exceeds the
range –32767 to +32767 when m = “0”, or –127 to +127 when m = “1”; the operation finishes
halfway and the overflow flag is set to “1”. Additionally, the contents of the accumulators A and
B become undefined.
When the divisor is “0”, the zero divide interrupt is generated. In that case, the contents of the
program bank register, program counter, and processor status register are saved on the stack
and a branch is generated to the address in bank 0 which is specified by the zero divide
interrupt vector. The contents of the accumulators A and B are not changed.
Status flags
IPL
N
:
:
Not affected.
Set to “1” when bit 15 (or bit 7 when the data length flag is “1”) of the operation quotient is
“1”. Otherwise, cleared to “0”.
E
When an overflow occurs as a result of the operation or the divisor is “0”, N flag is not affected.
Cleared to “0”.
V
:
E
Set to “1” when an overflow occurs
E
Not affected when the divisor is “0”
Not affected.
Not affected.
Not affected.
m
x
D
:
:
:
I
:
Not affected.
E
Set to “1” when the divisor is “0”