[fpc-pascal]Debuging in Freepascal

Dirk Verwiebe dirk at verwiebe.de
Mon Sep 25 23:03:09 CEST 2000


Pierre Muller schrieb:

>
> This usually means that a real interrupt is redirected into protected code
> by the program.
> If this is a hardware interrupt, all code and data must be locked
> and a special selector must be used instead on the usual one.
> (see api/go32v2/mouse.inc for an example)

I think you are right, it seems to be the serial part of the program. Without
accessing the serial port the program doesn´t crash.

I had a look into mouse.inc and it is a lot of assembler code and looks very
difficult.
Have i to lock every variable which are used in the interrupt function ?
Maybe it is enough to lock the code of the isr and the data buffer where the
transfered bytes are stored ?
The registers are saved by the keyword interrupt ?


Const Ktr: Byte = 0;  {These are STATIC variables so pascal doesn't }
      IIR: Byte = 0;  {constantly have to redeclare them on the heap}


Procedure COM_ISR; Interrupt;
Begin
   asm
     cli
     movw %cs:our_ds,%ax
     movw %ax,%ds
     movw %ax,%es
     movw dosmemselector,%ax
     movw %ax,%fs
     end;
......

   port[$20]:= $20;  {We're done processing the interrupt}
   asm sti end;
end;



I use the async unit from the fpc unit page(Hristo Chilingirov).

Thanks for your help.


Dirk Verwiebe

>
>
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal





More information about the fpc-pascal mailing list