Mail Archives: djgpp/1998/02/25/06:30:27
Richard M. Myers wrote:
>
> Hi,
>
> Is there a DJGPP guru out there who can show me some code which I can
> use to replace the following references to FP_SEG and FP_OFF:
>
> srb->buf_seg = FP_SEG(buf);
> srb->buf_off = FP_OFF(buf);
It depends.
First, if buf is a pointer variable you are probably mistaken because
djgpp uses flat addressing mode, which means that it does not know the
concept of segmented addressing. So you have only a 32-bit offset, no
segment address. Therefore it is not possible to convert this 'buf'
value into a (seg, ofs) pair.
Second possibility, you mean that buf is a linear address below the 1 MB
mark, in this case you can split this linear address into a real mode
segment address and an offset, which you can pass in turn to some
real-mode running program (like DOS). This is explained quite
understandable in the FAQ IIRC.
BTW there are a dozen of other possibilities. A little more
specifications on your part would be welcome.
> P.S. Please email me if you can help as I don't follow this group
How rude.
--
\ Vik /-_-_-_-_-_-_/
\___/ Heyndrickx /
\ /-_-_-_-_-_-_/
- Raw text -