Date: Mon, 21 Dec 1998 16:52:25 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Tim Czvetics cc: djgpp AT delorie DOT com Subject: Re: Question from a beginner In-Reply-To: <75licm$pm9$1@toto.tig.com.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com 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.