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: Tue, 6 Jul 2004 01:04:04 +0600	[thread overview]
Message-ID: <20040706010404.B17650@natasha.ward.six> (raw)
In-Reply-To: <Pine.GSO.4.58.0407051912010.9712@mion.elka.pw.edu.pl>; from L.Rak@elka.pw.edu.pl on Mon, Jul 05, 2004 at 07:19:06PM +0200

On Mon, Jul 05, 2004 at 07:19:06PM +0200, Lukasz Michal Rak wrote:
> > >  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?
> Yes. Other code may assume that D is cleared and for example after calling
> your code will not check state of D flag, so if you will left D flag set
> this may cause errors.
> 
> > > 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?
> >
> Subroutine can change the D flag, but before exiting must clear it.
> 
> The convention should make you free from checking the state of flag
> and clearing at the beginning of your code.
> 
> > >  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?
> Just to be sure that the D flag is cleared. The convetion is one thing and
> reality other.

Ok.  Thanks!  It's the thing that I didn't understand.  BTW, where is
this convention documented, if either?

  reply	other threads:[~2004-07-05 19:04 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
2004-07-05 17:19     ` Lukasz Michal Rak
2004-07-05 19:04       ` Denis Zaitsev [this message]
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=20040706010404.B17650@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.