Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Nov 1999 12:16:00 -0200 (EDT)
From:      Carlos Antonio Ruggiero <toto@if.sc.usp.br>
To:        freebsd-questions@freebsd.org
Subject:   Hello World in Assembler
Message-ID:  <199911301416.MAA21566@ultra3000.if.sc.usp.br>

next in thread | raw e-mail | index | archive | help
Hi eveybody,

   I am trying to write a "hello world" program in assembler, but can't get
it right. The code is (based on The Assembly HOW-TO)

section	.data

msg	db	"Hello World!"
len	equ	$ - msg
	
section	.text
	
	global	_start
	
_start:	
	
	mov	eax,4
	mov	ebx,1
	mov	ecx,msg
	mov	edx,len
	int	0x80
	
	mov	eax,1
	xor	ebx,ebx
	int	0x80
		
	It assembles all right (using nasm -f elf -o hello.
hello.asm) and links fine (ld -o hello hello.o). However it doesn't produce
any output. 

    The same code runs fine in Linux. With different parameters, it
runs OK in DOS.

     I am running FreeBSD 3.1.

     Could anyone help me out?


Thanks a lot


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




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