title: LC-3 STR with R1 as offset
body: <p>I'm having trouble getting this subroutine I'm writing to work. Basically, I am trying to have a subroutine where I would set <code>R0</code> to a value in some <code>array (R3)</code> with an offset of <code>R1</code>.</p>
  
  <pre><code>R0_ORIGINAL .FILL 0
  R1_ORIGINAL .FILL 0
  R2_ORIGINAL .FILL 0
  R3_ORIGINAL .FILL 0
  
  LOAD
          ST R0, R0_ORIGINAL
          ST R1, R1_ORIGINAL
          ST R2, R2_ORIGINAL
          ST R3, R3_ORIGINAL
  
          AND R0, R0, #0
          ADD R0, R0, R2
          BRz SKIP
          AND R3, R3, #0
          LD R3, FIFTY
          ADD R1, R1, R3
  SKIP    AND R3, R3, #0
          LEA R3, CIPHER_ARRAY
          STR R0, R3, R1
          LD R0, R0_ORIGINAL
          LD R1, R1_ORIGINAL
          LD R2, R2_ORIGINAL
          LD R3, R3_ORIGINAL
          RET
  
  CIPHER_ARRAY .BLKW #100
  FIFTY .FILL #50
  </code></pre>
  
  <p>This is the line I'm trying to get to work :</p>
  
  <pre><code>STR R0, R3, R1
  </code></pre>
  
  <p>It gives me the error :</p>
  
  <blockquote>
    <p>Expected 6 bit signed number, but found 'R1' instead.</p>
  </blockquote>
  
  <p>Any help would be appreciated!</p>