Date: Thu, 9 Jul 1998 19:17:40 +0300 (IDT) From: Eli Zaretskii To: Endlisnis cc: djgpp AT delorie DOT com Subject: Re: GNU pointers In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Wed, 8 Jul 1998, Endlisnis wrote: > On Wed, 8 Jul 1998, Mark Bidewell wrote: > ->Does GNU have a way to synthesize pointer addresses (segment : offset) for > ->their component parts? > If you have > void* p; > short seg = (short)(((int)p>>4)&0xFFFF); > short off = (short)((int)p & 0xF); > > I believe that will do the trick. (But only if your original > address was below 1M). This will NOT work in DJGPP, exactly because all the addresses of the variables in DJGPP programs are *above* the 1MB mark.