Next: Shift Right Single Up: Insert Character Previous: Shift Right Double

Shift Right Single

The integer part of the first operand is shifted right the number of bits specified by the second-operand address. Bits 16-19 of the instruction are ignored. The second-operand address is not used to address data; its low-order six bits indicate the number of bit positions to be shifted. The remainder of the address is ignored. The sign of the first operand remains unchanged. All 31 integer bits of the operand participate in the right shift. Bits equal to the sign are supplied to the vacated high-order bit positions. Low-order bits are shifted out without inspection and are lost.

Resulting Condition Code:
0 ~ Result is zero
1 ~ Result is less than zero
2 ~ Result is greater than zero
3 ~ -

Program Exceptions:
None

Programming Note
A right shift of one bit position is equivalent to division by two with rounding downward. When an even number is shifted right one position, the value of the field is that obtained by dividing the value by 2. When an odd number is shifted right one position, the value of the field is that obtained by dividing the next lower number by two. For example, +5 shifted right by one bit position yields +2, whereas -5 yields -3.

Shift amounts from 31-63 cause the entire integer to be shifted out of the register. When the entire integer field of a positive number has been shifted out, the register contains a value of zero. For a negative number, the register contains a value of -1.



Next: Shift Right Single Up: Insert Character Previous: Shift Right Double


A.Daviel,TRIUMF