Shared library with a .COM file

64 views Asked by At

I think I want dynamic libraries for my .COM files.

I've been playing around with DOSMC lately to produce some tiny MS-DOS .COM files:

https://github.com/pts/dosmc

It can also produce static library (.LIB) files and also talks about how it's an optimising linker, compiling in functions but skipping those that aren't called. This is great for reducing individual file sizes, but over multiple programs, those few hundred bytes for puts() stack up.

Thinking back to my MS-DOS (and therefore QuickBASIC days), I remember executables QuickBASIC produced could either have the runtime compiled in or reference it via BRUN45.EXE. I was wondering if something similar is possible with a bare bones .COM file, or what I'd need to do to achieve that sort of system. Something like:

small1.com   300 bytes
small2.com   400 bytes
biglib.com   10000 bytes

With small1.com having a stub to run biglib.com, but with its own code at the end.

I guess this is dynamic linking, but it doesn't feel dynamic because it's not across different segments, and the linker could rely on everything in the library being at a particular address. It's also just one runtime library versus a whole bunch of DLLs.

0

There are 0 answers