SOFTWARE PROBLEMS

Runtime Error 200 - ‘Divide by 0’

Some users of Cambridge Insitu Logging software have found the programs will not run on the latest fast computers.

Our software runs under MSDOS, is written in Turbo Pascal and is compiled using Borland supplied software not updated since 1993. This is not because we are tight fisted but because Borland decided at that time to stop producing and supporting Turbo Pascal products.

Some elements of our software use Borland supplied units of pre-compiled code that use software timing loops. One unit in particular seems to have a problem. During the initialisation of this unit a timing loop is put into effect to work out how fast the computer is running. The loop attempts to determine how fast the processor is by issuing a 1 millisecond tick (wait). While "waiting", it starts counting. At the end of the wait, it loads the count into a register. Unfortunately, due to the speed of the latest processors the number is greater than 65536 (216 or FFFF in hex) and is too big to fit the allocated space for the register. The consequence is that the register remains at zero. The next instruction is division of the register number (zero) into a fixed integer, namely 55. Hence, divide by zero (RUNTIME 200 ERROR).

There are no Borland (now Inprise) fixes for this problem. There are 'patches' available. Some of these alter the original code in the precompiled units and hence rely on the source code being at hand because the whole project must be re-compiled. There are also fixes that operate on the EXE file. The problem with these is that the length of the EXE file is changed and this will be identified by anti-virus software such as Dr Solomon as a virus attack. None of these fixes are 'approved' although encouraging results are reported. Essentially what they do is put the largest number possible (FFFF) into the register previously reported as being zero.

As far as we are concerned the best approach is to use slower computers to run our software. We can supply modified software compiled with the 3rd party fixes for those customers brave enough to try them. In the long run it is time to recognise that this generation of software has come to an end.

R.W.Whittle 6th December 1999

Return to Index of technical problems

Return to Home page