runtime error 52 or 54 using delay(n) from Highspeed Pascal

C and PASCAL (or any other high-level languages) in here please

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

AtariForEver
Atarian
Atarian
Posts: 2
Joined: Wed Aug 28, 2013 10:55 am

runtime error 52 or 54 using delay(n) from Highspeed Pascal

Postby AtariForEver » Fri Aug 30, 2013 7:15 am

Hi all ... I registered finally :wink:

I've got no crash but a runtime error 52 or 54 under Hatari when using delay(n) from HighSpeed Pascal.

Pascal's standard libraries included a buggy procedure called delay(n) (in unit CRT) that halts the execution of the program for a given number of milliseconds. To be able to use this function, every program that includes CRT performs initialization on startup. The problem lies in the internal workings of the initialization routine: the code measures the running time of a busy wait loop and calculates how many times it must be called to have the correct amount of delay. The problem arises when the computer is so fast that the loop takes 0 ticks and these calculations result in a division by zero, which triggers the error.
It was patched for many librairies since the old days... maybe not for the dummy CRT from HSPascal.

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 5089
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: runtime error 52 or 54 using delay(n) from Highspeed Pa

Postby simonsunnyboy » Sun Sep 01, 2013 8:49 am

*Moderator note*

Splitted from offtopic thread and moved to appropriate forum section...
Simon Sunnyboy/Paradize - http://paradize.atari.org/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

Dal
Administrator
Administrator
Posts: 4178
Joined: Tue Jan 18, 2011 12:31 am
Location: Cheltenham, UK
Contact:

Re: runtime error 52 or 54 using delay(n) from Highspeed Pa

Postby Dal » Mon Sep 02, 2013 7:36 am

What are you looking to achieve? There are a number of more generic methods of pausing the execution of a program. For example, you could simply wait for the user to press a key or you could grab the system time and then keep running a loop to test for when X seconds have elapsed. Or, the cruder method of just running an empty loop (or nested loops) will consume a chunk of cycles.

I don't know Pascal so can't really give you any specific help, but maybe this will give you an alternative approach so you don't have to use an unreliable instruction.
Mega"SST" 12, MegaSTE, STE: Desktopper case, IDE interface, UltraSatan (8GB + 512Mb) + HXC floppy emulator. Plus some STE's/STFM's

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2476
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: runtime error 52 or 54 using delay(n) from Highspeed Pa

Postby charles » Tue Sep 03, 2013 1:21 am

i love pascal and still use to this very day , unfortunatily i found many bleek troubles with maxon pascal =(high speed)
i used pure pascal , and it is a very very promising package..

you were using like delay(500) right? it is in milliseconds ...there might be a editor/compilier
directive for use with it under hspascal ,,, ok .. keep up with us

charlie
The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!


Social Media

     

Return to “C / PASCAL etc.”

Who is online

Users browsing this forum: No registered users and 1 guest