title: x86 assembly - masm32: Issues with waiting for response
body: <p>I have created this program that takes two inputs and prints them out (simple, yes, but it's for practise). It compiles, and runs fine, but it doesn't do what I intended. Here is my code:</p>
  
  <pre><code>.386 
  .model flat, stdcall 
  option casemap :none 
  include \masm32\include\windows.inc 
  include \masm32\include\kernel32.inc 
  include \masm32\include\masm32.inc 
  includelib \masm32\lib\kernel32.lib 
  includelib \masm32\lib\masm32.lib
  .data 
     num1 db "Enter a number:", 0 
     num2 db "Enter another number:", 0
  .data? 
         buffer1 dd 100 dup(?)
     buffer2 dd 100 dup(?)
  .code 
  start:
     lea eax, num1
     push eax
     call StdOut
     lea ebx, buffer1
     push ebx
     call StdIn
     hlt
     lea eax, num2
     push eax
     call StdOut
     lea edx, buffer2
     push edx
     call StdIn
     xor eax, eax
     xor ebx, ebx
     xor edx, edx
     lea eax, buffer1
     push eax
     call StdOut
     lea ebx, buffer2
     push ebx
     call StdOut
     push 0 
     call ExitProcess
  end start 
  </code></pre>
  
  <p>It displays this output:</p>
  
  <pre><code>Enter a number: Enter another number:
  </code></pre>
  
  <p>It should do:</p>
  
  <pre><code>Enter a number:
  ; wait for input.
  Enter another number:
  ; wait for input.
  ; continue with program.
  </code></pre>
  
  <p>Why does it print on one line? I tried putting <code>halt</code> in there to stop the process, but Windows stops the program from running, and says <code>the program is not responding</code>. </p>
  
  <p>EDIT:</p>
  
  <p>Here is the code that I said I would edit in:</p>
  
  <pre><code>xor eax, eax
  xor ebx, ebx
  xor edx, edx
  lea eax, buffer1
  push eax
  call StdOut
  lea ebx, buffer2
  push ebx
  call StdOut
  </code></pre>
  
  <p>When I run this with the previous code, it says <code>"This program is not responding."</code> Why is this?</p>
  
  <p>Any help would be appreciated.</p>
  
  <p>Regards,</p>
  
  <p>Progrmr</p>