Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!ucla-cs!sdcrdcf!trwrb!cadovax!gryphon!greg From: greg@gryphon.CTS.COM (Greg Laskin) Newsgroups: comp.sources.d Subject: Re: Nethack and Microsoft C 4.0 Message-ID: <1145@gryphon.CTS.COM> Date: Fri, 7-Aug-87 21:17:28 EDT Article-I.D.: gryphon.1145 Posted: Fri Aug 7 21:17:28 1987 Date-Received: Sun, 9-Aug-87 11:04:47 EDT References: <165@bernina.UUCP> Reply-To: greg@gryphon.CTS.COM (Greg Laskin) Organization: Trailing Edge Technology, Redondo Beach, CA Lines: 45 Keywords: Bummer, segment size, link, huh? In article <165@bernina.UUCP> srp@ethz.UUCP (Scott Presnell) writes: >>Run File [DECL.EXE]: HACK.EXE /NOIG /STACK:6000; >>Segment size exceeds 64K >>Input File: MSDOS.OBJ(msdos.c) pos: 9A Record type: 98 >>*** Error code 149 > >I'm not sure I understand the meaning of that error in the context of a >large model program. I am certain that all modules were compiled with the >large model option switch. I'm bummed :-(. Anyone got any clues? > The compiler places all initialized static storage in the default (_DATA) data segment. All quoted ("string") strings are initialized static storage so the end up in _DATA. _DATA is overflowing. The author attempted, in the Xenix version, to give different data segment names to the various modules by using -ND (/ND). Unfortunately this won't work because the compiler sets the DS register whenever a module so compiled is entered. The library was not thusly compiled so static references made within library routines called from modules compiled with explicit data segment names are to the wrong data segment since the library was not compiled with explicitly named data segments. You can use modules with explicitly named data segments if those modules contain only data declarations or make no library calls. A small inconvenience there :-). There may also be some problems if the amount of static data in a module with an explicit data segment name exceeds 32K. The solution involves replacing all the quoted strings with pointers to static character arrays residing in modules with explicit data segment names. In Xenix you can almost get there with xstr except that xstr chokes when the string file exceeds 32K and the SCO Xenix version has some other amusing deficiencies, at least in V2.1.3, but with a bit more hacking, I should have it working under Xenix. I don't know of an xstr equivalent for DOS, however. -- Greg Laskin "When everybody's talking and nobody's listening, how can we decide?" INTERNET: greg@gryphon.CTS.COM UUCP: {hplabs!hp-sdd, sdcsvax, ihnp4}!crash!gryphon!greg UUCP: {philabs, scgvaxd}!cadovax!gryphon!greg