title: LC3, Store a Value of a Register to a Memory Location
body: <p>I'm attempting  to write a short LC-3 program that initializes R1=5, R2=16 and computes the sum of R1 and R2 and put the result in memory x4000. The program is supposed to start at x3000. Unfortunately, I have to write it in binary form.</p>
  
  <p>This is what I have so far...</p>
  
  <p>.orig x3000__________; Program starts at x3000</p>
  
  <p>0101 001 001 1 00000 ;R1 &lt;- R1 AND x0000</p>
  
  <p>0001 001 001 1 00101 ;R1 &lt;- R1 + x0005</p>
  
  <p>0101 010 010 1 00000 ;R2 &lt;- R2 AND x0000</p>
  
  <p>0001 010 010 1 01000 ;R2 &lt;- R2 + x0008</p>
  
  <p>0001 010 010 1 01000 ;R2 &lt;- R2 + x0008</p>
  
  <p>0001 011 010 0 00 001 ;R3 &lt;- R2 + R1</p>
  
  <p>//This last step is where I'm struggling...
  I was thinking of using ST, and I figured PCOFFSET9 to be 994, but I can't represent that using 8 bits... so how else would I do this? Is my code inefficient?</p>
  
  <p>0011 011 </p>