Renesas R8C/Tiny Series Software Manual page 130

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

Advertisement

Chapter 3
Functions
ROT
[ Syntax ]
ROT.size
src,dest
[ Operation ]
[ Function ]
• This instruction rotates
(MSB) are transferred to MSB (LSB) and the C flag.
• The direction of rotation is determined by the sign of
bits are rotated right.
src
• If
is an immediate value, the number of bits rotated is –8 to –1 or +1 to +8. Values less than –8, equal
to 0, or greater than +8 are not valid.
src
• If
is a register and (.B) is selected as the size specifier (.size), the number of bits rotated is –8 to +8.
Although a value of 0 may be set, no bits are rotated and no flags are changed. If a value less than –8 or
greater than +8 is set, the result of the rotation is undefined.
src
• If
is a register and (.W) is selected as the size specifier (.size), the number of bits rotated is –16 to +16.
Although a value of 0 may be set, no bits are rotated and no flags are changed. If a value less than –16 or
greater than +16 is set, the result of the rotation is undefined.
[ Selectable src/dest ]
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
src
*1 If
is R1H, R1 or R1H cannot be chosen for
*2 The acceptable range of values is –8 < #IMM < +8. However, 0 is invalid.
[ Flag Change ]
Flag
U
I
O
Change
Conditions
S :
The flag is set when the operation results in MSB = 1; otherwise cleared.
Z :
The flag is set when the operation results in 0; otherwise cleared.
C :
The flag is set when the bit shifted out last is 1; otherwise cleared.
[ Description Example ]
ROT.B
#1,R0L
ROT.B
#–1,R0L
ROT.W
R1H,R2
[ Related Instructions ]
Rev.2.00 Oct 17, 2005
REJ09B0001-0200
B , W
C
MSB
dest
left or right the number of bits indicated by
src
R1L/R2
R1H
[A0]
[A1]
dsp:8[SB]
dsp:8[FB]
dsp:16[SB]
abs16
abs20
#IMM
A1A0
B
S
Z
D
C
ROLC, RORC, SHA, SHL
page 112 of 263
Rotate
ROTate
[ Instruction Code/Number of Cycles ]
src<0
LSB
dest
src>0
src
src
. If
is positive, bits are rotated left; if negative,
*1
/R3
R0L/R0
R0H/R1
A0/A0
A1/A1
dsp:8[A0]
dsp:8[A1]
dsp:16[A0] dsp:16[A1] dsp:16[SB] abs16
*2
dsp:20[A0] dsp:20[A1] abs20
R2R0
R3R1
dest
.
*1 If the number of bits rotated is 0, no flags are changed.
; Rotated left
; Rotated right
3.2
ROT
Page: 220
C
src
. Bits overflowing from LSB
dest
*1
R1L/R2
R1H/R3
[A0]
[A1]
dsp:8[SB]
dsp:8[FB]
A1A0
Functions
*1

Advertisement

Table of Contents
loading

Table of Contents