From: Prashant TR Newsgroups: comp.os.msdos.djgpp Subject: Re: far pointers Date: 09 Jun 2000 13:41:39 +0530 Organization: VSNL Lines: 23 Message-ID: References: <39405DEE DOT 89226F7B AT ccs DOT iitb DOT ernet DOT in> NNTP-Posting-Host: ppp-181-126.bng.vsnl.net.in X-Trace: news.vsnl.net.in 960576223 6828 203.197.181.126 (9 Jun 2000 18:43:43 GMT) X-Complaints-To: postmaster AT news DOT vsnl DOT net DOT in NNTP-Posting-Date: 9 Jun 2000 18:43:43 GMT X-Newsreader: Gnus v5.7/Emacs 20.5 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Gaurang Kanvinde 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 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!