Date: Thu, 1 Jan 1998 10:34:17 +0200 (IST) From: Eli Zaretskii To: Egg brains cc: djgpp AT delorie DOT com Subject: Re: staying in real-mode In-Reply-To: <19971231172400.MAA17785@ladder01.news.aol.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk 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.)