www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/26/01:22:33

Date: Sun, 25 Jan 1998 22:21:54 -0800 (PST)
Message-Id: <199801260621.WAA01546@adit.ap.net>
Mime-Version: 1.0
To: radon AT swipnet DOT se (Rikard =?iso-8859-1?Q?Bj=F6rklind?= ), djgpp AT delorie DOT com
From: Nate Eldredge <eldredge AT ap DOT net>
Subject: Re: asm code

At 09:38  1/25/1998 GMT, Rikard Björklind wrote:
>Hi I'm trying to make a little proggy in DJGPP, and I'm learning this
>AT&T syntax...  now the stuff doesn't work!! I think it should be easy
>for you to see what I', doing wrong, the source is below.. 
>The compile error is on the clobbering list, about 20 messages about
>some numbers after the '%'.
>If you know what's wrong, please help me... =)
In each place you refer to a register by name, you must precede it with two
`%' signs to keep the compiler from confusing it with the asm operands of
the form `%0'. I.e. the first line would look like:

"movb $0,%%ah"

The GCC info page on Extended Asm does mention this.

(Incidentally, "xorb %%ah,%%ah" is smaller and possibly faster, I think.)

Nate Eldredge
eldredge AT ap DOT net



- Raw text -


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