title: assembly code on Windows 8 x64
body: <p>I'm new to hardware near programming with assembly code. So I read a book about it and found this sample code for the NASM assembler:</p>
  
  <pre><code>segment .text                               ;code segment
  global main                                 ;must be declared for linker
  main:                                       ;tell linker entry point
  mov edx,len                                 ;message length
  mov ecx,msg                                 ;message to write
  mov ebx,1                                   ;file descriptor (stdout)
  mov eax,4                                   ;system call number (sys_write)
  int 0x80                                    ;call kernel
  mov eax,1                                   ;system call number (sys_exit)
  int 0x80                                    ;call kernel
  
  segment .data                               ;data segment
  msg db 'Hello, world!',0xa                  ;our dear string
  len equ $ - msg                             ;length of our dear string
  </code></pre>
  
  <p>So I compiled it with the following commands:</p>
  
  <pre><code>nasm -f elf64 helloworld.asm
  ld -s -o helloworld.exe helloworld.o
  </code></pre>
  
  <p>The assembler has no problem to assemble it and gives no errors, but the program crashes instantly. I read about different assembly-languages, but the point is that the assembly-code varies with different compilers not with different operating systems, so where is my mistake?</p>