Skip to main content
Engineering LibreTexts

4.5: Machine Code for the sll Instruction

  • Page ID
    27117
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    This section will translate the following SLL instruction to machine code.

    sll $t0, $t1, 10
    

    The MIPS Greensheet specifies the sll instruction as an R-format instruction and the op- code/function for the sll as 0/00. This means the 6 bits for the op code are 000000 and the 6 bits for the function are 000000.

    Register rd is $t0 is also register $8, or 01000.

    Register rs is not used.

    Register rt is $t1 is also register $9, or 01001.

    The shamt is 10, or 0x01010.

    The Result is the following R-format instruction.

    Figure 4-7: Machine code for sll $t0, $t1, 10

    Screen Shot 2020-06-29 at 8.05.35 PM.png


    This page titled 4.5: Machine Code for the sll Instruction is shared under a CC BY 4.0 license and was authored, remixed, and/or curated by Charles W. Kann III.

    • Was this article helpful?