[comp.sys.misc] Turbo C++ problem

DBarker@SYSTEM-M.PHX.BULL.COM (Deryk Barker) (12/01/90)

I don't know if anyone else has encountered this problem or not...

I'm  converting a package I originally wrote using Turbo C 2.0, then ported to
Microsoft  C  6.0,  to  Turbo  C++ 1.0.  My problem is that with largeish exec
files  (>170K including debug info) using the large model somebody is screwing
up the stack/heap.

As  far  as  I can ascertain, the problem is caused by the fact that after the
.EXE  has been loaded into memory, the SS register and DGROUP segment have the
same  address.   This  means  that  when  C0,  the  startup  routine, does its
memory/stack  calculations  it  releases  the wrong part of memory, you end up
with the stack pointing into static data and, worst of all, the initialisation
of  the  spare heap memory clobbers DOS's memory allocation information.  So -
not only won't the program run properly, but, let it get past C0, and you have
to reboot.

I  am  unable,  as  yet,  to  establish  whether  this is a compiler or linker
problem.   If anyone has seen anything similar, or there's anyone from Borland
listening, please respond.

Deryk Barker, 
Jupiter Software, 
Victoria BC.

"Send Lawyers, Guns and Money,
 Dad, get me out of this!"