Board index » delphi » Runtime Error 216 in Drivers.StoreEvent

Runtime Error 216 in Drivers.StoreEvent

After recompiling the whole Turbo Vision 2.0 Runtime Library I always get a
runtime error 216 in unit Drivers procedure StoreEvent after programm
startup.
Since I'm newly involved in the BP project I don not know if one of my
predecessors changed the code.
Unfortunately the original BP disks are damaged (CRC failure) so we are not
able to restore the original source.

Does anyone know where to get the original drivers.pas for TV 2.0?

The error occures on line 10 of the procedure StoreEvent:

 1 Procedure StoreEvent; near;
 2 var
 3   Ticks : Word;
 4 begin
 5   Ticks:=FTicks;
 6   asm
 7      MOV DI, SP
 8      LES DI,SS:[DI+8]
 9      CLD
10     STOSW
11    ...

Any help is recommended!

Thanx in advance

Martin

 

Re:Runtime Error 216 in Drivers.StoreEvent


"Martin Gamperl" <mgs-softw...@bigfoot.com> schrieb im Newsbeitrag
news:39e6cf16$0$24122@SSP1NO25.highway.telekom.at...

Quote
> After recompiling the whole Turbo Vision 2.0 Runtime Library I always get
a
> runtime error 216 in unit Drivers procedure StoreEvent after programm
> startup.

This is a General Protection Fault.

Quote
> Since I'm newly involved in the BP project I don not know if one of my
> predecessors changed the code.
> Unfortunately the original BP disks are damaged (CRC failure) so we are
not
> able to restore the original source.

> Does anyone know where to get the original drivers.pas for TV 2.0?

> The error occures on line 10 of the procedure StoreEvent:

>  1 Procedure StoreEvent; near;
>  2 var
>  3   Ticks : Word;
>  4 begin
>  5   Ticks:=FTicks;
>  6   asm
>  7      MOV DI, SP
>  8      LES DI,SS:[DI+8]
>  9      CLD
> 10     STOSW
> 11    ...

> Any help is recommended!

Perhaps you only can use this in 16-bit real mode?
Seems to be that SS:[DI+8] wants to access Ticks' address. But I see no
reason where the trouble may be.
Perhaps set a breakpoint at lines 7 and 10 and tell us, what you see in the
registers window.
The following should hold in PMode:
DI(line 10) == SP(line 7) + 8
ES(line 10) == SS(line 10)

If not, the real mode invariants should hold:
ES(line 10) * $10 + DI(line 10) == SS(line 10) * $10 + SP(line 7) + 8

Quote

> Thanx in advance

> Martin

--
Rudolf Polzer
REBOUNCE - http://www.mycgiserver.com/~rebounce
I wish I was what I was when I wished I was what I am now.

Re:Runtime Error 216 in Drivers.StoreEvent


Quote
>>  1 Procedure StoreEvent; near;
>>  2 var
>>  3   Ticks : Word;
>>  4 begin
>>  5   Ticks:=FTicks;
>>  6   asm
>>  7      MOV DI, SP
>>  8      LES DI,SS:[DI+8]
>>  9      CLD
>> 10     STOSW
>> 11    ...

>> Any help is recommended!

>Perhaps you only can use this in 16-bit real mode?
>Seems to be that SS:[DI+8] wants to access Ticks' address. But I see no
>reason where the trouble may be.
>Perhaps set a breakpoint at lines 7 and 10 and tell us, what you see in the
>registers window.
>The following should hold in PMode:
>DI(line 10) == SP(line 7) + 8
>ES(line 10) == SS(line 10)

>If not, the real mode invariants should hold:
>ES(line 10) * $10 + DI(line 10) == SS(line 10) * $10 + SP(line 7) + 8

This code doesn't make sense anyway?

The mov di,sp doesn't do anything, because DI is directly destroyed in the
next instruction. (les di loads a 4 byte seg:ofs pointer from address
ss:[di+8])

I seriously doubt this is original Borland code!

Re:Runtime Error 216 in Drivers.StoreEvent


In <slrn8ulafg.q61.mar...@snail.stack.nl>, Marco van de Voort
<mar...@snail.stack.nl> wrote

