[fpc-pascal]DXE demo uploaded

AITOR.SM AITOR.SM at teleline.es
Fri Jul 20 16:01:12 CEST 2001

> I'm playing with DXE a bit, and got it working nearly straight away.
Rather interesting for me as well, thanks!
However, I have several questions

> Some points about DXE:
> - The code loaded has to be totally self contained, and a unit. 
Does this mean that:
(a) it can't be linked with other DXE's
(b) it can't be linked with ANY other code (i.e. no "USES")

> You cannot
> call any RTL procedures directly from the DXE, you can also not 
This means 'no SYSTEM unit', I suppose...

> call DXE
> directly from the mainprogram.  However the mainprogramma can 
Pardon? I can't understand this, adddemo.pp has a direct call to the 

writeln('5+6 =',addfunc(dxe_load('add.dxe'))(5,6));

> pass you
> pointers to e.g. GETMEM and FREEMEM so that you can 
> allocate/deallocate memory. Don't forget that a lot of actions 
> (string manipulation, exceptions
> using int64 etc implicitely call RTL procedures)
> One can in theory link the needed RTL functionality in the DXE.

> - One can only pass ONE pointer from the DXE to the main program 
> on load.
How is this passed?

>  Nothing more. I'm studying on a system to enhance this at the 
> moment.  For the experimentors: Let this pointer point to a 
> structure or function
>  that can return more pointers to structures and functions.
>  Via parameters to such functions, you can load global variables 
> in the 
>  DXE with needed RTL functions.

Two more related to this, about dxe_load, when I call it, the DXE is 
loaded, then executed, then it disappears from memory?

If the answer is (or can be) NO, if I start two procedures of the same 
DXE unit, are they sharing these global variables? Or are different 
instances of the DXE unit loaded in memory, so that these variables are 
newly created for every instance?
If yes, is it possible somehow for the DXE to keep in memory some 
variables that can be shared by everybody? By everybody I mean:
(a) all the procedures of the DXE
(b) the main program that calls the DXE
(c) every program that is 'EXEC()'-ed from the main program?

And a final one, I have seen this in your BAT program:
dxegen add.dxe _ADD$$_ADDNUM$LONGINT$LONGINT add.o

do you have to declare every function? If so, where can I read about 
the data identifiers (e.g. LONGINT) that are used in this declaration?

Thanks in advance,


Consigue tu e-mail gratuito TERRA.ES
 Haz clic en http://www.terra.es/correo/

More information about the fpc-pascal mailing list