Thank you barts

[EMAIL PROTECTED]:/tmp 75% ld -o hello hello.o -lc
[EMAIL PROTECTED]:/tmp 77% gcc -o hello hello.o -lc

This helps me to avoid Segmentation fault
The funny thing is that if I use int $0x91 syscall method i don't get seg fault!

-bash-3.00# cat h.s
.text
.globl _start
_start:
pushl %ebp
movl %esp,%ebp

pushl $len
pushl $msg
pushl $1
pushl $0
movl $4,%eax
int $0x91

addl $16,%esp
pushl $1
pushl $0
xorl %eax,%eax
movl $1,%eax
int $0x91

.data
msg: .string "Hello world\n"
     len = .-msg
-bash-3.00# as h.s
-bash-3.00# ld -o h h.o
-bash-3.00# ./h
Hello world
-bash-3.00# 

And what assembler should i use,  /usr/ccs/bin/as  or  /usr/sfw/bin/gas?What is 
better?
This message posted from opensolaris.org
_______________________________________________
opensolaris-discuss mailing list
[email protected]

Reply via email to