Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ihnp4!inuxc!iuvax!bsu-cs!dhesi From: dhesi@bsu-cs.UUCP Newsgroups: rec.games.hack,comp.sources.bugs Subject: Re: Help w/ NETHACK & MSC v4.0 Message-ID: <1079@bsu-cs.UUCP> Date: Tue, 1-Sep-87 17:16:41 EDT Article-I.D.: bsu-cs.1079 Posted: Tue Sep 1 17:16:41 1987 Date-Received: Thu, 3-Sep-87 06:10:42 EDT References: <616@hadron.UUCP> <3470@zen.berkeley.edu> Reply-To: dhesi@bsu-cs.UUCP (Rahul Dhesi) Organization: CS Dept, Ball St U, Muncie, Indiana Lines: 23 Xref: utgpu rec.games.hack:1210 comp.sources.bugs:232 Summary: Microsoft uses 16-byte units In article <3470@zen.berkeley.edu> iverson@cory.Berkeley.EDU.UUCP (Tim Iverson) writes (about setting a stack for hack.exe under MSDOS): >I tried stacks up to 64k, but I always >got the same lack of stack space. Then I tried smaller stacks - and guess >what? It worked! The limit is somewhere between 0a00 and 0b00 (a00 works >fine, but b00 doesn't). If someone out there understands exactly why it >works with a small stack but not a large one, I'd really like to know. A lot of things under MS-DOS are measured in units of 16-byte clicks. Thus, when you specify a stack of 0xa00 bytes, you may be really specifying 0xa00 clicks, which is 0xa000 bytes or 40 kilobytes. Since the stack segment can't exceed 64 kilobytes, specifying too large a stack will cause overflow. Unfortunately, the Microsoft linker doesn't seem to give a warning when this happens, and just seems to use some unknown value instead. Also note that, depending upon the memory model and the options you specify to the compiler, the stack may share a segment with static (non-stack) data, limiting the stack itself to less than a full segment. -- Rahul Dhesi UUCP: {ihnp4,seismo}!{iuvax,pur-ee}!bsu-cs!dhesi