               Windows 3.x and DOS-Extended Applications
               -----------------------------------------

              Copyright 1996 by Phar Lap Software, Inc.


Applications produced with TNT DOS-Extender can run in the DOS box of
all three modes of Microsoft Windows 3.0 and higher.  This includes 386
Enhanced mode.

You can tell which the mode you are in by selecting "About Program
Manager..." from the Program Manager Help menu.


                   Windows Standard and Real Modes
                   -------------------------------

In Windows 3.x Real and Standard mode, TNT DOS-Extender can get extended
(XMS) memory from the HIMEM.SYS device driver that comes with Windows.
You will need to set the XMS memory "KB Limit" in a Program Information
File (PIF).

You can use the Phar Lap TELLME utility to make sure that your
application is getting the extended memory it needs when running under
Windows Real and Standard modes.  For example, the following indicates
that no XMS extended memory is available:

C:\>tellme -xms

-----XMS-------------------------------------------------------
XMS version.....................................2.0
Driver version..................................2.96
HMA.............................................Present
A20.............................................Off
Size of largest XMS block.......................0K bytes
Total free XMS memory...........................0K bytes

The easiest way to make sure that your DOS-extended programs get
sufficient XMS memory in Windows Standard and Real mode is to use the
Windows PIF Editor to create a _DEFAULT.PIF file with an XMS Memory KB
Limit setting of several megabytes.  Windows uses _DEFAULT.PIF if no
application-specific .PIF file is available; _DEFAULT.PIF corresponds to
a mythical program called _DEFAULT.EXE. Alteratively, you can create a
COMMAND.PIF file for the DOS box, or a .PIF file that bears the name of
your program.


                  Using PHARLAP.386 in Enhanced Mode
                  ----------------------------------

In Enhanced mode, TNT DOS-Extender uses the DOS Protected-Mode Interface
(DPMI) services provided by Windows.  You don't need to change any .PIF
file settings.

DOS-extended applications running under Windows 3.x enhanced mode
automatically get virtual memory.

The PHARLAP.386 VxD (virtual device driver) extends the DPMI services
provided to Phar Lap programs by Windows 3.x by adding the following:

    *	Low-level capabilities for mapping conventional memory.
	These allow TNT DOS-Extender to run DosStyle programs linked
	with -REALBREAK under Windows 3.x.

    *	Math coprocessor exception handling.
	If you need to run your program with math coprocessor exceptions
	unmasked, and you expect coprocessor exceptions to occur in your
	program, you must install PHARLAP.386 for compatibility with
	Windows 3.x.

    *	Math coprocessor emulation.
	These are needed by some coprocessor emulation libraries that
	turn on the emulating (EM) bit in the processor CR0 register.
	PHARLAP.386 is needed for this only under Windows 3.0;  Windows
	3.1 supports access to the EM bit.  Not all coprocessor
	emulation libraries use the EM bit;  the Microsoft 32-bit C/C++
	and Watcom C/386 emulation libraries require the ability to set
	the EM bit, the MetaWare High C/C++ emulation library does not
	use the EM bit.

    *	Debug register manipulation and virtualization.
	This allows 386|SRCBug to support data watchpoints under Windows
	3.0.  Windows 3.1 or later supports data watchpoints without
	PHARLAP.386.

    *   Preemption (TNT Realtime DOS-Extender only)
        If you're running Windows and PHARLAP.386 has not been installed,
        you cannot specify the -PREEMPT command line switch.  See
        section 2.7, "What About Windows?" in the book Programming the
        TNT Realtime DOS-Extender for more details.

PHARLAP.386 should be copied to your Windows subdirectory, and the
following line should be added to the [386enh] section of your Windows
SYSTEM.INI file:

DEVICE=PHARLAP.386

The SYSTEM.INI file is a standard text file located in your Windows 3.x
subdirectory.


                         Nested DOS Extenders
                         --------------------

The DPMI server in Windows 3.x only allows one DOS extender to be
running at a time in a given DOS "box" (virtual machine).  That is, DOS
extenders cannot be "nested" under Windows 3.x Enhanced mode.

For example, you cannot run TNT DOS-Extender applications from inside
the DOS shell of a DOS-extended application like Lotus 1-2-3 Release 4,
nor can you run DOS-extended applications like 1-2-3 from within the DOS
shell of a TNT DOS-Extender application.  (A DOS shell would generally
be created with the C system() function.)

If TNT DOS-Extender is started under the DOS shell of a DOS-extended
application under Windows 3.x Enhanced mode, it will issue an error
message:

Error TNT.20084: There is already a DOS extender running in this virtual
	machine, and Windows 3.0 only allows one extender in a VM.


                               - END -
