sra $dest, $src1, $src2

Arithmetic shift the contents of a register right by a variable amount.

Format

This is an RR format instrucion.
31 - 26
25 - 21
20 - 16
15 - 11
10 - 0
111001
dest
src1
src2
00000000000

Functional Description

The sra instruction performs an arithmetic right shift of the contents of register src1 and stores the shifted value in register dest. The shift amount is taken from the contents of register src2 & 0x1f. The most significant bit of src1 is replicated and replaces empty bits from the left.

dest = (signed) src1 >> (src2 & 0x1f);

Side Effects

None

Processor Mode

This is a user-level instruction.


Last modified: Fri Feb 23 02:56:04 CST 2001