From: lnwdt AT form-net DOT com Date: Sun, 17 Nov 1996 18:59:08 -0500 Message-ID: Subject: Re: __dpmi_allocate_dos_memory(...) To: djgpp AT delorie DOT com >On Fri, 15 Nov 1996 lnwdt AT form-net DOT com wrote: >> I am working on a sound blaster library, and I just want to make >> something sure: >> >> int segment, selector; >> >> segment = __dpmi_allocate_dos_memory(size, selector); >> >> Which variable must I put in the ES register, which in EDI? >Where do ES or EDI come in for the above snippet? Can you elaborate? Ok, sorry. I want to do the sound mixing in asm. I want to use 'stosb' and 'movsb' etc. that needs es:edi. The memory i am allocating is for the DMA transfers. I have played around a bit, but something strange happens. I get the segment by doing this: long unsigned segment; int selector; segment = __dpmi_allocate_dos_memory(size, &selector) << 4; but when I use: _farnspokeb(segment, 0); I get a general fault protection error, but: _farpokeb(_dos_ds, segment, 0); gives no error. Is this correct? Any reason? (I am still getting the grips with protected mode etc.) Secondly, what is the use for the 'selector' variable, other than using it in '__dpmi_free_dos_memory(selector)' ? Or I going about this in totaly the wrong way? Thanks. Leon to: IN:eliz AT is DOT elta DOT co DOT il cc: IN:djgpp AT delorie DOT com