views:

69

answers:

1

The code i am trying to run is bellow. I use nasm util to convert it into object file. When i tried to execute it says "can not execute binary file".

I run the command: nasm -f elf -o helloworld.o helloworld.asm

segment .data
msg  db   "Hello, world!",10
len  equ  $ - msg

segment .text
global _start

_start:
   mov  eax,4
   mov  ebx,1
   mov  ecx,msg
   mov  edx,len
   int  80h

   mov  eax,1
   mov  ebx,0
   int  80h

it is my first program in assembly and i did not use ubuntu except compiling some
basic c programs. i need some help thanks all.

+7  A: 

It works perfectly for me your code.

Did you link the final object file?

Try this: ld helloworld.o -o helloworld

jyzuz
thank you that was the missing part =)
mehmet6parmak