delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/07/05/07:05:31

Message-ID: <8D53104ECD0CD211AF4000A0C9D60AE3014A4A8B@probe-2.acclaim-euro.net>
From: Shawn Hargreaves <ShawnH AT Probe DOT co DOT uk>
To: djgpp AT delorie DOT com
Subject: Re: DJGPP & registers
Date: Mon, 5 Jul 1999 10:52:34 +0100
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.0.1460.8)
Reply-To: djgpp AT delorie DOT com

"Batchex" <thedark1 AT hotpop DOT com> writes:
> 1. Does DJGPP compiled programs use FS and GS registers in any way ?

%gs is used for internal purposes by libc (to hold a copy of the DOS 
memory selector, but it probably isn't a good idea to rely on that).
If you change this value, you have to put it back when you are done.

%fs isn't used by any library routines other than the contents of
<sys/farptr.h>, but may be used by other code, for example Allegro
makes heavy use of it. You don't need to bother restoring this
value, though: clobber it at will, but assume that any third party
libs might also clobber it when you call their functions.

> 2. Does DJGPP use register variables when optimizing is on ? 

Of course! Any decent optimising compiler will do that, and gcc is
one of the best there is.

> If it does, what registers does it use ?

All of them. Except %ebp, that is, unless you use the 
-fomit-frame-pointer switch (%ebp is normally used for a stack 
frame instead, which results in slightly slower code but is 
essential if you want to use any of the debugging tools).

> 3. Where are the manuals/docs for FSDB ? I can't seem to find it 
> anywhere.

I don't think there are any.


	Shawn Hargreaves.

- Raw text -


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