Mail Archives: djgpp/1996/12/16/20:48:18
Aaron m Clemmer writes:
> How do you get the protected mode selector and offset of __tb, or
>any buffer in conventional memory? I thought you could just use the
>address of __tb as a selector, and leave the offset as 0, but that just
>GPFed... I tried looking in the faq, but it wasn't very clear about
>anything but getting rmode segs and offs...
You got that the wrong way round... The address of __tb is the protected
mode offset, and _dos_ds is the selector. For example, to write 0 to the
first byte of the transfer buffer, write:
_farpokeb(_dos_ds, __tb & 0xFFFFF, 0);
I'm not 100% sure why it's neccessary to mask of the high bits of the
address, but that's what Eli's FAQ says you should do :-)
/*
* Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
* Ghoti: 'gh' as in 'enough', 'o' as in 'women', and 'ti' as in 'nation'.
*/
- Raw text -