Mail Archives: djgpp/1998/01/01/03:35:34
On 31 Dec 1997, Egg brains wrote:
> the mode-switching takes time (about 100 cycles--am i correct
> here?).
Yes.
> I was wondering if there is away to keep the mode in real-mode
> between interrupts (or in that whole sub) to speed things up. Or
> does all DJGPP code have to be in p-mode?
DJGPP produces protected-mode code, but that's beyond the point,
IMHO. You are obviously trying to speed your program up on the
assumption that mode switches will take a significant portion of the
CPU time. This assumption is usually wrong in most programs. As an
example, think about the file I/O, or writing output to the screen: it
also requires a mode switch, but would you think about replacing it
with custom real-mode code?
I'd suggest to profile your program before you decide which parts of
it need to be sped up. Only if you see that the functions that
interface to the mouse takes, say 20% or more of the total CPU time,
should you consider making it faster.
(Profiling is done with the `gprof' utility; see chapter 13 of the
DJGPP FAQ list for more details.)
- Raw text -