Path: utzoo!utgpu!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!nosc!ucsd!rutgers!mit-eddie!uw-beaver!ubc-cs!alberta!dvinci!lowey From: lowey@dvinci.USask.CA (Kevin Lowey) Newsgroups: comp.sys.ibm.pc Subject: Re: Turbo Pascal 4.0 (procedure KEEP) Summary: You have to reduce HEAP size {$M 16000,0,0} Message-ID: <1145@dvinci.USask.CA> Date: 27 Aug 88 17:46:03 GMT References: <640@mannix.iros1.UUCP> Organization: University of Saskatchewan Lines: 23 In article <640@mannix.iros1.UUCP>, mercier@rupert.iro.umontreal.ca (Denis Mercier) writes: > Can someone help with the KEEP procedure of Turbo Pascal 4.0 ? > i try it directly but when i want it to TSR with keep an allocation > memory error is signaled. And the message add that command is not found > and the system halted. The problem is probably with your heap space. Turbo Pascal assumes you want to use ALL available memory for the program. What happens is your TSR program grabs all the available memory. When you exit the program, MS-DOS tries to load the COMMAND.COM program, but there is no room because your TSR program has grabbed all the memory, so the system is halted. The solution is to add the following line at the beginning of your TSR: {$M 16000,0,0} The first number is the maximum size for the STACK. You can probably reduce the number from the default of about 16000. The second number is the minimum size for the heap, which is 0 bytes. The third number is the maximum size for the heap. Since a Turbo Pascal TSR should not use any of the memory managment routines (NEW, GETMEM, etc.) there is no need for a heap, so this maximum value should also be 0. -- Kevin Lowey