title: Printing argv[0] in nasm/Windows?
body: <p>With online help, I was able to write <a href="https://github.com/mcandre/scriptname/blob/master/nasm/freebsd/scriptname.asm" rel="nofollow">nasm code</a> in Mac OS X resulting in an executable that prints its own filename, <code>argv[0]</code> in equivalent C code. When I use the same code in Windows, I want it to print the programs name:</p>
  
  <pre><code>C:\&gt; nasm -f win32 -o scriptname.obj scriptname.asm
  C:\&gt; golink /fo scriptname.exe scriptname.obj /console kernel32.dll Msvcrt.dll
  
  GoLink.Exe Version 0.27.0.0 - Copyright Jeremy Gordon 2002/12 - JG@JGnet.co.uk
  Output file: scriptname.exe
  Format: win32 size: 2,048 bytes
  C:\&gt; scriptname.exe
  Program: scriptname.exe
  </code></pre>
  
  <p>But what it actually prints is emptiness:</p>
  
  <pre><code>C:\&gt; scriptname.exe
  Program: 
  </code></pre>
  
  <p>Specs:</p>
  
  <ul>
  <li>golink 0.27.0.0</li>
  <li>nasm 2.10.05</li>
  <li>Windows 7 Professional x64</li>
  <li>MacBook Pro 2009</li>
  </ul>