  ------------------------------------------------------------------------

Fixes for "Runtime Error 200" bug of Borland Pascal 7 on fast PCs

  ------------------------------------------------------------------------

Note: You are reading the download page. For more explanations and a nice
index please go to the main page.

  ------------------------------------------------------------------------

TpPatch.zip

Patch program for existing executable files

Limits the delay factor to the maximum possible value.

Notes:

   * this program is recommended by Borland
   * this program speaks only German, but English docs are included
   * If this program fails, your EXE files may be compressed, in this case
     try uncompressing them with unp411.zip, available for example at
     http://www1.tu-chemnitz.de/ftp-home/pub/simtelnet/msdos/execomp/unp411.zip.

Use: if your program is   program.exe , enter the command
tppatch program.exe

Warning: This patch will cause delay to run too fast on computers that are
significantly faster than Pentium II with about 233 MHz. Some programs
require correct timing, for those this patch may do more harm than help!
Other programs should work fine with this.

Technical details:

   * A patched program will test if the computer is too fast. If no it
     proceeds with calculating the delay factor as usual. If yes the factor
     is instead set to the maximum possible value.
   * Program makes room for the required additional code by rewriting two
     variable assignments directly before the patched region with shorter
     code that is functionally equivalent. (If you don't see that it's
     equivalent after looking at the assembler code, note the registers
     that are used!).

  ------------------------------------------------------------------------

t7TplFix.zip [NEW! ]

patch program for Run Time Library files of Turbo/Borland Pascal 7

Program patches the file TURBO.TPL, the file that contains the run time
library of Turbo Pascal. Works with TURBO.TPL and optionally TPP.TPL (if
you have Borland Pascal with protected mode) of Turbo Pascal versions 7.0
and 7.01.

Use: run this program in the same directory where the file TURBO.TPL is,
for example C:\TP\BIN. Press P to apply the patches. This will create a new
file TURBO.TPL and store the previous file as TURBO.OLD. Similar for
TPP.TPL (if you have Borland Pascal with protected mode). After applying
the patch simply recompile your pascal sources and the problem should be
gone.

Note: if the program tells that it can't patch turbo.tpl, try the
dos-command  attrib -r turbo.tpl and try again, some cases were reported to
me in which this file had the readonly attribute set, the above command
will remove this.

Technical Details:

   * applies the same patches as in bppatch (c't magazine), but can be used
     to patch version 7.01 (c't distributed a patched variant of turbo.tpl
     from version 7.0)
   * No other files are changed, no other undocumented modifications are
     done to the CRT unit (unlike in the other distributed RTL files, see
     some of the other solutions below).

  ------------------------------------------------------------------------

NewDelay.pas

unit with delay replacement and error trap

(maybe newer version available here)

This unit comes as pascal source. It contains two things:

   * a new delay procedure that prevents the overrun by using a 32 bit
     delay factor instead of only 16 bit.
   * a trap procedure to catch the runtime error as it occurs. It will
     still occur internally, but catched before the program aborts, then
     it's skipped and the program continued. That's a nasty trick, I don't
     like it, but it seems to work.

Additional feature: tries to make a program behave nice during delays if it
runs in a multitasking environment. This will of course delay to be a too
long and a bit different each time. If you don't like it, disable it in the
source.

Use: In your program sources include this unit first, crt second, then all
other units and then recompile your programs.

  ------------------------------------------------------------------------

rdelay.zip

unit with delay replacement and runtime patch

(also required: util.zip)

(maybe newer versions available here).

Patch procedure modifies the EXE file in memory while it is running.

No detailed description available yet.

  ------------------------------------------------------------------------

bppatch.zip

Solution by German computer magazine c't July 97 page 232.

This file contains several different solutions: a patch program for
executable files (discussed in the magazine), modified source for the Crt
unit and compiled new versions of the run time library files turbo.tpl,
tpp.tpl and tpw.tpl.

The patch program for executables has the same problem as all these
patches: if the patched program uses the delay procedure, this will run at
incorrect speed, thus if the program requires precise timing and uses delay
to do that, it will probably not work properly any more. Furthermore on
even faster computers than today this patch will fail and the run time
error will re-appear even with the patch applied.

Technical Details of RTL patch:

   * implements a 32 bit counter with somewhat different code than the
     other solutions, presumably to make it more relibable.
   * additional feature: disables all other interrupts during delay
     initialization to make initialization more reliable.

Warnings:

   * the program patch is only suitable for programs that do not require
     precise timing
   * the included TPL files were created based on the Run Time Library of
     Turbo Pascal 7.0 instead of version 7.01. Version 7.0 had bugs! By
     using these TPL files, you reintroduce these bugs by solving another
     one!

  ------------------------------------------------------------------------

bp7patch.zip

patch program for Run Time Library

Program that can patch your run time library files TPP.TPL and TURBO.TPL of
Turbo Pascal versions 7.0 or 7.01.

In the patched versions the delay procedure will use a 32 bit counter
similar as in newdelay but without the nice idle behaviour.

Note: This is a new program version that will work also if you have only
TURBO.TPL, no TPP.TPL (i.e. Turbo Pascal instead of Borland Pascal).

Note: This program is recommended by Borland.

Use: patch your TPL files, then recompile your pascal sources.

Warning: not only changes CRT.TPU, but also all other files in the Run Time
Library. There are especially very many changes to SYSTEM.TPU. I find this
a bit suspicious and are very uncomfortable with using the new file as long
as I don't know precisely what's going on here.

  ------------------------------------------------------------------------

tp7p5fix.zip

TSR program to catch the runtime error while an affected program starts

Note: I do not know anything about what exactly this program does and did
not yet test it myself.

Warning: this program probably causes the delay to run too fast, so likely
the same warning applies as for TpPatch

Use: Install the TSR before any program is run that was compiled with
Borland Pascal.

  ------------------------------------------------------------------------

tpbug.zip

new TPL files

not available for download here because of potential copyright problems

File contains exactly the same files CRT.ASM, CRT.PAS and CRT.TPU (included
in TURBO.TPL) as BPPATCH.ZIP.

Warning: all the other TPU files contained in TURBO.TPL are different from
the original files too, expecially SYSTEM.TPU contains a lot of changes.
They are neither the version of Turbo Pascal 7.0, nor the ones of versions
7.01. I find this a bit suspicious and are very uncomfortable with using
the new file as long as I don't know precisely what's going on here.

  ------------------------------------------------------------------------
Last change: 22-Aug-1998
Collection and Descriptoons  1998 by Klaus Hartnegg
All information and programs mentioned herein are provided without
warranty. Use all on your own risk.
Best viewed withany browser. Created using The Semware Editor. Ceterum
censeo Microsoft esse delendam.
