From owner-freebsd-questions Tue Nov 2 6: 4:42 1999 Delivered-To: freebsd-questions@freebsd.org Received: from athserv.otenet.gr (athserv.otenet.gr [195.170.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 0432014CCC for ; Tue, 2 Nov 1999 06:04:16 -0800 (PST) (envelope-from keramida@diogenis.ceid.upatras.gr) Received: from hades.hell.gr (patr530-a030.otenet.gr [195.167.115.30]) by athserv.otenet.gr (8.9.3/8.9.3) with SMTP id QAA00482 for ; Tue, 2 Nov 1999 16:04:10 +0200 (EET) Received: (qmail 7606 invoked by uid 1001); 2 Nov 1999 03:20:12 -0000 To: freebsd-questions@freebsd.org Subject: Re: NASM for FreeBSD (update...) References: From: Giorgos Keramidas Date: 02 Nov 1999 05:20:11 +0200 In-Reply-To: Isaac Flemming's message of "Mon, 1 Nov 1999 11:48:48 -0500 (EST)" Message-ID: <86904hshoz.fsf@localhost.hell.gr> Lines: 39 X-Mailer: Gnus v5.6.45/XEmacs 21.1 - "20 Minutes to Nikko" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Isaac Flemming writes: > My question now is does anyone know of any documentation that will > tell me how to do I/O calls to the system in FreeBSD? You have plenty of alternative choises: (1) read the sources of the kernel to find out how to call the proper system calls to do your I/O. This is probably the hardest way of reinventing the wheel of Unix I/O. Try to avoid it, since writing in C can be a little easier. (2) use simple C calling conventions for linking your assembly programs against the standard C library. something like the following comes as a handy example. push 3 push FORMAT call printf add esp,8 (3) write a simple function in C that does what you want, then examine the output file produced by: % gcc -S demo.c you want to read demo.S after that. > Also once I do have information about the I/O calls will I be able to > execute the programs assembled as stand alone programs or do I have to > call them with a .c program? Both can work. If you link against a C program, see (2) above. To build a standalone program, you are probably going to find (1) more useful, in the long run. -- Giorgos Keramidas, "What we have to learn to do, we learn by doing." [Aristotle] To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message