cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/04/05:34:32

From: tom burgess <tburgess AT drao DOT nrc DOT ca>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: asm xor problems
Date: Sat, 04 Oct 1997 00:44:44 -0700
Organization: BCTEL Advanced Communications
Lines: 20
Message-ID: <3435F3EC.4C2B@drao.nrc.ca>
References: <EHI7xn DOT FFs AT nonexistent DOT com>
NNTP-Posting-Host: pntn02m02-91.bctel.ca
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?
> 
> Art

The advanced RRSC (Reduced Register Set Computer :) x86 family
does not support memory to memory operations. You have to
get one of the arguments into a precious register first.
Something like (I might have the syntax wrong): 

	"movb variable1, %0"	// let GCC pick the register (%0)
	"xorb %0, variable2"	// xor variable1 into variable2

	regards, tom

- Raw text -


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