title: x86 assembly create Win32 executable NASM
body: <p>I want to create a valid Win32 executable, that can be run as standalone application.</p>
  
  <p>For example, this simple program:</p>
  
  <pre><code>bits 32
  mov eax,1
  ret
  </code></pre>
  
  <p>I compiled it using NASM with</p>
  
  <pre><code>nasm test.asm -o test.exe
  </code></pre>
  
  <p>Then I ran that program.
  It started NTVDM and it told me <em>"The NTVDM CPU encountered illegal instruction"</em> and some technical details, probably dump, and registers.</p>
  
  <p>So, I want to create a standalone Win32 application in assembly language. I don't want to create COM file, like in DOS.</p>