From owner-freebsd-hackers Sat Mar 4 2:49:41 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.ptd.net (mail1.ha-net.ptd.net [207.44.96.65]) by hub.freebsd.org (Postfix) with SMTP id 3084F37B768 for ; Sat, 4 Mar 2000 02:49:33 -0800 (PST) (envelope-from tms2@mail.ptd.net) Received: (qmail 5597 invoked from network); 4 Mar 2000 10:49:39 -0000 Received: from du42.cli.ptd.net (HELO mail.ptd.net) (204.186.33.42) by mail.ptd.net with SMTP; 4 Mar 2000 10:49:39 -0000 Message-ID: <38C0EA12.A4252C20@mail.ptd.net> Date: Sat, 04 Mar 2000 05:48:51 -0500 From: "Thomas M. Sommers" X-Mailer: Mozilla 4.51 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Subject: Can't write to stdout in assembly Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG From what I understand, the following should print "Hello, world." on stdout. I stole the code from the Linux HOWTO, but I think it should work on FreeBSD as well. Instead, the call to write returns 9 (EBADF). .data msg: .string "Hello, world.\n" len = . - msg - 1 .text global _start _start: movl $4, %eax movl $1, %ebx movl $msg, %ecx movl $len, %edx int $0x80 movl $1, %eax xorl %ebx, %ebx int $0x80 Can anyone explain what I've done wrong? As a related question, can anyone point me to the source for the int 0x80 handler? I've looked all over but can't find it. Thanks. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message