[fpc-pascal]DXE demo uploaded

Kanzelsberger Pavel kanzelsberger at rekt.umb.sk
Fri Jul 20 14:29:16 CEST 2001


Okies, thanks for the usefull information!

I need DXEs for DOS version Pixel32 (http://pixel32.box.sk), this should be
first DOS application supporting plugins :))

Regards, Pavel Kanzelsberger

-----Original Message-----
From: marcov at stack.nl [mailto:marcov at stack.nl] 
Sent: Friday, July 20, 2001 2:23 PM
To: fpc-pascal at deadlock.et.tudelft.nl
Subject: Re: [fpc-pascal]DXE demo uploaded


> Great job, it works!!
> Anyway I found that Stack checking must be turned off, otherwise 
> DXEGEN cannot process STACKCHECK symbol in .o file...

It is the same problem as mentioned in the prev. msg. Internal procedures
fail. A workaround could be:

What do you want to use DXE for? What kind of code do you want to put in the
DXE?

----------------------------------------------------------
Untested:

Use this in your DXE code:

type ThandleerrorProc = procedure (Errno:longint);

var remotestkbottom : ^longint;  
    remotehandleerror : THandleErrorProc;

procedure
int_stackcheck(stack_size:longint);[public,alias:'FPC_STACKCHECK'];
{
  called when trying to get local stack if the compiler directive $S
  is set this function must preserve esi !!!! because esi is set by
  the calling proc for methods it must preserve all registers !!

  With a 2048 byte safe area used to write to StdIo without crossing
  the stack boundary
}
begin
  asm
        pushl   %eax
        pushl   %ebx
        movl    stack_size,%ebx
        addl    $2048,%ebx
        movl    %esp,%eax
        subl    %ebx,%eax
        movl    remotestkbottom,%ebx
	movl    (%ebx),%ebx
        cmpl    %eax,%ebx
        jae     .L__short_on_stack
        popl    %ebx
        popl    %eax
        leave
        ret     $4
.L__short_on_stack:
        { can be usefull for error recovery !! }
        popl    %ebx
        popl    %eax
   RemoteHandleError(202)
  end['EAX','EBX'];
  
end;

-----------------------
And then your main program should 

have 

var
   stkbottom : longint;external name '__stkbottom';

and via DXE calls you should set 

remotestkbottom to @stkbottom;
remotehandleerro to @handleerror;



_______________________________________________
fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20010720/b720adf9/attachment.html>


More information about the fpc-pascal mailing list