title: Stuck with scanf in assembly
body: <p>I am new to assembly and made a program which will read values from keyboard . I used scanf function for this purpose .I am calling scanf function in loop so as I can input multiple values.But issue is I am not able to limit values entered by the keyboard.Below is the code</p>
  
  <p>Now I wanted to input four values from scanf but it keep on asking the values from user.</p>
  
  <pre><code>  section .bss
    c1 dd
    b dd
    section .data
    x db "%d",10,0
    y db "number is =%d",10,0
    section .text
  global main
  extern printf
  extern scanf
  
  
  main:
  mov edx,0
  loop_done:
  mov [b],edx
  lea ebx ,[c1]
  push ebx
  push x
  call scanf
  mov edx,[b]
  push dword [c1]
  cmp edx,3
  inc edx
  jnz loop_done
  push y
  call printf
  
  
  add esp,16
  
  ret
  </code></pre>