Date: Thu, 9 Oct 1997 17:04:15 -0700 (PDT) Message-Id: <199710100004.RAA14929@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: "Arthur Bredrick" , djgpp AT delorie DOT com From: Nate Eldredge Subject: Re: asm xor problems Precedence: bulk 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