Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Nov 2009 15:08:44 -0500
From:      David Jackson <djackson452@gmail.com>
To:        freebsd-questions@freebsd.org
Subject:   Problems with freebsd assembly
Message-ID:  <4AFB19CC.9090407@gmail.com>

next in thread | raw e-mail | index | archive | help
I am having great difficulty running a very simple assembler program on 
FreeBSD on x86 in my efforts to learn some assembly programming on 
FreeBSD.  I have tried to compile the following with nasm, however i get 
nothing in response when I attempt to run this program:

       section .data
       hello   db      'Hello, World!', 0xa
       hbytes  equ     $ - hello

       section .text
       global  _start
       _start:
       push    dword hbytes
       push    dword hello
       push    dword 1
       mov eax,0x4
       int 0x80
       add esp,12

       push    dword 0
       mov eax,0x1
       int 0x80

nasm -f elf -o hello1s.o hello1.s
ld -s -o hello1s hello1s.o

./hello1s prints nothing.

What is wrong here? It should print "hello world".
Thanks in advance for   your help, it is greatly appreciated.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4AFB19CC.9090407>