🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.ibm.pc.programmer
Article #1010

Re: Turbo-C stack problem

#1010
From: Bruce Evans
Date: Mon, 23 Jul 1990 11:50
14 lines
1125 bytes
In article <1990Jul20.165800.23672@ux1.cso.uiuc.edu> gordon@osiris.cso.uiuc.edu (John Gordon) writes:
>
>	To change the stacklength, it is very easy:  just say
>
>		_stklen = (num of bytes desired) in your program.

This must be done with a global initializer (i.e. at compile time) since it
is used by the startup code (before main() ).

I used this to force a very small stack in a program that did little more
than shell out to another program, to stop it wasting 64K. It was necessary
to set _heaplen to something small too. I think the heap length is set to
64K - data length - _stklen otherwise (for small model TC 2.0). For details,
see the source file C0.ASM.
Technical Details
Message-ID: <2041@runxtsa.runx.oz.au>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!decwrl!apple!uokmax!munnari.oz.au!metro!ipso!runxtsa!brucee
References: <90Jul19.141716edt.19314@me.utoronto.ca> <1990Jul20.165800.23672@ux1.cso.uiuc.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!decwrl!apple!uokmax!munnari.oz.au!metro!ipso!runxtsa!brucee
From: brucee@runxtsa.runx.oz.au (Bruce Evans)
Newsgroups: comp.sys.ibm.pc.programmer
Subject: Re: Turbo-C stack problem
Message-ID: <2041@runxtsa.runx.oz.au>
Date: 23 Jul 90 11:50:33 GMT
References: <90Jul19.141716edt.19314@me.utoronto.ca> <1990Jul20.165800.23672@ux1.cso.uiuc.edu>
Organization: RUNX Unix Timeshare.  Sydney, Australia.
Lines: 14