delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/26/09:31:15

From: vcarlos35 AT juno DOT com
To: djgpp AT delorie DOT com
Cc: nomoretagline AT juno DOT com
Date: Wed, 26 Aug 1998 09:17:50 EDT
Subject: Re: assembly language
Message-ID: <19980826.092950.5903.2.vcarlos35@juno.com>
References: <01J10IURTRN694HU4A AT slu DOT edu>

On Wed, 26 Aug 1998 10:24:36 +0200 Fabrice ILPONSE <fabrice AT asim DOT lip6 DOT fr>
writes:
>GAMMELJL AT SLU DOT EDU wrote:
>> 
>>      Thanks to those who responded to my query about
>>         movl $0x0,%edx    vs    xorl %edx,%edx
>> The movl sets %edx to zero, whereas xorl sets %edx and the carry bit 
>to
>> zero.  Thus the two statements above are not exactly the same thing.
>> This fact could make little difference to all but a few programmers,
>> and those few probably already know to avoid the xorl command when
>> writing codes in assembly language.  I find that the movl command
>> results in faster executables even when xorl can be used as above
>> (in those cases in which the carry bit does not matter).

IIRC, Intel CPUs have special functionality for xoring a register with
itself.
It's something about avoiding a partial register stall after modifying
the
32-bit extended register and than accessing the low-half of it using
the complementary 16-bit register. Could someone correct me?

Karl

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019