
DR
AFT
DR
AFT
DRAFT
DR
D
RAFT
DRAFT
DRA
FT DRAF
D
RAFT DRAFT DRAFT DRAFT DRAFT D
DRAFT
D
RAFT DRA
FT DRAFT DRAFT DRAFT DRA
UM10360_0
© NXP B.V. 2009. All rights reserved.
User manual
Rev. 00.06 — 5 June 2009
666 of 808
NXP Semiconductors
UM10360
Chapter 34: Appendix: Cortex-M3 User Guide
2.6.3 SDIV and UDIV
Signed Divide and Unsigned Divide.
2.6.3.1
Syntax
SDIV{
cond
} {
Rd
,}
Rn
,
Rm
UDIV{
cond
} {
Rd
,}
Rn, Rm
where:
cond
is an optional condition code, see
Section 34–2.3.7 “Conditional execution”
.
Rd is the destination register. If
Rd
is omitted, the destination register is
Rn
.
Rn
is the register holding the value to be divided.
Rm
is a register holding the divisor.
2.6.3.2
Operation
SDIV
performs a signed integer division of the value in
Rn
by the value in
Rm
.
UDIV
performs an unsigned integer division of the value in
Rn
by the value in
Rm
.
For both instructions, if the value in
Rn
is not divisible by the value in
Rm
, the result is
rounded towards zero.
2.6.3.3
Restrictions
Do not use SP and do not use PC.
2.6.3.4
Condition flags
These instructions do not change the flags.
2.6.3.5
Examples
SDIV
R0, R2, R4
; Signed divide, R0 = R2/R4
UDIV
R8, R8, R1
; Unsigned divide, R8 = R8/R1