| delorie.com/archives/browse.cgi | search |
| From: | Simon <stdf23173 AT yahoo DOT co DOT uk> |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | _far pointer and etc |
| Message-ID: | <ifuo0vgqpbmbc0eje0laapktu5ro2kfssi@4ax.com> |
| X-Newsreader: | Forte Agent 1.7/32.534 |
| MIME-Version: | 1.0 |
| Lines: | 40 |
| Date: | Fri, 27 Dec 2002 08:17:28 -0800 |
| NNTP-Posting-Host: | 62.59.167.234 |
| X-Complaints-To: | abuse AT zonnet DOT nl |
| X-Trace: | zonnet-reader-1 1041005815 62.59.167.234 (Fri, 27 Dec 2002 17:16:55 MET) |
| NNTP-Posting-Date: | Fri, 27 Dec 2002 17:16:55 MET |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
Hello again,
I came up with another question related to the parallel port.
It is possible to get the baseaddress from a location some where in
memory/bios.
Well, i found a piece of code on the faq :
#include <sys/nearptr.h>
#include <crt0.h>
void * MK_FP (unsigned short seg, unsigned short ofs)
{
if ( !(_crt0_startup_flags & _CRT0_FLAG_NEARPTR) )
if (!__djgpp_nearptr_enable ())
return (void *)0;
return (void *) (seg*16 + ofs + __djgpp_conventional_base);
}
How do i call the function above ????
Cause i get
D:\Program Files\DJGPP\code>gcc hello.c > outp.txt
hello.c: In function `get_addresses':
hello.c:32: warning: dereferencing `void *' pointer
hello.c:32: void value not ignored as it ought to be
hello.c: In function `main':
hello.c:48: warning: return type of `main' is not `int'
And my the return address is remarkable large but always the same !
grtz
Simon
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |