Mail Archives: djgpp/1998/12/21/09:53:31
On Tue, 22 Dec 1998, Tim Czvetics wrote:
> I am writing some code in which I use a pointer to an unsigned char, and I
> need to find the segment and offset of that pointer. How do I go about doing
> it?
You don't ;-). Protected-mode pointers cannot be expressed as a segment
and an offset, because your program puts data in extended memory, above
1MB mark, while the real-mode segment:offset addresses can only address
the first megabyte.
The DJGPP FAQ list (v2/faq211b.zip from the same place you get DJGPP)
explains in chapter 18 how to call real-mode services that require
seg:off pointers to buffers. Please read it.
- Raw text -