Mail Archives: djgpp/1999/08/14/03:17:25
Goldberg,Neil R. wrote:
>
> On Sun, 8 Aug 1999, Eli Zaretskii wrote:
>
> >
> > On Thu, 5 Aug 1999, Neil Goldberg wrote:
> >
> > > Yes, _dos_ds is good for all _far* accesses. What I usually do is assign
> > > it to a local variable... it's a function call that can be avoided.
> >
> > What function call overhead did you have in mind? `_dos_ds' is a
> > variable, not a function. (Actually, it's a macro, defined by
> > <go32.h>, because the real name of the variable is too long to
> > type...)
> >
> Sigh, I already admitted that I confused _dos_ds with my_ds();
Incidentally, `_my_ds()' is an inline function and hence does not suffer
the overhead. A piece of code like:
seg = _my_ds();
will probably compile to:
movw %ds, seg
or some variation thereof. It's written as a function because DS is
something that can change over the course of the program, and therefore
needs to be "calculated" dynamically. _dos_ds, on the other hand, is
unchanging.
--
Nate Eldredge
nate AT cartsys DOT com
- Raw text -