delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/04/18:02:00

From: Reinier Heeres <rwh AT worldonline DOT nl>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: asm xor problems
Date: Sat, 04 Oct 1997 22:56:28 +0200
Organization: World Online
Lines: 26
Message-ID: <3436AD7B.CA40B171@worldonline.nl>
References: <EHI7xn DOT FFs AT nonexistent DOT com>
Reply-To: rwh AT worldonline DOT nl
NNTP-Posting-Host: alkmr1-p99.worldonline.nl
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Arthur Bredrick wrote:

>  Why do I get the following error with the assembly statement, "xorb
> variable, variable"?
>
> "Error:  Error:  operands given don't match any known 386 instruction"
>
> Is it illegal to use xor with the same variable twice?  If so, why?

Hi!

It's illegal to do "xor memory,memory". But you can do "xor
register,register".
It's illegal just because there is no instruction that handles "xor
memory,memory"
By the way: if the two variables you use are the same you should use a
mov var,0 instead, because it will always result in 0

Reinier

--
-----------------------> RwH <------------------------
RwH's page / Programming stuff: http://www.dra.nl/~rwh
Email: rwh AT worldonline DOT nl


- Raw text -


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