Mail Archives: djgpp/1997/04/09/22:04:09
Andrew Crabtree wrote:
>
> I know there is also a near pointer concept in djgpp. I am not sure what it
> does exactly (although I assume it allows you to access memory not normally
> in your selector with just a 32 bit offset ?)
To use near pointers, you simply set the global ds selector to -1
(0xffffffff), which allows you to address any location in memory without
generating a segmentation violation. Then you can write to any absolute
address by adding the global variable __djgpp_conventional_base to the
absolute address (thus, video memory would be at 0xa0000 +
__djgpp_conventional_base). The header file <dpmi.h> declares two
functions: __djgpp_nearptr_enable() and __djgpp_nearptr_disable(), that
handle the selector settings for you. Look them up in the libc
reference for more information, and also look at chapter 10 of the DJGPP
FAQ.
--
John M. Aldrich <fighteer AT cs DOT com>
* Anything that happens, happens.
* Anything that, in happening, causes something else to happen,
causes something else to happen.
* Anything that, in happening, causes itself to happen again, happens
again.
* It doesn't necessarily do it in chronological order, though.
--- Douglas Adams
- Raw text -