![Atmel SAM4S Series Preliminary Data Sheet Download Page 149](http://html1.mh-extra.com/html/atmel/sam4s-series/sam4s-series_preliminary-data-sheet_3003408149.webp)
149
11100B–ATARM–31-Jul-12
SAM4S Series [Preliminary]
11.6.6.12
SDIV and UDIV
Signed Divide and Unsigned Divide.
Syntax
SDIV{cond} {Rd,} Rn, Rm
UDIV{cond} {Rd,} Rn, Rm
where:
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.
Restrictions
Do not use SP and do not use PC
.
Condition Flags
These instructions do not change the flags.
Examples
SDIV
R0, R2, R4
; Signed divide, R0 = R2/R4
UDIV
R8, R8, R1
; Unsigned divide, R8 = R8/R1
cond
is an optional condition code, see
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.
Summary of Contents for SAM4S Series
Page 44: ...44 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Page 412: ...412 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Page 1105: ...1105 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Page 1143: ...1143 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 4 64 lead LQFP Package Drawing ...
Page 1145: ...1145 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 5 64 lead QFN Package Drawing ...