Renesas R8C/Tiny Series Software Manual page 87

16-bit single-chip microcomputer
Hide thumbs Also See for R8C/Tiny Series:
Table of Contents

Advertisement

Chapter 3
Functions
DIVX
[ Syntax ]
DIVX.size
src
[ Operation ]
If the size specifier (.size) is (.B)
R0L (quotient), R0H (remainder)
If the size specifier (.size) is (.W)
R0 (quotient), R2 (remainder)
[ Function ]
• This instruction divides R2R0 (R0)
remainder in R2 (R0H)
"*1"
*1
by
( )
indicate registers that are the object of the operation when (.B) is selected as the size specifier (.size).
src
• If
is A0 or A1 and the selected size specifier (.size) is (.B), the operation is performed on the 8 low-
order bits of A0 or A1.
• If (.B) is selected as the size specifier (.size), the O flag is set when the operation results in a quotient
exceeding 8 bits or the divisor is 0. At this time, R0L and R0H are undefined.
• If (.W) is selected as the size specifier (.size), the O flag is set when the operation results in a quotient
exceeding 16 bits or the divisor is 0. At this time, R0 and R2 are undefined.
[ Selectable src ]
R0L/R0
R0H/R1
A0/A0
A1/A1
dsp:8[A0]
dsp:8[A1]
dsp:16[A0] dsp:16[A1]
dsp:20[A0] dsp:20[A1]
R2R0
R3R1
[ Flag Change ]
U
I
O
Flag
Change
Conditions
O :
The flag is set when the operation results in a quotient exceeding 16 bits (.W) or 8 bits (.B) or the
divisor is 0; otherwise cleared.
[ Description Example ]
DIVX.B
A0
DIVX.B
#4
DIVX.W
R0
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
DIVide eXtension
R2R0
*1
by the signed value of
*1
. The remainder has the same sign as the divisor. Items in parentheses and followed
src
R1L/R2
R1H/R3
[A0]
[A1]
dsp:8[SB]
dsp:8[FB]
dsp:16[SB]
abs16
abs20
#IMM
A1A0
B
S
Z
D
C
DIV, DIVU, MUL, MULU
page 69 of 263
Signed divide
[ Instruction Code/Number of Cycles ]
B , W
R0
src
src
src
and stores the quotient in R0 (R0L)
;Value of 8 low-order bits of A0 is the divisor.
3.2 Functions
DIVX
Page: 172
*1
and the

Advertisement

Table of Contents
loading

Table of Contents