All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Zaitsev <zzz@anda.ru>
To: Lukasz Michal Rak <L.Rak@elka.pw.edu.pl>
Cc: gcc@gcc.gnu.org, linux-gcc@vger.kernel.org
Subject: Re: x86 D flag: what's its status thru the program?
Date: Mon, 5 Jul 2004 22:26:48 +0600	[thread overview]
Message-ID: <20040705222647.A17650@natasha.ward.six> (raw)
In-Reply-To: <Pine.GSO.4.58.0407051519010.27449@mion.elka.pw.edu.pl>; from L.Rak@elka.pw.edu.pl on Mon, Jul 05, 2004 at 03:23:44PM +0200

On Mon, Jul 05, 2004 at 03:23:44PM +0200, Lukasz Michal Rak wrote:
> 
> 	Hi all!
> 
>  The convention is that the D flag in IA32 is cleared. So if you call a
> subroutine you have to clear D flag before making call.

Do you mean that 'I have to clear the D flag if I had set it somewhere
before?'  Else what is the sense of the convention?

> The subroutine can change the state of D flag, but before returning
> the routine has to clear the D flag.

If the subroutine can change the flag, that it will violate the
convention, won't it?  And what is the strength of the convention,
again?

>  Hope I helped.

Thanks, but I still don't understand something.  Again: if every
procedure keeps the flag clear at exit, then why the same every
procedure clears it at entry?  In a suspicion, that caller has changed
the flag against the rules?

>  Regards,
> 
> 			Lukasz
> 
> 
> > Is this Direction flag (for the movs instructions) has some assumed
> > value (say, as after cld)?  I ask because the many program sources
> > show interesting behaviour: from one side, this flag is always set
> > before the string insns (cld or std), but from the other side, if the
> > programs does std then it always does cld after.  So, nobody leaves it
> > set, but nevertheless, everybody set it clear.  Why?
> > -
> > To unsubscribe from this list: send the line "unsubscribe linux-gcc" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> >
> 

  reply	other threads:[~2004-07-05 16:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-04 15:37 x86 D flag: what's its status thru the program? Denis Zaitsev
2004-07-05 13:23 ` Lukasz Michal Rak
2004-07-05 16:26   ` Denis Zaitsev [this message]
2004-07-05 17:19     ` Lukasz Michal Rak
2004-07-05 19:04       ` Denis Zaitsev
2004-07-06 14:05         ` Lukasz Michal Rak
2004-07-07  0:32         ` Jim Wilson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040705222647.A17650@natasha.ward.six \
    --to=zzz@anda.ru \
    --cc=L.Rak@elka.pw.edu.pl \
    --cc=gcc@gcc.gnu.org \
    --cc=linux-gcc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.