Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site shell.UUCP Path: utzoo!linus!decvax!harpo!seismo!ut-sally!cyb-eng!shell!starr From: starr@shell.UUCP (Bob Starr) Newsgroups: net.micro.pc Subject: Re: Does DOS function 48h work? Message-ID: <156@shell.UUCP> Date: Wed, 11-Jan-84 00:11:03 EST Article-I.D.: shell.156 Posted: Wed Jan 11 00:11:03 1984 Date-Received: Fri, 6-Jan-84 02:25:22 EST Organization: Shell Development CS Group, Houston, Texas Lines: 17 printf("hello world") When DOS invokes a program, all of available memory is assigned to it (see p. E7, paragraph 2 in DOS 2.0 manual). You need to free some memory before you can allocate it (using function 49h). But what to set ES to when invoking function 49h is another story. If your program does not terminate and stay resident, then just figure out where the end of the program you are running is (after the end of the data segment), add a few bytes (for safety), and choose a segment around there to pass to function 49h. Or, for that matter, since DOS has already assigned the space to you, just use it! If your routine terminates and stays resident, I know of no easy way to determine where to begin freeing and allocating memory.