15
15 – 62
Syntax:
SR = [SR OR] LSHIFT xop BY <exp>
(HI) ;
(LO)
Permissible xops
<exp>
SI
MR0
Any constant between –128 and 127*
SR1
MR1
SR0
MR2
AR
Example:
SR = LSHIFT SR1 BY –6 (HI) ;
Description:
Logically shifts the bits of the operand by the amount and
direction specified by the constant in the exponent field. Positive constants
cause a left shift (upshift); negative constants cause a right shift
(downshift). A positive constant must be entered without a “+” sign.
The shift may be referenced to the upper half of the output field (HI
option) or to the lower half (LO option). The shift output may be logically
ORed with the contents of the SR register by selecting the SR OR option.
For LSHIFT with a positive shift constant, the operand is shifted left. The
32-bit output field is zero-filled to the left and from the right. Bits shifted
out of the high order bit in the 32-bit destination field (SR
31
) are dropped.
For LSHIFT with a negative shift constant, the operand is shifted right.
The 32-bit output field is zero-filled from the left and to the right. Bits
shifted out of the low order bit are dropped.
To shift a double precision number, the same shift constant is used for
both parts of the number. On the first cycle, the upper half of the number
is shifted using the HI option; on the following cycle, the lower half is
shifted using the LO and OR options.
* See Table 2.4 in Chapter 2.
Status Generated:
None affected.
Instruction Format:
Shift Immediate Operation, Instruction Type 15:
23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 0 0 0 1 1 1 1 0 SF Xop <exp>
SF
Shifter Function
0 0 0 0
LSHIFT (HI)
Xop: Shifter Operand
0 0 0 1
LSHIFT (HI, OR)
0 0 1 0
LSHIFT (LO)
<exp>: 8-bit signed shift value
0 0 1 1
LSHIFT (LO, OR)
SHIFTER
LOGICAL SHIFT IMMEDIATE