Date: Wed, 12 May 1999 09:58:13 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: djgpp AT delorie DOT com Subject: Re: buffer pointer.... In-Reply-To: <3737CA29.313E459B@geocities.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Tue, 11 May 1999, Derek wrote: > I was curious how I would get a segment:offset pair from a 32 bit > address in djgpp? You can't. The data of your protected-mode programs almost always sits above the 1MB mark, and real-mode seg:off addresses are only 20-bit wide, so they can only address the first megabyte of memory. The solution is to move the data to a buffer in the low memory and pass the seg:off address of that buffer. > why you may ask? Because I need to get the segment:offset pair of a > pointer to calculate it's 20 bit absolute address so I can use it in my > sound routine(I'm *trying* to avoid using > djgpp_near_pointer_enable();).... > but being relativly new to protected mode programming I haven't a clue > how to do this... I think sections 18.2 and 18.4 of the DJGPP FAQ list have enough information about this to get you off the ground.