From: tom burgess 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: NNTP-Posting-Host: pntn02m02-91.bctel.ca Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk 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