From owner-freebsd-hackers@FreeBSD.ORG Mon May 16 18:19:09 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 18B9216A4CE for ; Mon, 16 May 2005 18:19:09 +0000 (GMT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4B10B43DAF for ; Mon, 16 May 2005 18:19:08 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1]) by harmony.village.org (8.13.3/8.13.1) with ESMTP id j4GIHGTf023768; Mon, 16 May 2005 12:17:16 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 16 May 2005 12:17:16 -0600 (MDT) Message-Id: <20050516.121716.41656814.imp@bsdimp.com> To: arundel@h3c.de From: Warner Losh In-Reply-To: <20050516171143.GA19979@skatecity> References: <20050516171143.GA19979@skatecity> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org Subject: Re: Console ASCII interpretation X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2005 18:19:09 -0000 From: alexander Subject: Console ASCII interpretation Date: Mon, 16 May 2005 19:11:44 +0200 > Hi there. > > I'm using syscall number 4 write() to output data to stdout using x86 > assembly. When I try to output the following DWORD: 0x00003532 I get > the following output under Eterm and xterm: "25". Which is exactly > what I want. > > However when I do the very same under the console (using bash or sh. > It doesn't matter) I get this output: "25 ". > > I looked up the ASCII value for 00h and it says NUL. Doesn't that mean > that there shouldn't be any output at all? No. It means NUL. When writing with write(2), you are telling the system to output 4 bytes. How different terminal emulation programs react is up to them (since xterm and the console are implemented by different sets of code). Warner