

		Prot200 Copyright (C) 2000 Pixel (Papk Martin)
		===============================================


	What is Prot200
	===============

Prot200 is a program that solves (or strives to) the problem with incompatible
Intel CPUs over about 200 MHz and the CRT unit in Borland Pascal 7.0 package.
The bug causes the programs not to work on the mentioned CPUs, because a
divide overflow happens that isn't taken care of.
It's main advantage is that by using it, you won't break any copyrights since
no code is modified.



	How it works
	============

My tiny program handles the problems by taking over the division exception
handler (INT 0) and when a division exception occurs it checks whether it is
the CRT unit of the Borland Pascal, and either let's it be (in case it, isn't
the CRT) or handles the exception by faking the quotient to 0xFFFF and the
remainder to 0x0000, which isn't so far from reality, because it is an
overflow.
The checking whether it is the CRT unit is done via comparing the word at the
address where the exception occurs with 0xF1F7 and the address before with
0x0037. Here goes the disassembly of the location where the exception occurs.
The exact address is CS:0091, and is marked with an *. And since it is a
statically linked library the code segment is always different.

008A	F7 D0		not	ax
008C	F7 D2		not	dx
008E	B9 37 00	mov	cx,0037
0091 *	F7 F1		div	cx
0093	A3 42 02	mov	[0242],ax
0096	1E		push	ds
0097	0E		push	cs

After identification, the interrupt hander (INT 0) increments the return
address (in case it's necessary) by 2. And voila, the program works. (or not)



	Library Patch
	=============

I've included a patch that fixes the libraries of the Borland Pascal 7.0
product. It is useless for normal users, but important for those using BP7 for
developing their software. It also contains some more information about the
actual problem, and about the solutions.



	Distribution
	============

This program can be distributed freely, it is hereby placed in the public
domain. You can do whatever you want with it. You only cannot say you created
it. You have to acknowledge my rights.
In case you have any suggestion or a problem occurs, please send me the
description of the bug.
The latest and original version of Prot200 can be found at my web page along
with a few other tiny tools that 

http://karol.adlerka.schools.sk/~pixel/tools/prot200.zip
http://fornax.sk/~pixel/tools/prot200.zip

Contact:	e-mail: pixel@karol.adlerka.schools.sk
		snail:	Pixel
			Karola Adlera 5
			841 02 Bratislava
			Slovakia
		or:	Papk Martin
			Jilemnickho 337/19
			929 01 Dunajsk Streda
			Slovakia
