Newsgroup: it.comp.lang.delphi
Titolo: OT, divisone per zero

so che e' OT, ma non so a chi chiedere,
sapete perche' un programma se un computer lento funziona e su uno veloce
genera un INT 0, che viene come da subject puo' essere una divisione per 0
oppure una violazione di indirizzo (o qualcosa di simile)
grazie

 ha scritto nel messaggio
news:mCs56.252033$hk4.12...@news.infostrada.it...


ca75

succede con vecchi programmi che usavano emulatori di 8087
e, non correttamente programmati, non usavano l'istruzione
FWAIT per attendere il termine dell'operazione FP.
(8087 non e' un coprocessore ma un' "estensione di processore")
se puoi disattiva il coprocessore matematico (in W95 sipoteva fare,
poi si incartava Win, ma... insomma... magari adesso...)
pannello di controllo / sistema / gestione periferiche /
coprocessore matematico / impostazioni /
"non usare il coprocessore matematico"



Se e un programma fatto il TPascal Ho questo documento
che contiene anche un link (ammesso che funzioni)
Se non trovi nulla che ti risolva il problema ho il file di patch
Dimmelo.
Turbo Pascal 7 Bug Fix   
----------------------
Fix for Runtime Error 200 bug with Unit CRT
If you do not use the CRT Unit of Turbo Pascal, this information need
not concern you. 
The CRT unit of the Turbo Pascal Run-time library contains several
procedures including 
one named DELAY. Every Turbo Pascal program which uses CRT initialises
the DELAY procedure 
even if the program does not actually call DELAY. The initialisation
process, when run on 
a fast PC (eg a Pentium II with 266 MHz), causes the program to abort
with the message 
"Runtime Error 200". The problem does not occur on slower PCs. 
There is no perfect solution to this problem available. No solution is
available from 
the manufacturer, and the solutions available from other sources have
disadvantages.
The best solution seems to be one which involves a modification of
DELAY's initialisation 
process (so that programs do not abort) but at the expense of causing
DELAY to run at an 
unpredictable speed. If you apply the solution described below and use
the DELAY procedure 
you should be aware that it may not use an accurate timing mechanism.
If you use procedures 
in CRT other than DELAY, then DELAY's mis-operation need not concern
you. 
To apply the solution implemented at Cardiff, you should type the
command: 
TPCRTFIX 
before you next run Turbo Pascal. You need only type the command once.
The TPCRTFIX command 
copies a modified library file, TURBO.TPL, to your H:\TP7 directory.
Once you have have 
the modified library file in your H:\TP7 directory, you should not
encounter the 
"Runtime Error 200" as a consequence of using CRT. You can revert to
using the standard 
library file supplied by the manufacturers with Turbo Pascal by
deleting the 
file H:\TP7\TURBO.TPL from your filespace. 
*************************************************************
Pentium® II Processors
----------------------
"Runtime Error 200", "Divide Overflow", "Divide by 0" errors when
running software that 
was compiled on a Borland TurboPascal* compiler. 
A "Runtime Error 200", "Divide Overflow", or a "Divide by 0" error
message that is 
displayed when you try to run a program may be a result of a timing
loop that affects 
any program compiled on Borland’s TurboPascal* compiler. All versions
(including version 7.0) 
of Borland’s TurboPascal compilers are affected by this issue. This
compiler problem is 
dependent on the speed the processor is running, but it is not a
processor issue. 
When executed at speeds greater than or equal to 233 MHz, a
speed-dependent timing loop in 
the compiled program generates a large number. The code following the
timing loop then 
attempts to divide this large number by a smaller constant number.
This division results 
in a quotient too large to be represented in the quotient register
designated by the 
specific divide instruction. The program will not run, and the system
displays the 
"Runtime Error 200" message, or a "Divide Overflow" error message. 
The root cause of this problem appears to be the software libraries
that come with the 
compiler. Any compilers that are dependent on software-based timing
loops are affected, 
but this issue is specifically known to affect Borland’s TurboPascal
compilers.
If you have a piece of software that was compiled on a Borland Turbo
Pascal compiler, 
you will likely encounter this problem when run at speeds of 233 MHz
and higher. One 
possible solution is to contact your software vendor to see if they
have a newer version 
of that software that is not dependent on timing loops. 
Intel is also aware of two patches for this problem, one for programs
that have been 
compiled with a Borland TurboPascal compiler, and one that will patch
the software libraries 
of the compiler itself. 
Intel has worked with Inprise (formerly Borland), and Inprise has
communicated that there 
is more information about this problem on the Inprise Developer
Support web site.
*************************************************************
Runtime Error 200
-----------------
Applications that use the CRT unit may generate this error message
when running on very 
fast machines (like Pentium 300). The cause of this error is a timing
loop that occurs 
as part of the initialization of the CRT unit. This timing loop counts
how many clock 
ticks occur within the loop and then that number is divided by 55. The
result of this 
division is a value that is too large to fit into an integer value.
The 'Divide by 0' 
error message is the catch-all error that is displayed when this
overflow occurs. 
(Source: Pascal Developer Support Page).
http://www.inprise.com/devsupport/pascal/
Borland (called INPRISE now) currently does not offer any patches to
solve this problem. 
Fortunately, there are programmers who do. I have downloaded one
written by Dennis Passmore 
and it works perfectly. The patch contains a program, that modifies
the original files 
TURBO.TPL (and TPP.TPL for protected target) from \BP\BIN. In case of
Turbo Pascal, 
only TURBO.TPL from \TP\BIN is modified. Dennis gave me a permision to
use it, so you
can download the two updated Pascal files New TPP.TPL & TURBO.TPL. 
So if you have the same problem, download the new files and follow
these instructions : 
Create some directory, copy NEWTPLS.EXE to this directory and run it
to expand. 
If you have Turbo Pascal make a backup copy of TURBO.TPL (it is in
\TP\BIN) and copy the 
new TURBO.TPL to \TP\BIN 
If you have Borland Pascal make a backup copy of TURBO.TPL and TPP.TPL
(they are in \BP\BIN) and copy the new TURBO.TPL and TPP.TPL to
\BP\BIN