title: Reversing the bits of a number in MIPS assembly
body: <p>I'm learning the MIPS assembly language and I'm being asked to write a program which does the following:</p>
  <ol>
  <li>Accept an integer as user input</li>
  <li>Print that integer as a signed binary number</li>
  <li>Reverse the bits in that integer</li>
  <li>Print the resulting reversed number (also in binary)</li>
  </ol>
  <p>Beyond the fact that I obviously need to use shift operations and a logical comparison between two shifted values, I'm pretty lost. My idea was to write a loop that would place the least significant bit of the input integer in a temporary register, shift that value left by 1, shift the input integer right by one, and repeat the process until the input integer is equal to 0. I'm just not sure how to &quot;take&quot; one bit of a number... can someone help me out here?</p>