Mail Archives: djgpp/1998/07/22/05:05:37
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.
- Raw text -