Mail Archives: djgpp/2000/02/26/05:49:01
Richard Poole wrote:
>
> Is it possible for me to use GCC to compile a function to raw machine
> code and nothing else (i.e. no run-time engine, no DMPI server etc.)?
You mean ``link'', not ``compile'', yes? Because compiled code doesn't
include any library functions at all.
Also, the programs generated by DJGPP don't include the DPMI server.
> I am writing a modular audio synthesiser that opens all files ending in
> a certain extension and copies their contents into allocated memory.
> These files (otherwise known as devices) should contain raw executable
> code, and I need the main program to be able to call that code. In the
> main program there is an array of pointers to the devices that it has
> loaded into memory, like this...
If you need ``raw code'', you could simply read only the .text section of the
program. It's easy to do that: the COFF header includes a pointer to that
section and its size, so it's just a bit of simple code. There are places in
the DJGPP sources you could look that up, if you want.
But I think that you need something else: you need an ability to dynamically
load code fragments at run time. For that, you could try DXE or DLX. See
the DJGPP FAQ for details and pointers to the resources on the net.
- Raw text -