MS DOS overlay programming
Michael B. Brutman
mbbrutman-cctalk at brutman.com
Thu Dec 21 19:09:56 CST 2006
DEC bigots can skip this message safely. :-)
I've been working on a TCP/IP stack for my beloved PCjr. There are
already TCP/IP stacks that run on it, but that's not the point.
Borrowing a page from Tony's book, I decided to write my own so that I
could fix the inevitable bugs.
Anyway, I'm interested in reducing memory consumption. Any complex code
involves tradeoffs between function and performance, and I've been
careful, but one thing that is bothering me is the initialization code.
I've got a fair amount of code that reads environment variables, talks
to the packet driver, and sets up data structures. The nature of the
code is that it runs once, and then just sits there consuming memory.
Waaay back in history I was a Zbasic user - Zbasic was a fairly nice
BASIC dialect/compiler. Zbasic had overlay support, which I used
extensively. It wasn't sophisticated, but it did the job. It would be
perfect for this code - init everything that I need, and then overlay
the init code with the run code.
Now 20 years later I'm using Turbo C++ 3.0 for this project, and it has
overlay support but it has a more complicated memory manager that goes
along with it. I don't have a lot of 'gas' in the code, so going to the
VROOOM overlay manager just to overlay my init code is overkill, and
will probably require more memory. I was hoping Borland had a simpler
Any ideas? The only one I can think of is kind of brute force ... have
two apps, one that inits everything and leaves the storage resident, and
another that refers to that resident storage. (I was hoping for
something simpler in the Borland runtime support.)
PS: I'm still looking for a late version of Zbasic .. I had 4.02 and I
know that 4.71 was released. I'd love to see what it evolved to, but
that's a different topic.
More information about the cctech