Mail Archives: djgpp/2000/06/09/06:34:29
Gaurang Kanvinde <n8007034 AT ccs DOT iitb DOT ernet DOT in> writes:
> How do I access memory registers in C? DJGPP gcc does not recognise the
> far pointers that can be used otherwise. Instead, _farpeek and
> _farpoke functions are used.
The reason for this is explained in the FAQ and it requires some
knowledge of Protected Mode.
> Can someone tell me how to use these functions?. What are the SELECTOR
> and OFFSET arguments in these functions?
_dos_ds is the selector value (Add #include <go32.h> to your source
file) generally. The offset is the linear address. For example, if you
wanted to access the long integer value at F000:FFFF, you'd write
_farpeekl(_dos_ds, 0xffff0); // That was 0F000h * 0x10 + 0xFFFF.
Btw, I'll add some document on protected mode on my site something
today evening. You might want to check that out.
When available, it will be at http://www.midpec.com/djgpp/protmode/
Hope this helps!
- Raw text -