title: How to load input from keyboard into an array in 8086?
body: <p>I am practicing Input and Output of strings in assembly language - <code>8086</code> environment. I came across the following code:</p>
  
  <pre><code> org 100h
  
   .DATA
  
   SNAME DB 21,0,22 DUP('$')
   .CODE
  
   MOV AH, 0AH
   LEA DX, SNAME  
  
   INT 21H
   MOV AH, 9H
   LEA DX, SNAME +2;
   INT 21H
   ret
  </code></pre>
  
  <p>I know the program accepts input as a string from the keyboard and displays it on the screen. <strong>However,I am  missing two things here</strong>:</p>
  
  <ol>
  <li><p>How do we tell that the user input is to be <strong>stored</strong> in variable <code>SNAME</code>? Does the instruction <code>LEA</code> make the program know that? I have asked this because in high level languages we could say <code>SNAME=someUserInput;</code> - here I am not seeing an <code>MOV SMANE,someUserInput;</code></p></li>
  <li><p>Why are we adding <code>2</code> in this instaruction <code>LEA DX,SNAME +2</code>?</p></li>
  </ol>