Quote
>>>  1 Procedure StoreEvent; near;
>>>  2 var
>>>  3   Ticks : Word;
>>>  4 begin
>>>  5   Ticks:=FTicks;
>>>  6   asm
>>>  7      MOV DI, SP
>>>  8      LES DI,SS:[DI+8]
>>>  9      CLD
>>> 10     STOSW
>>> 11    ...

>>> Any help is recommended!

[..]

>This code doesn't make sense anyway?

>The mov di,sp doesn't do anything, because DI is directly destroyed in the
>next instruction. (les di loads a 4 byte seg:ofs pointer from address
>ss:[di+8])

>I seriously doubt this is original Borland code!

It's not. Theanswer I gave in borland.public.turbopascal was:

<quote>
One of your predecessors has changed the code. The original is an
assembler procedure - lines 2 to 5 do not exist in the original and
line one has at the end of the declaration: assembler;

Having changed the way the procedure operates then you are accessing
memory, ISTM, in a different segment.

Does this procedure actually use ticks further down the procedure ?
</quote>
--
Information on this newsgroup is posted weekly - read before writing!
Contains links to    |  http://www.pedt.serve.net.uk/faq/clpb-faq.txt
helpful information  |  http://www.merlyn.demon.co.uk/clpb-faq.txt
and some guidelines  |  ftp://garbo.uwasa.fi/pc/doc-net/faqclpb.zip

Re:Runtime Error 216 in Drivers.StoreEvent


Marco van de Voort <mar...@snail.stack.nl> wrote:

Quote
>>>  7      MOV DI, SP
>>>  8      LES DI,SS:[DI+8]

> This code doesn't make sense anyway?

> The mov di,sp doesn't do anything, because DI is directly destroyed in the
> next instruction. (les di loads a 4 byte seg:ofs pointer from address
> ss:[di+8])

And that address depends on the value of DI loaded in the previous
instruction, does it not?

--
______________________________________________________________________
     The Scarlet Manuka,      |        Nitpickers' Party motto:
  Pratchett Quoter At Large,  |  "He who guards his lips guards his
 First Prophet of Bonni, is:  |  soul, but he who speaks rashly will
   sa...@maths.uwa.edu.au     |    come to ruin." -- Proverbs 13:3
______________________________|_______________________________________

Re:Runtime Error 216 in Drivers.StoreEvent


Quote
In article <8sefbo$ep...@enyo.uwa.edu.au>, The Scarlet Manuka wrote:
>Marco van de Voort <mar...@snail.stack.nl> wrote:
>>>>  7      MOV DI, SP
>>>>  8      LES DI,SS:[DI+8]

>> This code doesn't make sense anyway?

>> The mov di,sp doesn't do anything, because DI is directly destroyed in the
>> next instruction. (les di loads a 4 byte seg:ofs pointer from address
>> ss:[di+8])

>And that address depends on the value of DI loaded in the previous
>instruction, does it not?

Small detail. Hmm, it is monday morning isn't it ? :-)

Re:Runtime Error 216 in Drivers.StoreEvent


"The Scarlet Manuka" <sa...@maths.uwa.edu.au> schrieb im Newsbeitrag
news:8sefbo$epl$5@enyo.uwa.edu.au...

Quote
> Marco van de Voort <mar...@snail.stack.nl> wrote:
> >>>  7      MOV DI, SP
> >>>  8      LES DI,SS:[DI+8]

BTW, isnt it equivalent to
       7      LES DI, SS:[SP + 8];

Or is SP not allowed here?

Quote

> > This code doesn't make sense anyway?

> > The mov di,sp doesn't do anything, because DI is directly destroyed in
the
> > next instruction. (les di loads a 4 byte seg:ofs pointer from address
> > ss:[di+8])

> And that address depends on the value of DI loaded in the previous
> instruction, does it not?

> --
> ______________________________________________________________________
>      The Scarlet Manuka,      |        Nitpickers' Party motto:
>   Pratchett Quoter At Large,  |  "He who guards his lips guards his
>  First Prophet of Bonni, is:  |  soul, but he who speaks rashly will
>    sa...@maths.uwa.edu.au     |    come to ruin." -- Proverbs 13:3
> ______________________________|_______________________________________

--
Rudolf Polzer
REBOUNCE - http://www.mycgiserver.com/~rebounce
I wish I was what I was when I wished I was what I am now.

Other Threads