Date: Tue, 30 Dec 1997 10:22:42 +0200 (IST) From: Eli Zaretskii To: Dave Nugent cc: djgpp AT delorie DOT com Subject: Re: The Code DJGPP Generates In-Reply-To: <34A7E946.72F5@ns.sympatico.ca> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Mon, 29 Dec 1997, Dave Nugent wrote: > When I write and compile a program in DJGPP is it automatically 32 > bit? Yes. > If so, why do I not need to use a DOS Extender? No. You need a DPMI server. If you run from Windows DOS box, you already have one: the DPMI services are built into Windows. Otherwise, get CWSDPMI, the free DPMI server for DOS which comes with DJGPP (v2misc/csdpmi4b.zip from the same place you get DJGPP) and put it somewhere along your PATH. DJGPP startup code will automatically load CWSDPMI if no DPMI services are available, and unload it when the program exits. > Does my program automatically switch to protected mode > transparently? Yes, the DJGPP startup code does that for you. > 2 - Since it (DJGPP) requires a 386 or higher, should I assume that any > program compiled with it will not run on a 286? It won't run on a 286, since it needs 32-bit protected mode, which 286 doesn't support. > Also does this mean it generates 386 instructions. Yes, it generates 32-bit protected-mode code. > 3 - If DJGPP uses 386 instructions, should I assume (that the same code > written in DJGPP, and in Borlands Turbo C++ (Compiled in 286 > mode). that DJGPP's code will run faster? Or is it only a small > difference? It depends on what your program does. Typically, DJGPP produces code that is faster than TC++, unless your program does a lot of disk I/O or video RAM accesses. > Is it only noticably quicker when doing things like 32 bit memory > transfers? About twice as fast as 286 TC code, and even more so if the original TC code used far pointers.