delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/09/20:06:00

Date: Thu, 9 Oct 1997 17:04:15 -0700 (PDT)
Message-Id: <199710100004.RAA14929@adit.ap.net>
Mime-Version: 1.0
To: "Arthur Bredrick" <sammy AT blast DOT net>, djgpp AT delorie DOT com
From: Nate Eldredge <eldredge AT ap DOT net>
Subject: Re: asm xor problems

At 01:54  10/4/1997 GMT, 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?
Yes it is. The `xor' instruction, and nearly every other x86 instruction,
take two operands. At most one can be a memory operand. You can xor a
register with itself, but not memory. You should use "movb $0,variable"
instead; it's only one byte or so longer.

Nate Eldredge
eldredge AT ap DOT net



- Raw text -


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