Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!rutgers!cmcl2!adm!xadmx!MATHRICH@umcvmb.missouri.edu From: MATHRICH@umcvmb.missouri.edu (Rich Winkel UMC Math Department) Newsgroups: comp.lang.pascal Subject: Stack size in turbo pas Message-ID: <19601@adm.BRL.MIL> Date: 15 May 89 14:42:01 GMT Sender: news@adm.BRL.MIL Lines: 14 It's difficult to tell how much is needed, because you don't know what's going on in the pascal runtime library and during program initialization etc. Aside from the pascal-related stack allocation, you have to worry about stack usage by (possibly nested) hardware interrupt routines, such as the timer tick and keyboard. The ROM keyboard interrupt pushes around 10 words (20 bytes). If you have TSR routines hooked to the keyboard or timer, especially if they make DOS calls, you could be using 100 bytes very easily. A rule of thumb I seem to remember from my asm days is to add 256 bytes to whatever stack usage your program is responsible for. While this might seem excessive, the price of stack overflow is pretty high. Rich