Does D (DMD/Win) use ES, FS & GS for anything?

Sean Kelly sean at invisibleduck.org
Wed May 21 11:55:37 PDT 2008


== Quote from Walter Bright (newshound1 at digitalmars.com)'s article
> Me Here wrote:
> > The subject pretty much says it all. I'd like to use one (or if possible, two)
> > of these registers in some assmbly code and want to know if I need to preserve
> > them or if D will just ignore them and leave them untouched between callbacks
> > into the assembler code?
> I recommend save/restoring them. GS, for example, is used in Linux for
> thread local storage. FS is used for exception handling. ES is used for
> string instructions.

In general, I think following the x86 C ABI is the best approach insofar as
register allocation and such is concerned.  I don't have the link handy, but
I believe it was published by Sun.  If I remember correctly, the only scratch
registers are EAX and EDX.


Sean



More information about the Digitalmars-d mailing list