From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Wallman Subject: Re: ELKS port of Adventure - help needed :) Date: Wed, 11 Dec 2002 22:22:13 +0000 (GMT) Sender: linux-8086-owner@vger.kernel.org Message-ID: <200212112222.gBBMMA5G007271@eddie.loc> References: <200212112127.gBBLQx5G031546@eddie.loc> Mime-Version: 1.0 Return-path: In-Reply-To: <200212112127.gBBLQx5G031546@eddie.loc> List-Id: Content-Type: TEXT/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-8086@vger.kernel.org On 11 Dec, Richard Wallman wrote: > Possible a source code or bcc problem It's a bcc problem: strcmp doesn't return the right values. I think on line 142 of libc/string/string.c: sbb ax,ax ; Collect correct val (-1,1). I'm not too hot on x86 assembly, but surely this command is subtracting the ax register from itself, using the status flags to show sign? Does the processor support a negative and positive zero value? The next line (orb al,#1) then turns on bit 1. It is assuming that the scasb command has correctly set the right flag to indicate whether the comparison was negative or positive, and so give the sign. I think this is what's wrong - every time, I'm getting a -1 result from strcmp. Paul: short answer = rewrite strcmp. Only "vocab.c" and "english.c" use that function, so just replace all references. sed is your friend. :) -- Richard Wallman http://www.murkygoth.uklinux.net/elks