Path: utzoo!attcan!uunet!bu.edu!rpi!zaphod.mps.ohio-state.edu!usc!wuarchive!psuvax1!ukma!usenet.ins.cwru.edu!ncoast!catfood From: catfood@NCoast.ORG (Mark W. Schumann) Newsgroups: comp.os.msdos.programmer Subject: Re: Porting UNIX apps. to MS-DOS Message-ID: <1990Oct26.223541.26634@NCoast.ORG> Date: 26 Oct 90 22:35:41 GMT References: <90296.205211DLV101@psuvm.psu.edu> Organization: North Coast Public Access *NIX, Cleveland, OH Lines: 30 DLV101@psuvm.psu.edu (Dwaine VanBibber) writes: >Does anyone have some general rules for porting C programs developed under >UNIX to MS-DOS? I've developed a small language interpreter that I would >like to be able to run under DOS. I have already attempted this, and it >compiles fine using TC++, however I keep getting stack overflow. I am >using the large memory model. Setting TC++'s _stklen variable to something >large doesn't seem to help any either. I should also point out that the >program contains a recursive descent parser and function calls are often >nested quite deep. Compiling with TC 2.01 yields the same results. Do I >have to do a complete rewrite (ie. eliminate deep function calls or resort >to bottom-up parsing), or can it be coerced to work? Any comments or >volunteers to examine code? Thanks in advance. >--Dwaine You have a problem with the Intel '86 architecture. No matter what you do in C on an '86 machine, the stack segment cannot exceed 64K. That's because the SS register is (wierd exceptions aside) held constant through execution of a program. Since an Intel offset is a 16-bit pointer, you are limited to the 64K. Sigh...I think you may have to rewrite. Sorry. -- ============================================================ Mark W. Schumann 3111 Mapledale Avenue, Cleveland 44109 USA Domain: catfood@ncoast.org UseNet: ...usenet.ins.cwru.edu!ncoast!catfood ============================================================