delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/07/09/06:17:01

Xref: news2.mv.net comp.os.msdos.djgpp:5761
From: Charles Sandmann <sandmann AT clio DOT rice DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: MK_FP
Date: Mon, 08 Jul 1996 15:28:36 CDT
Organization: Rice University, Houston, Texas
Lines: 15
Message-ID: <31e16f74.sandmann@clio.rice.edu>
Reply-To: sandmann AT clio DOT rice DOT edu
NNTP-Posting-Host: clio.rice.edu
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I found this tidbit lying around - I don't remember what it was for or 
even if it worked, but I didn't delete it...

/* MK_FP routine for DJGPP.  seg must be a DOS memory offset */
#include <stdio.h>
#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())
       exit(printf("Should have used farptr.h, dude!\n"));
   return (void *)(seg*16 + ofs + __djgpp_conventional_base);
}

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019