Date: Wed, 22 Jul 1998 11:41:47 +0300 (IDT) From: Eli Zaretskii To: ALMICHVL cc: djgpp AT delorie DOT com Subject: Re: far pointers and fp_seg In-Reply-To: <1998072204331500.AAA16520@ladder03.news.aol.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On 22 Jul 1998, ALMICHVL wrote: > hi i tried to run the following code in DJGPP but i having trouble is there > anyone that can help ME? The DJGPP FAQ can help you (see section 18.4 there). > i want to extract the segment and the offset from a far pointer -USER FRONT > USING FP_SEG' and `FP_OFF) . > > _farpokeb(0x0000, 0x010e, FP_SEG(font)); > _farpokeb(0x0000, 0x010c, FP_OFF(font)); > } This won't work. _farpokeb is not just a replacement for poke in real-mode DOS compilers. You need to understand what you are doing, to port such code to protected-mode programs. Something like the following should work: _farpokew(_dos_ds, 0x010e, font_segment); _farpokew(_dos_ds, 0x010c, font_offset); You didn't explain where does UserFont come in the code which uses this, so I cannot tell you how to compute font_segment and font_offset. Also, please note that you should use _farpokew, not _farpokeb, since segment and offset are 16-bit integers, not bytes.