> At 12:58 PM 12/20/2012, Louis Santillan wrote:
>>The Memory Model (Tiny vs. Small vs. Compact vs. Medium vs. Large, 
>>.COM vs. .EXE) of the compiler could be causing the issue. Some 
>>compilers used to default to Small.  What compiler flags are you using?

> Even in the TINY model, there is no reason to get a stack overflow, 
> if the compiler indeed is not artificially limiting the stack size.
there's a very good reason to limit stack size.

most compilers use a memory setup like

static initialized data    ( "hello world" )
static uninitialized data    ( a[8000] )
stack       (usually 1-4 K unless specified different)
heap        ( to be used by malloc())

stack is initialized either by the linker (the .EXE format
has a filed for SS:SP), or early during RTL initialization.

> The sample program is using 8KB static data, 8KB+some slack for stack
> and likely 2KB of code, as there is no output like printf. All well 
> below of the limit of 64KB.
sure. just linkit with stacksize of 9K



> SMALL and MEDIUM memory models only have static data and stack in the 
> same segment and separate 64KB for code, while COMPACT, LARGE and 
> HUGE (Borland only) even have their own 64KB stack segment...

> This should compile and run, regardless of the memory model...
no.

Tom



------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user

Reply via email to