Mail Archives: djgpp/1998/01/01/03:35:34

Date: Thu, 1 Jan 1998 10:34:17 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Egg brains <eggbrains AT aol DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: staying in real-mode
In-Reply-To: <>
Message-ID: <Pine.SUN.3.91.980101103355.6053M-100000@is>
MIME-Version: 1.0

On 31 Dec 1997, Egg brains wrote:

> the mode-switching takes time (about 100 cycles--am i correct
> here?).


> 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 -

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