Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Nov 2002 15:24:43 -0800
From:      Naydoe Maung <nyingelay@hotpop.com>
To:        FreeBSD Questions <freebsd-questions@FreeBSD.ORG>
Subject:   NASM (BSD vs. Linux)
Message-ID:  <200211041524.43350.nyingelay@hotpop.com>

index | next in thread | raw e-mail

- FreeBSD 4.7-RELEASE #0: i386
- NASM version 0.98.33 compiled on Oct 31 2002
- Linux driver already loaded

Simple assembly code for Hello World:
==================
SECTION .data
msg     DB      "Hello, World!", 0Ah, 0Ah
MSGLEN  EQU     14

SECTION .text
global _start
_start:
        mov     eax, 4
        mov     ebx, 1
        mov     ecx, msg
        mov     edx, MSGLEN
        int     80h

        mov     eax, 4
        mov     ebx, 1
        mov     ecx, msg
        mov     edx, MSGLEN
        int     80h

        mov     eax, 4
        mov     ebx, 1
        mov     ecx, msg
        mov     edx, MSGLEN
        int     80h
==================

Shell output:

bash-2.05b$ nasm -f elf hello.asm
bash-2.05b$ ld -o hello hello.o
bash-2.05b$ ./hello
bash-2.05b$ ls
hello           hello.asm       hello.o
bash-2.05b$
==================

As you can see here, It compiled and linked without any errors, however no 
appropriate output is being generated.  There were no problems running it on 
Linux.  I heard some issues about different sys calls and interrupts on Linux 
and BSD, but I thought since the Linux driver was loaded there should be no 
problems running Linux oriented programs.  I'm very confused, and I'm sure 
I'm missing out some stuff.  Help me please.

Thank You


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



help

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