Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!decwrl!pyramid!pesnta!hplabs!qantel!lll-crg!seismo!brl-tgr!nlm-mcs!nlm-vax!randy From: randy@nlm-vax.ARPA (Rand Huntzinger) Newsgroups: net.micro.atari Subject: Re: calling programs Message-ID: <1956@nlm-vax.ARPA> Date: Tue, 21-Jan-86 09:41:58 EST Article-I.D.: nlm-vax.1956 Posted: Tue Jan 21 09:41:58 1986 Date-Received: Fri, 24-Jan-86 08:34:12 EST References: <1122@cvl.UUCP> Reply-To: randy@nlm-vax.UUCP (Rand Huntzinger) Distribution: net Organization: NLM/LHNCBC, Bethesda, Md. Lines: 28 In article <1122@cvl.UUCP> eli@cvl.UUCP (Eli Liang) writes: >*** REPLACE THIS LINE WITH YOUR MESSAGE *** > >Anyone out there used the gemdos Pexec command? It supposedly allows one >to call other programs from a main program. I've tried everything I could >think of to get it to work, but I've had no luck. It keeps returning error >code -39. According to the gemdos manual, this indicates not enough memory. >But I know I've got enough memory, becase the main program is about ten >lines long and the sub-program is about five lines long and I have a one- >megabyte machine! This is terribly frustrating! If anyone can offer any >suggestions or perhaps a solution, I will greatly appreciate it. >-- I usually reply to such things privately, but this frustrating problem comes up with the developer's kit enough to warrant posting a reply. For those without the developer's kit, I beg your patience. For some reason, the "gemstart.o" (or gems.o) module deallocates all but about 1K of user stack/heap space. Thus, you can have a 1 meg machine with 3/4 meg free, and still get the out of memory message. I ran into the same problem with Pexec() and had other problems as well, until I modified gemstart.s to allocate more space. Then the problems went away and I could get on with my work. I don't have the code at hand, so I can't give the exact fix. But somewhere there is a constant (400 or 500 hex) which gets added to the end of the program area. The stack is reset at this point and the rest of memory is deallocated. You get to use the space between the end of your code and the stack pointer. (400 or 500hex bytes) Randy Huntzinger