title: cannot run executable made by nasm in windows 7
body: <p>i am using windows 7 for learning assembly language.I am using NASM for creating object files and mingw for creating executable files.</p>
  
  <p>i am using the following commands for compile and run executable files</p>
  
  <pre><code>del hello.o
  del hello.exe
  nasm -f elf hello.asm
  ld hello.o -o hello.exe
  hello
  </code></pre>
  
  <p>while running the hello.exe file,an error message showing "hello.exe has stoped working"</p>
  
  <p>while using the following command</p>
  
  <pre><code>    nasm -f bin hello.asm -o program.exe
  </code></pre>
  
  <p>i have got an error shown below</p>
  
  <p><img src="https://i.stack.imgur.com/kuvGz.png" alt="enter image description here"></p>
  
  <p>my program code </p>
  
  <pre><code>global _start            ; global entry point export for ld
  section .text
  _start:
  ; sys_write(stdout, message, length)
  mov eax, 4        ; sys_write syscall
  mov ebx, 1        ; stdout
  mov ecx, message    ; message address
  mov edx, length        ; message string length
  int 80h
  ; sys_exit(return_code)
  mov eax, 1        ; sys_exit syscall
  mov ebx, 0        ; return 0 (success)
  int 80h
  section .data
  message: db 'Hello, world!',0x0A    ; message and newline
  length: equ $-message            ; NASM definition pseudo-instruction
  </code></pre>