Board index » delphi » Turbo Pascal interrupt handler

Turbo Pascal interrupt handler

I've been still working on my interrupt handler and have never seen it
work.  It just always gives me stack over flow run-time error 202 and I
have tried using Turbo De{*word*81} to track down how much is on the stack
when I enter and when I leave the interrupt.   I'm not having much luck.

I have managed to{*word*222}something up I know.  Seriously: does anyone know
what a Run-Time Error 244 is?

--
Jeff Patterson  --  Fredericton Area Network

 

Re:Turbo Pascal interrupt handler


Quote
Jeff Patterson <aa...@fan.nb.ca> wrote:
>I've been still working on my interrupt handler and have never seen it
>work.  It just always gives me stack over flow run-time error 202 and I
>have tried using Turbo De{*word*81} to track down how much is on the stack
>when I enter and when I leave the interrupt.   I'm not having much luck.

Where's your code?

Re:Turbo Pascal interrupt handler


Quote
Jeff Patterson (aa...@fan.nb.ca) wrote:
> I've been still working on my interrupt handler and have never seen it
> work.  It just always gives me stack over flow run-time error 202 and I
> have tried using Turbo De{*word*81} to track down how much is on the stack
> when I enter and when I leave the interrupt.   I'm not having much luck.
> I have managed to{*word*222}something up I know.  Seriously: does anyone know
> what a Run-Time Error 244 is?
> --
> Jeff Patterson  --  Fredericton Area Network

  Precise, pls, what int do you use?

Regards,
Alex.
nin...@redline.ru,
myacco...@glas.apc.org

Re:Turbo Pascal interrupt handler


On 20 Sep 1996, Shchekotin Alexander wrote:

Quote
> Jeff Patterson (aa...@fan.nb.ca) wrote:

> > I've been still working on my interrupt handler and have never seen it
> > work.  It just always gives me stack over flow run-time error 202 and I
> > have tried using Turbo De{*word*81} to track down how much is on the stack
> > when I enter and when I leave the interrupt.   I'm not having much luck.

> > I have managed to{*word*222}something up I know.  Seriously: does anyone know
> > what a Run-Time Error 244 is?
>   Precise, pls, what int do you use?

I am trying to hook int 14h, to intercept before & after fossil calls.  I
found the Run-Time error was because of a screwed up stack (from turning
off stack checking (missed a {$S-} I had earlier in the source)).

I am wanting to use the AX, BX, CX, DX, DS, ES, etc... variables, but not
just in inline but in pascal within the procedure.   I am having a
problem doing this as the AX variable is changing when I do an inline
command.  I added an sti/cli and fixed the stack problem, but with the
pascal variables changing it is making things hard.

Procedure  ......  (Flags, AX, ........); interrupt;
begin
  asm
    MOV AX, ####
  end;
   Writeln('AX shouldn't be ####, AX=',AX);
end;

If there is another way of modifying or reading the parameters I would be
interested in knowing.

Re:Turbo Pascal interrupt handler


Quote
Jeff Patterson (aa...@fan.nb.ca) wrote:
> On 20 Sep 1996, Shchekotin Alexander wrote:
> > Jeff Patterson (aa...@fan.nb.ca) wrote:

> > > I've been still working on my interrupt handler and have never seen it
> > > work.  It just always gives me stack over flow run-time error 202 and I
> > > have tried using Turbo De{*word*81} to track down how much is on the stack
> > > when I enter and when I leave the interrupt.   I'm not having much luck.

> > > I have managed to{*word*222}something up I know.  Seriously: does anyone know
> > > what a Run-Time Error 244 is?
> >   Precise, pls, what int do you use?
> I am trying to hook int 14h, to intercept before & after fossil calls.  I
> found the Run-Time error was because of a screwed up stack (from turning
> off stack checking (missed a {$S-} I had earlier in the source)).
> I am wanting to use the AX, BX, CX, DX, DS, ES, etc... variables, but not
> just in inline but in pascal within the procedure.   I am having a
> problem doing this as the AX variable is changing when I do an inline
> command.  I added an sti/cli and fixed the stack problem, but with the
> pascal variables changing it is making things hard.
> Procedure  ......  (Flags, AX, ........); interrupt;
> begin
>   asm
>     MOV AX, ####
>   end;
>    Writeln('AX shouldn't be ####, AX=',AX);
> end;
> If there is another way of modifying or reading the parameters I would be
> interested in knowing.

I don't understand for sure what is your objective. Do you want to replace
a function number in AX?

In such a case you can't use 'asm mov AX, #### end' because AX here is most
likely the REGISTER and not the parameter to procedure.

If I got you rigth then use AX := #### instead.

Regards,
Alex.
nin...@redline.ru,
myacco...@glas.apc.org

P.S. Btw, again, where is the full text of the interrupt procedure?

Re:Turbo Pascal interrupt handler


Re:Turbo Pascal interrupt handler


Quote
> I don't understand for sure what is your objective. Do you want to replace
> a function number in AX?

> In such a case you can't use 'asm mov AX, #### end' because AX here is most
> likely the REGISTER and not the parameter to procedure.

> If I got you rigth then use AX := #### instead.

My AX :word variable was being changed from within a asm..end; part as I
was using what you E-mailed me weeks ago.  I removed a "MOV BP,SP" from
it and that solved the problem with the variables changing for no
reason.  I also had to remove the MOV SI,[&SI] and remove MOV DS,[&DS]
from some inline and I got everything working now (I should have guessed
that changing DS etc "within" the procedure wouldn't help much with the
regular pascal to continue within the procedure).

Does anyone have a unit for WATTCP (perhaps a port of the WATTCP.LIB?)  
Or is there a way to use LIB's from Turbo Pascal?

Other Threads