Skip to contentSkip to conversation

Runtime error 200 => How to slow down dosemu?

DISCUSSION Felix E. Klee 4 participants 11 messages Apr 22, 2006 – Apr 27, 2006 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

When I try to execute a program named "retrieve.exe" in Freedos under Dosemu 1.2.2, then I get the error message "runtime error 200 at 001D:233A.". I already tried patching the executable, but to no avail:

Quoted 1 line

tppatch retrieve.exe

TPPatch v1 - written by Andreas Bauer <[email protected]>

Überprüfe die Datei ...Datei ist ok.
DieDatei wird jetzt gepatcht...retrieve.exe kann nicht gepatcht werden.

The error message indicates that the file is already patched, but - as said before - "retrieve.exe" simply doesn't work. Also in the directory is program called "rtm.exe". But this one also cannot be patched:

Quoted 1 line

tppatch rtm.exe

TPPatch v1 - written by Andreas Bauer <[email protected]>

Überprüfe die Datei ...rtm.exe ist keine von TP7/BP7 erzeugte Datei.

I tried uncompressing "rtm.exe" with "unp" but it doesn't seem to be a compressed file.

Well, since the runtime error is most likely due to a processor which is too fast, the only solution left seems to be throttling of Dosemu. So:

How can I slow down Dosemu to the speed of about a 233MHz PII?

The machine Dosemu is running on has a Pentium M running at varying speeds, between 800MHz and 1.8GHz.

Signature · 5 lines
Felix E. Klee
-
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#1 lore raw
Quoted 3 lines · On Sat, 22 Apr 2006 22:29:30 +0200 "Felix E. Klee" <[email protected]> wrote:

The error message indicates that the file is already patched, but - as said before - "retrieve.exe" simply doesn't work. Also in the directory is program called "rtm.exe". But this one also cannot be patched:

I seem to recall this problem occurs if the .exe was compressed with lzexe. I'm not completely sure, but I seem to remember you can detect that by checking the binary - at about 20-30 bytes from the beginning, there is a text 'LZ90'

John

BTW: there is an unlzexe somewhere on the 'net...

#3 lore raw
In reply to Felix E. Klee
Quoted 3 lines · Felix E. Klee

When I try to execute a program named "retrieve.exe" in Freedos under Dosemu 1.2.2, then I get the error message "runtime error 200 at 001D:233A.".

That error means "Division by zero".

It is *sometimes* caused by a bad piece of timer initialisation combined with fast processors.

Quoted 1 line
Quoted 1 line

tppatch retrieve.exe

IIRC that patch is only for programs compiled with Turbo/Borland Pascal AFAIK. It's possible that it only handles code using Borlands CRT unit as well.

Also, IIRC some patches for this problem simply replaced a value with a higher value rather than actually replace the bad code. The result was that the code worked for another couple of years, but eventually started failing again when CPUs became a lot faster.

Not sure if that was TPPatch or some other patcher.

Quoted 1 line

Well, since the runtime error is most likely due to a processor which is

I could be becuase of that, but it is entirely possible that the code tries to divide something by zero for some other reason as well.

Quoted 1 line

too fast, the only solution left seems to be throttling of Dosemu.

You don't need to slow down Dosemu, you need to slow down the buggy program.

I've got a small piece of code I call Bx200Fix.exe that usually works for this. I don't know if attaches are ok on this list, so I just put it up for download from
<http://mmm.truls.org/j/>

Simply run it with the program you want to run as parameter. Like this:
bx200fix retrieve.exe
bx200fix retrieve.exe someparameter

If that doesnät work, run it like this instead:
bx200fix ?retrieve.exe
bx200fix ?retrieve.exe someparameter

Without the '?' it just tries to hide the problem when the app is starting, with the '?' it keeps doing it til the app exits.

It's just a quick hack and has at least one possible problem:
It does not copy the parameter data *exactly* to the program it calls. Usually this doesn't matter though.

Use it if you like it. And you may distribute it anyway you like as well.

Regards
/Jonas

Signature · 9 lines
Jonas Eckerman, FSDB & Fruktträdet
http://whatever.frukt.org/
http://www.fsdb.org/
http://www.frukt.org/

-
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#9 lore raw
In reply to Felix E. Klee

At Sat, 22 Apr 2006 22:29:30 +0200,

Quoted 3 lines · Felix E. Klee

When I try to execute a program named "retrieve.exe" in Freedos under Dosemu 1.2.2, then I get the error message "runtime error 200 at 001D:233A.".

I finally got it to work. :-) First, I applied CTBPPAT.EXE with default divisor 55:

Quoted 1 line

ctbppat.exe retrieve.exe

Then I applied mpatch2.exe:

Quoted 1 line

mpatch2.exe retrieve.exe

