From owner-freebsd-hackers@FreeBSD.ORG Fri May 20 22:47:30 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 A66DC16A4CF for ; Fri, 20 May 2005 22:47:30 +0000 (GMT) Received: from enterprise4.noxa.de (enterprise.noxa.de [212.60.197.71]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8BDF943D49 for ; Fri, 20 May 2005 22:47:29 +0000 (GMT) (envelope-from arundel@h3c.de) Received: (qmail 21260 invoked from network); 21 May 2005 00:47:27 +0200 Received: from p508fb9b4.dip.t-dialin.net (HELO localhost.skatecity) (80.143.185.180) by enterprise.noxa.de with AES256-SHA encrypted SMTP; 21 May 2005 00:47:27 +0200 Received: from localhost.skatecity (nobody@localhost.skatecity [127.0.0.1]) by localhost.skatecity (8.13.3/8.13.3) with ESMTP id j4KMlQrB008017 for ; Sat, 21 May 2005 00:47:26 +0200 (CEST) (envelope-from arundel@localhost.skatecity) Received: (from arundel@localhost) by localhost.skatecity (8.13.3/8.13.3/Submit) id j4KMlQJh008016 for freebsd-hackers@freebsd.org; Sat, 21 May 2005 00:47:26 +0200 (CEST) (envelope-from arundel) From: alexander Date: Sat, 21 May 2005 00:47:26 +0200 To: freebsd-hackers@freebsd.org Message-ID: <20050520224726.GA7951@skatecity> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: Looking for ANSI/VT100 code replacement. 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: Fri, 20 May 2005 22:47:30 -0000 I'd like to port an application that was written in x86 assembly for Linux. So far all I had to do is change the Linux calling convention (registers) to Posix style (stack). However at one point this application outputs 5 characters to stdout (using syscall write and fd=1). These 5 characters however are then being deleted and overwritten again. The application uses VT100 codes to do this. First it moves the cursor to the left 5 times then it deletes everything from the end of the line to the current cursor position. However this slows down the whole application. That's why I'd like to replace that code with something faster. I've tried using lseek in combination with the fd=1 (stdout) and a negative byte offset, but that didn't really work. Is there a way to do this by only using syscalls? Under C/C++ I'd use fprintf or ncurses, but I'd like to limit the application to pure assembly language and a few syscalls. Cheers.