25.04.2020 Views

1989_MELPS_7700_Software_Manual

Mitsubishi MELPS 7700 series microcomputer instruction set and addressing mode handbook

Mitsubishi MELPS 7700 series microcomputer instruction set and addressing mode handbook

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

DIV Divide DIV

Operation

B(remainder}, A(quotient} ~ (B, A) / M

If m=O

B A M(n+1} M(n} A B

Dividend + ! Divisor ! ~ Quotient Remainder

If m=1

BL

AL

Dividend + I Quotient I ! Remainder!

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.

When an overflow results from this operation negrect removed out, the V flag is

set.

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-O as specified by the zero division interrupt vector.

Accumulator contents are not changed.

Status flags

IPL

N

v

m

x

D

I

Z

c

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 O.

Set to 1 when the quotient from the operation exceeds 16 bits (or 8 bits if the data

length selection flag m is set to 1) (I.e., an overflow has occurred). Otherwise,

cleared to O. No changes occur when divisor is O.

Not affected.

Not affected.

Not affected.

Not affected.

Set to 1 when the quotient from the operation is O. Otherwise, cleared to O. No

changes occur when divisor is O.

Set to 1 when the quotient from the operation exceeds 16 bits (or 8 bits if the data

length selection flag m is set to 1) (I.e., an overflow has occurred). Otherwise,

cleared to O. No changes occur when divisor is O.

86

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!