next up previous
Next: Branch Instructions Up: Registers and MAL Previous: Arithmetic and Logical Instructions

Shift Instructions

The MAL shift instructions are equivalent to the SAL shift instructions except that the operands are specified by registers and there are no rotate instructions in MAL.

The MAL shift instructions have the general form:

displaymath254

where S is a general register whose contents are shifted by AMT bits with the result placed in the general register D. For example,

        sll     $8, $9, 5

performs a logical left shift of 5 bits on the contents of $9, placing the results in register $8.

The shift value, AMT, can also be specified as a register. In this case, the five least significant bits of the register are taken as an unsigned integer specifying the shift.

When AMT is a constant and D is the same as S, then S may be omitted.

tabular110

Notes:

  1. D is a general register where the result is placed.
  2. S is a general register.
  3. AMT is either a general register or a constant.
  4. When AMT is a constant and S is omitted, S is the same as D.
  5. Superscripts indicate repetitions of a binary value.
  6. Subscripts indicate bit positions (Little-Endian) of sub-field.



CS301 Class Account
Thu Nov 21 23:32:28 AST 1996