Both programs actually modified the file, though the first modification was, I guess, superfluous. BTW, in the directory containing "retrieve.exe" there were also the files "dpmi16bi.ovl" and "rtm.exe". I doubt that they are of any relevance, and I don't think that any of the patch programs touched them.

Further info:

* Overview about another program having the same problem and how to fix it (in German):

<URL:http://www.muenster.de/~matthias/aladin/fehler.htm>

* Source for mpatch2.exe:

<URL:http://www.muenster.de/~matthias/aladin/mpatch2.zip>

* Source for ctbppat.exe:

<URL:http://www.heise.de/ct/ftp/result.xhtml?url=/ct/ftp/ctsi.shtml&wo rds=ctbppat%20zip>

Signature · 1 line
Felix E. Klee
#4 lore raw
In reply to Jonas Eckerman

At Tue, 25 Apr 2006 17:09:24 +0200,

Quoted 4 lines · Jonas Eckerman

Simply run it with the program you want to run as parameter. Like this:
bx200fix retrieve.exe
bx200fix retrieve.exe someparameter

Thanks very much for your help. However, this didn't work, neither with "?" nor without "?". IIRC, when calling "bx200fix ?retrieve.exe" or "bx200fix retrieve.exe" just nothing happened, i.e. I was returned right to the prompt.

Signature · 1 line
Felix E. Klee
#2 lore raw
In reply to John Coppens

At Tue, 25 Apr 2006 02:09:07 -0300,

Quoted 4 lines · John Coppens

I seem to recall this problem occurs if the .exe was compressed with lzexe. I'm not completely sure, but I seem to remember you can detect that by checking the binary - at about 20-30 bytes from the beginning, there is a text 'LZ90'

Nothing there. Thanks for the hint, though.

Quoted 1 line

BTW: there is an unlzexe somewhere on the 'net...

I already tried decompression with "unp", as described in my original posting.

Signature · 1 line
Felix E. Klee
#10 lore raw
In reply to Felix E. Klee

At Tue, 25 Apr 2006 21:59:25 +0200,

Quoted 5 lines · Felix E. Klee
Quoted 3 lines

When I try to execute a program named "retrieve.exe" in Freedos under Dosemu 1.2.2, then I get the error message "runtime error 200 at 001D:233A.".

I finally got it to work. :-)

I have to take that back: It's working when the machine is throttled to 800MHz, but not when it's running at full speed. This is driving me nuts. :-(

I guess, the only reliable solution is DosBox where one can, to my knowledge, adjust what speed the emulated processor should have. Of course, it requires a lot more resources, but this should not be too much of an issue.

Signature · 1 line
Felix E. Klee
#12 lore raw
In reply to a message not in the archive

At Tue, 25 Apr 2006 21:25:54 +0000,

Quoted 2 lines · Einar Indridason

(Or alternatively, start the program "slowly", and then after that check has run, increase speed to full throttle.)

It doesn't even have to run at full throttle, running it slowly all the time would be fine.

Signature · 1 line
Felix E. Klee
#6 lore raw
In reply to a message not in the archive

At Wed, 26 Apr 2006 11:30:47 +0200,

Quoted 2 lines · Jonas Eckerman

Were you in the same directory as "retrieve.exe" when doing this? If not: Did you try with the full path to retrieve.exe?

That's what I tried, and, contrary to what I said before, I get the runtime error message, i.e. I don't get just nothing.

However: I just tried it again with the version of "Retrieve.exe" patched with "CTBPPAT.EXE" and "mpatch2.exe" (see my message with Message-ID <87psj5whnm.wl%[email protected]>). And: This time it works, even at 1.8GHz!

Thanks a lot for this nice tool! Hopefully, the error message won't resurface.

Signature · 1 line
Felix E. Klee
#7 lore raw

At Wed, 26 Apr 2006 20:43:21 +0200,

Quoted 1 line · Felix E. Klee

Hopefully, the error message won't resurface.

It just did. :-(

Signature · 1 line
Felix E. Klee
#8 lore raw
Quoted 7 lines · Felix E. Klee

At Wed, 26 Apr 2006 20:43:21 +0200,

Quoted 1 line · Felix E. Klee

Hopefully, the error message won't resurface.

It just did. :-(

How big is this program? Would it violate your license to send me a copy?

"Runtime error 200" is a report, AFAIK originating only with Borland's Turbo Pascal, reporting division by 0. When the error occurs, the instruction pointer (IP) gets reported. Is it always the same? There is a common cause of that report occurring which is in the initialization of the counter used in the delay() procedure for creating millisecond resolution delays during execution. But this is not the only possible cause. Your program may have other causes for division by zero. Some or all of these may be related to the speed of execution.

Mike

Signature · 5 lines
p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
This message made from 100% recycled bits.
You have found the bank of Larn.
I can explain it for you, but I can't understand it for you.
I speak only for myself, and I am unanimous in that!