From owner-freebsd-hackers Tue Nov 2 6:26:16 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.bezeqint.net (mail-a.bezeqint.net [192.115.106.23]) by hub.freebsd.org (Postfix) with ESMTP id 6975B15460; Tue, 2 Nov 1999 06:26:06 -0800 (PST) (envelope-from sarig@bezeqint.net) Received: from default (pt115-104.nas.bezeqint.net) by mail.bezeqint.net (Sun Internet Mail Server sims.3.5.1999.07.30.00.05.p8) with SMTP id <0FKK008TTQRBA8@mail.bezeqint.net>; Tue, 2 Nov 1999 16:26:00 +0200 (IST) Date: Mon, 01 Nov 1999 14:21:56 +0200 From: Oren Sarig Subject: Re: NASM programs for freebsd In-reply-to: X-Sender: sarig@mail.bezeqint.net To: Isaac Flemming , freebsd-questions@freebsd.org, freebsd-hackers@freebsd.org Message-id: <3.0.6.32.19991101142156.007b9e20@mail.bezeqint.net> MIME-version: 1.0 X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.6 (32) Content-type: text/plain; charset="us-ascii" Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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-hackers" in the body of the message