Motorola MPC823e Reference Manual page 1207

Microprocessor for mobile computing
Table of Contents

Advertisement

divw
Assembler Syntax
BIT
0
1
2
FIELD
31
BIT
16
17
18
FIELD
B
Definition
Operation
Description
MOTOROLA
divw
rD,rA,rB (OE = 0 Rc = 0)
divw.
rD,rA,rB (OE = 0 Rc = 1)
divwo
rD,rA,rB (OE = 1 Rc = 0)
divwo.
rD,rA,rB (OE = 1 Rc = 1)
3
4
5
6
7
19
20
21
22
23
OE
Divide Word
dividend ← ( r A)
divisor ← ( r B)
r D ← dividend ÷ divisor
The dividend is the contents of r A. The divisor is the contents of
r B. The 32-bit quotient is formed and placed in r D. The
remainder is not supplied as a result.
Both the operands and the quotient are interpreted as signed
integers. The quotient is the unique signed integer that satisfies
the equation—dividend = (quotient * divisor) + r where 0 ≤ r <
|divisor| (if the dividend is non-negative), and –|divisor| < r ≤ 0 (if
the dividend is negative).
If an attempt is made to perform any of the divisions—
0x8000_0000 ÷ –1or <anything> ÷ 0—then the contents of r D
are undefined, as are the contents of the LT, GT, and EQ bits of
the CR0 field (if Rc = 1). In this case, if OE = 1 then OV is set.
The 32-bit signed remainder of dividing the contents of rA by the
contents of rB can be computed as follows, except in the case
that the contents of rA = –231 and the contents of rB = –1.
divw
r D ,r A ,r B
mullw
r D ,r D ,r B
subf
r D ,r D ,r A
MPC823e REFERENCE MANUAL
MPC823e Instruction Set—divw
8
9
10
11
12
D
24
25
26
27
28
491
# r D = quotient
# r D = quotient ∗ divisor
# r D = remainder
13
14
15
A
29
30
31
RC
B-49

Advertisement

Table of Contents
loading

Table of Contents