pc micro systems


  How to fix a Run Time Error 200


Run Time Error 200 (Divide by Zero) is usually caused by a bug in older versions of Turbo Pascal and Borland Pascal compilers (version 6 and earlier). The bug was specifically in the CRT.ASM unit included with these compilers.

DOS based programs that were compiled using these buggy versions of the CRT unit will generate the RTE200 error when started on a CPU that is faster then 200 Mhz (though some non-Intel CPU's would avoid the error up to 350 Mhz).

One solution is to recompile the source code using a later version of Pascal, or a fixed CRT.ASM unit. Obviously that's only possible if you have the source code available.

The more common solution is to patch the .EXE file to disable the bug. There are several programs that allow this. The one I recommend is PatchCRT by Kennedy Software. This one is more compatible then most others, including TPPatch (which is less effecent, and uses German results and error text).

I'd suggest keeping PatchCRT.exe in your path, so that you can run it from any directory simply by typing it followed by the name of the .EXE to be patched.

PatchCRT will only be able to patch .EXE files which have not been compressed by an EXE compressor, such as aPACK, Diet, LZEXE, PKLite, Petite, UPX, etc. If PatchCRT fails to patch the .EXE, there is a good chance it is because the .EXE has been compressed.

The best tool I have found to uncompress .EXE files is UNP. This has worked for about 80% of the compressed .EXE files I have encountered. The nice thing about UNP is it runs well under Windows. My second choice would be CUP386, but this works best in a plain DOS environment without any extended memory manager (including himem.sys or emm386.sys) installed. I have used this tool to uncompress several .EXE's which UNP was unable to do.

Once you have sucessfully uncompressed a compressed .EXE file, you should then be able to run PatchCRT on it to remove the RTE200 bug.

If all the above fails, the other option is to run a TSR (Terminate and Stay Resident) utility that will provide a kluge to the division by zero issue by catching this error as the .EXE is being run, and telling DOS to ignore it. The best TSR I have found to do this is TP7p5fix.

Simply run the TP7P5.EXE to load the TSR into memory, and any programs being run in that DOS window will avoid the RTE200. Keep in mind that once you close this DOS Window, or open other DOS Windows the TSR will not be active unless you load it again.



Be sure to read our Disclaimer

Return to the EleBBS FAQ




Copyright © 2000 - 2006 pc micro systems, inc.