Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!uunet!mcvax!hp4nl!mhres!vrh From: vrh@mhres.mh.nl (Michael Verhey) Newsgroups: comp.sys.ibm.pc Subject: Re: DOS memory allocation Summary: Register usage for the appropriate DOS call Keywords: fooling with DOS's mind Message-ID: <3163@mhres.mh.nl> Date: 17 May 89 06:12:20 GMT References: <8261@phoenix.Princeton.EDU> <670@spudge.UUCP> Organization: Multihouse NV, the Netherlands Lines: 42 In article <670@spudge.UUCP>, johnm@spudge.UUCP (John Munsch) writes: > In article <8261@phoenix.Princeton.EDU> jwbirdsa@phoenix.Princeton.EDU (James Webster Birdsall) writes: > > It occurred to me > >that an easy way to do this would to be allocate memory from the top > >down instead of bottom up, as usual. Can DOS be persuaded to do this > >in an elegant manner? > > I'm sure you'll get tons of responses, but just in case... > > DOS versions past 3.0 have the INT 21h function call 58h which sets the DOS > memory allocation strategy. One of the available options for this is to > allocate from the top down. Consult a DOS technical manual for details on > the parameters of the function call. You can use int 21h, function 58h as follows: Calling registers: AH = 58h AL = 00h, get strategy code 01h, set strategy code BX = Strategy code if setting it 00h, first fit (default) 01h, best fit 02h, last fit Return registers: Carry flag if cleared successful AX = Strategy code (if getting it) Carry flag set if error AX = Error code 01h, invalid function (file sharing) By the way, I can highly recommend the book "DOS Programmer's Reference" by Terry R. Dettmann (Que Corporation). It describes every BIOS and DOS call available till DOS V3.3. Good luck, Michael -- Michael Verheij (using Netnews) Multihouse B.V., the Netherlands USENET: vrh@mh.nl via European backbone (mcvax). UUCP: ..!mcvax!mhres!vrh "Experience comes with the amount of equipment ruined."