title: saving a string of chars in assembly LC-3
body: <p>I am trying to make a simple program using the LC-3 Architecture.
  All I am trying to do is read a string from the console, somehow save it in memory, and then print it back out.</p>
  
  <p>This is what I have so Far</p>
  
  <pre><code>; This program attemps to read a string and then output it
  
          .orig   x3000
          and     r1,r1,0
      lea     r0,prompt 
      puts
  loop:
      getc
      putc
      add r4,r4,1
      ld      r7,nlcomp  ; check for 
      add     r7,r7,r0   ; end of line
  
  brz finish
  
      st  r0,lets
      br      loop
  
  finish:
  
      lea r0,lets
      puts
  
      halt
  
  lets:  .blkw   20   
  prompt: .stringz "Emter String"
  nlcomp  .fill   xfff6        
  .end
  </code></pre>
  
  <p>The output displays only the last char in the string. If I was to enter "steve" it would  print out "e"</p>
  
  <p>Obviously my problem is that I need to somehow save each char I read in, into its own memory location. I thought using the .blkw would do this, but apparently all it does it overwrite the bits that are in that position.</p>
  
  <p>MY question is how do I store chars in sequential memory locations and then print them out to the console?</p>