Board index » delphi » RTE 200: Division by zero

RTE 200: Division by zero

hi,
i've written some DOS progs in TP7 a few years ago which works fine under
NT4.
now i've installed 2 new systems (one with W2K and one with NT4) - the only
difference seem to be, that these machines are faster than the other
(PIII/866 and PIII/1000 instead of PI/200 to PIII/500).
whenever i start the program i got  the run time error 200 (division by
zero) on program start. even in the IDE i got the same before the first line
of code.
on my own PIII/700 i got sometimes the same error and some times the
programs work fine.

are the machines too fast fro TP7-progs? can i slow down them? any other
trick?

thanx a lot!

sven

 

Re:RTE 200: Division by zero


This is my fix for the division by zero at xxxx:0091

It will make the Delay procedure work 10 times faster!!

This fix will speed the Delay procedure by ten. So a Turbo pascal
program with Crt use should be able to run to about 2000 MHz now (ten
times the old limit of about 200MHz).
Else just go for 4000MHz :)

C:\BP\BIN> DEBUG TURBO.TPL

-s 7000l7000 f7 d0 f7 d2   (Find the location in my copy)
1486:9B3A

-u 9b3a
1486:9B3A F7D0          NOT AX
1486:9B3C F7D2          NOT DX
1486:9B3E B93700        MOV CX,0037    Change 0037 to 10 times
more=0226
1486:9B41 F7F1          DIV CX
1486:9B43 A30000        MOV [0000],AX
1486:9B46 1E            PUSH DS
1486:9B47 0E            PUSH CS
1486:9B48 1F            POP DS
1486:9B49 BAFD00        MOV DX,00FD
1486:9B4C B81B25        MOV AX,251B
1486:9B4F CD21          INT 21
1486:9B51 1F            POP DS
1486:9B52 C3            RET

-e 9b3e   (now type: SPACE, 26, 02, ENTER)1486:9B3E  B9.     37.26
00.02-u 9b3a
1486:9B3A F7D0          NOT AX
1486:9B3C F7D2          NOT DX
1486:9B3E B92602        MOV CX,0226        Changed version
1486:9B41 F7F1          DIV CX
1486:9B43 A30000        MOV [0000],AX
1486:9B46 1E            PUSH DS
1486:9B47 0E            PUSH CS
1486:9B48 1F            POP DS
1486:9B49 BAFD00        MOV DX,00FD
1486:9B4C B81B25        MOV AX,251B
1486:9B4F CD21          INT 21
1486:9B51 1F            POP DS
1486:9B52 C3            RET

-w   (And save it into Turbo.tpl)Writing 0BD50 bytes

-q   (quit)

Now your Delay() will be 10 times faster,
so Delay(1000) will only delay you for 100mSec!

So better make a new
Procedure MyDelay(ms: Integer);
var n: Integer;
begin
  for n:=1 to 10 do
    Delay(ms);
{You cannot always just use ms*10, as MyDelay(10000) then would
overflow!}
end;

--
Christen Fihl
http://HSPascal.Fihl.net/

Re:RTE 200: Division by zero


JRS:  In article <9a5mus$o8...@news.inet.tele.dk>, seen in
news:comp.lang.pascal.borland, Christen Fihl <Chris...@Fihl.net> wrote
at Sun, 1 Apr 2001 00:51:03 :-

Quote
>This is my fix for the division by zero at xxxx:0091

>It will make the Delay procedure work 10 times faster!!

A much better answer is indicated in the group's mini-FAQ, and the topic
is discussed on my WWW site.

Please be aware of the contents of the FAQ and mini-FAQ cited below
before asking or answering questions.  Their authors would no doubt
claim not to be infallible; but those FAQs have been thoroughly reviewed
by readers of this group and others, and have been enhanced in the light
of that.

--
? John Stockton, Surrey, UK.  j...@merlyn.demon.co.uk   Turnpike v4.00   MIME. ?
 <URL: http://www.merlyn.demon.co.uk/> TP/BP/Delphi/&c., FAQqy topics & links;
 <URL: http://www.merlyn.demon.co.uk/clpb-faq.txt> Pedt Scragg: c.l.p.b. mFAQ;
 <URL: ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip> Timo Salmi's Turbo Pascal FAQ.

Other Threads