Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 01 Nov 1999 14:21:56 +0200
From:      Oren Sarig <sarig@bezeqint.net>
To:        Isaac Flemming <iflemmin@mission.mvnc.edu>, freebsd-questions@freebsd.org, freebsd-hackers@freebsd.org
Subject:   Re: NASM programs for freebsd
Message-ID:  <3.0.6.32.19991101142156.007b9e20@mail.bezeqint.net>
In-Reply-To: <Pine.GSO.3.96.991031182248.15253A-100000@mission.mvnc.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
Well, there are a few catches here.

1) You might have compiled things wrong. Try compiling it this way:
nasm -f elf -o test.o test.asm
ld -o test test.o
You can also link a gcc .o file in here

2) FreeBSD uses protected mode. DOS originally didn't, so it has backwards
compatability, but fbsd doesn't. This means you can't use BIOS and DOS
interrupts (int xx). A possible solution is to link your program to libc
and use printf functions and the like from your asm progs, though I assume
this is not what you want.

Another possible solution is to use [org 100] in the beginning of your
programs, compile them with:
nasm -f bin -o test.com test.asm
and use a DOS emulator to run the program. Or maybe just get DOS :)

--
Oren Sarig
sarig@isdn.net.il

At 18:41 31/10/99 -0500, Isaac Flemming wrote:
>
> Hello all,
>
> I am currently enrolled in college course that requires us to use the
>Netwide Assembler (NASM). This creates a small problem for me, because I
>do not have a DOS box in my room, and do not know how to get NASM to work
>the way I expect it to under FreeBSD.
>
> I noticed that NASM is located in the ports collection so I compiled it
>and have used it to assemble the .asm assembly code I used for DOS in
>class. The assembler does not give me any errors, but I cannot seem to get
>the programs to execute. In my most recent attempt I compiled the .asm
>into aoutb format and tried to link it into a .c program which calls it.
>The gcc c compiler gave me errors at this point, and I am now at a
>compleat loss. I have looked around FreeBSD-questions, and hackers
>archives for several hours but cannot seem to find anything that helps me. 
>Is there any one out there that knows how to get NASM to make a file I can
>execute, or link into a c program!? Even a simple "hello world" example
>may help. 
>
> Thanks a bunch in advance
> Isaac D. Flemming
>
>---------------------------------------------------------------------------
----
>Isaac D. Flemming
>Senior Computer Science Major
>Mount Vernon Nazarene College
>
>Email: iflemmin@mvnc.edu
>Phone: (740) 397-6862 x7604
>
>
>
>
>To Unsubscribe: send mail to majordomo@FreeBSD.org
>with "unsubscribe freebsd-questions" in the body of the message
>



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?3.0.6.32.19991101142156.007b9e20>