Shlr - Hitachi SH7750 Programming Manual

High-performance risc engine superh (sh) 32-bit risc mcu/mpu series
Hide thumbs Also See for SH7750:
Table of Contents

Advertisement

10.89

SHLR

One-Bit Right
Logical Shift
Format
SHLR
Rn
Description
This instruction logically shifts the contents of general register Rn one bit to the right, and stores
the result in Rn. The bit shifted out of the operand is transferred to the T bit.
SHLR
Operation
SHLR(long n)
{
if ((R[n]&0x00000001)==0) T=0;
else T=1;
R[n]>>=1;
R[n]&=0x7FFFFFFF;
PC+=2;
}
Example
SHLR
R0
Rev. 2.0, 03/99, page 364 of 396
SHift Logical Right
Summary of Operation
0 → Rn → T
MSB
0
/* SHLR Rn */
;Before execution R0 = H'80000001, T = 0
;After execution
Shift Instruction
Instruction Code
0100nnnn00000001 1
LSB
R0 = H'40000000, T = 1
Execution
States
T Bit
LSB
T

Advertisement

Table of Contents
loading

Table of Contents