Mail Archives: djgpp/1999/05/12/03:00:24
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.
- Raw text -