title: LC-3 left-shift and store left-shifted bits
body: <p>I am working on the following code to left shift the value in R0 - which I am sure will work. Also, as R0 is left-shifted, the value of the bit which gets removed should be stored in R2. I am not sure if what I am doing is correct for this. </p>
  
  <p>Also, MASK .FILL x8000 does not seem to work. My LC-3 simulator returns an error. It states "invalid instruction. RTI executed with user mode privilege."</p>
  
  <pre><code>.ORIG x3000
  
  LD R0 X
  AND R2 R2 0
  LD R3 MASK 
  LD R1 N
  BRZ done
  loop
  AND R2 R0 R3 ;store leftmost digit of R0 into R2
  ADD R0 R0 R0 ;left shift R0
  ADD R1 R1 -1 
  BRP loop
  done .FILL x0000
  
  MASK .FILL x8000
  X .FILL xFFFF
  N .FILL 5 ;amount of times of leftshifts
  .END
  </code></pre>