Mail Archives: djgpp/1998/04/18/12:11:00
> i would like to know how i can find out which segment a pointer
> points to, after mallocing a chunk of memory.
It points to %ds, like every other pointer in djgpp, because djgpp is
always in tiny model.
> (question 2 : do pointers contain segments or are they just offsets)
Pointers contain only offsets.
> (question 3 : if they are only offsets, which selector do i use with
> them)
The convenience functions _my_ds(), _my_cs(), and _my_ss() can be used
to get the current selector values. Or, you can use assembler to load
them yourself. Unless you're interfacing with hardware or MS-DOS, you
shouldn't need to worry about selectors. Most of the times that you
*are* interfacing with dos or bios, you probably could use
dosmmemput() or dosmemget() instead.
- Raw text -