Shal - 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.84

SHAL

One-Bit Left
Arithmetic Shift
Format
SHAL Rn
Description
This instruction arithmetically shifts the contents of general register Rn one bit to the left, and
stores the result in Rn. The bit shifted out of the operand is transferred to the T bit.
SHAL
Operation
SHAL(long n) /* SHAL Rn (Same as SHLL) */
{
if ((R[n]&0x80000000)==0) T=0;
else T=1;
R[n]<<=1;
PC+=2;
}
Example
SHAL
R0
SHift Arithmetic Left
Summary of Operation
T ← Rn ← 0
MSB
T
;Before execution R0 = H'80000001, T = 0
;After execution
Instruction Code
0100nnnn00100000 1
LSB
R0 = H'00000002, T = 1
Rev. 2.0, 03/99, page 357 of 396
Shift Instruction
Execution
States
0
T Bit
MSB

Advertisement

Table of Contents
loading

Table of Contents