title: LC3 Assembly Bitwise Right Shift
body: <p>What I need to do it implement both a bitwise left shift, and a bitwise right shift using <a href="http://highered.mcgraw-hill.com/sites/dl/free/0072467509/104653/PattPatelAppA.pdf" rel="noreferrer">LC-3 Assembly</a>.  Basically, every bit has to be moved over one space in the direction of the shift, and a zero fills the empty space created.</p>
  
  <p>Examples:</p>
  
  <p>Right Shift:</p>
  
  <pre><code> 01001001
   00100100→
  </code></pre>
  
  <p>Left Shift:</p>
  
  <pre><code> 01001001
  ←10010010
  </code></pre>
  
  <p>I've successfully implemented a left shift, by taking the binary string, and adding it to itself.</p>
  
  <p>I'm stumped on how to perform a right shift.  Any thoughts would be greatly appreciated.  I have AND, NOT, ADD operations, data movement operations, seven registers to store values and whole range of memory. I just need some basic ideas how it could be implemented.</p>
  
  <p>If you need a LC-3 Instruction Set reference, there is <a href="http://highered.mcgraw-hill.com/sites/dl/free/0072467509/104653/PattPatelAppA.pdf" rel="noreferrer">one here</a>.</p>