Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site myriasb.UUCP Path: utzoo!utcsri!ubc-vision!alberta!myriasb!arc From: arc@myriasb.UUCP (Alan Covington) Newsgroups: net.lang.c Subject: Re: Numeric comparisons Message-ID: <487@myriasb.UUCP> Date: Thu, 26-Sep-85 19:06:45 EDT Article-I.D.: myriasb.487 Posted: Thu Sep 26 19:06:45 1985 Date-Received: Thu, 26-Sep-85 20:49:39 EDT References: <797@dataio.UUCP> <726@terak.UUCP> <1657@umcp-cs.UUCP> Organization: Myrias Research, Edmonton Lines: 16 Chris Torek writes > I offer another example. Take a 32 bit machine---the Vax---both for > simplicity and because the Vax does compares via subtraction. But I > will use a byte instruction: The VAX cmp and sub instructions set the condition codes differently. Thus, the cmp is not just a "subtract" with the result thrown away. An easy example is comparing 0x80000000 and 1 results in the N bit of the condition codes being set, whereas subtracting 1 from 0x80000000 results in the overflow bit being set. The VAX may use a subtract as part of the cmp instruction, but it doesn't do signed comparison as Chris claims. > A signed comparison is a subtract with the result > thrown away. Alan Covington ...!alberta!myrias!arc