From owner-freebsd-hackers@FreeBSD.ORG Mon Jun 13 12:52:56 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 9024716A41F for ; Mon, 13 Jun 2005 12:52:56 +0000 (GMT) (envelope-from NKoch@demig.de) Received: from server.absolute-media.de (server.absolute-media.de [213.239.231.9]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0B95543D49 for ; Mon, 13 Jun 2005 12:52:55 +0000 (GMT) (envelope-from NKoch@demig.de) Received: from localhost (unknown [127.0.0.1]) by server.absolute-media.de (Postfix) with ESMTP id 76A3685587; Mon, 13 Jun 2005 14:52:53 +0200 (CEST) Received: from server.absolute-media.de ([127.0.0.1]) by localhost (server [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 03926-09; Mon, 13 Jun 2005 14:52:48 +0200 (CEST) Received: from firewall.demig (p50839F04.dip0.t-ipconnect.de [80.131.159.4]) by server.absolute-media.de (Postfix) with ESMTP id ADE3E8505C; Mon, 13 Jun 2005 14:52:48 +0200 (CEST) Received: from ws-ew-3 (ws-ew-3.w2kdemig [192.168.1.72]) by firewall.demig (8.13.4/8.13.1) with SMTP id j5DCp3RS033621; Mon, 13 Jun 2005 14:51:03 +0200 (CEST) (envelope-from NKoch@demig.de) From: "Norbert Koch" To: , Date: Mon, 13 Jun 2005 14:51:02 +0200 Message-ID: <000001c57016$8e4b0600$4801a8c0@ws-ew-3.W2KDEMIG> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 In-Reply-To: <429C8E8F00015E63@ims3a.cp.tin.it> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2120.0 X-Virus-Scanned: by amavisd-new X-Virus-Scanned: by amavisd-new at absolute-media.de Cc: hselasky@c2i.net Subject: RE: Obvious bug in /sys/i386/include/bus.h (was: bus_at386.h) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2005 12:52:56 -0000 > >So > >how can I fix this in assembly. I am not an expert with inlined assembly, > >so > >maybe someone can correct me if I am wrong, but something like this needs > >to > >be added: > > > >or %ecx, %ecx > >jz 2 > > > >2: > > This is wrong beacause the result is stored in ecx. Better using > JECXZ instruction > before the loop. > > Greeting, > rookie No, it's a correct method to set/reset the zero flag: (X | X) == X just as (X & X) == X So, he could also write: "and %ecx, %ecx". I may be wrong, but in the old 386/486 days the "jecxz" was even less efficient, wasn't it? Twenty years ago, my z80 programs had a lot of lines like and a ret z Weren't there discussions, if an nmos cpu consumed more electric power with either "and a" or "or a"? ;-) Norbert