English
Language : 

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