Mail Archives: djgpp/1997/10/09/20:06:00
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 -