Subject: netbsd i386 assembler
To: None <netbsd-users@netbsd.org>
From: haad <haaaad@gmail.com>
List: netbsd-users
Date: 03/10/2006 12:47:17
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

I want to write assembler aplication in netbsd but in intel syntax(it's
my school work)

so I installed nasm from pkgsrc and write this little program
section .text
        global _start


_start:
        mov eax,1
        mov ebx,0
        int 0x80
section .data

compile it with this nasm -f aoutb hello.S
and link with this   ld --oformat a.out-i386-netbsd -s -o hello hello.o

notebook> ./hello
Segmentation fault (core dumped)

if I run nasm with nasm -f elf hello.S and link it with this
		   ld  -s -o hello hello.o
notebook> ./hello
./hello: Exec format error. Binary file not executable.

>file hello
hello: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
statically linked, stripped

>file hello.o
hello.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not
stripped

I missing something ??

btw. have somebody some documentation about assembler on netbsd what I
found was only for non i386 machines(alpha)

Regards


- --
Adam Hamsik
tel.c 0904 937 495
ICQ 249727910
jabber haad@jabber.org
- --------------------------------------------------------------
There are 10 kinds of people in the world. Those who understand
binary numbers, and those who don't.
				
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (NetBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEEWdF9Wt2FT7y228RAiPLAKCmnmkIFqptCcU83BtHktSsTlA6IwCdExny
pu7kyg7IAFxJ5as0WutVGng=
=gqwZ
-----END PGP SIGNATURE-----