English
Language : 

SH-2A Datasheet, PDF (257/501 Pages) Renesas Technology Corp – Renesas 32-Bit RISC Microcomputer SuperH™ RISC engine Family
6.4.47
ROTR
One-Bit Right
Rotation
ROTate Right
Section 6 Instruction Descriptions
Shift Instruction
Format
ROTR Rn
Abstract
LSB → Rn → T
Code
0100nnnn00000101
Cycle
1
T Bit
LSB
Description
Rotates the contents of general register Rn to the right by one bit, and stores the result in Rn
(figure 6.6). The bit that is shifted out of the operand is transferred to the T bit.
ROTR
MSB
LSB
T
Figure 6.6 Rotate Right
Operation
ROTR(long n) /* ROTR Rn */
{
if ((R[n]&0x00000001)==0) T=0;
else T=1;
R[n]>>=1;
if (T==1) R[n]|=0x80000000;
else R[n]&=0x7FFFFFFF;
PC+=2;
}
Examples:
ROTR R0
; Before execution: R0 = H'00000001, T = 0
; After execution: R0 = H'80000000, T = 1
Rev. 3.00 Jul 08, 2005 page 243 of 484
REJ09B0051-0300