delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/08/01/00:18:24

From: Alexander von Luenen <luenen AT informatik DOT uni-bonn DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Porting Symantec code to DJGPP
Date: Mon, 28 Jul 1997 12:42:13 +0200
Organization: RHRZ - University of Bonn (Germany)
Lines: 42
Message-ID: <33DC7784.2781@informatik.uni-bonn.de>
NNTP-Posting-Host: birke.informatik.uni-bonn.de
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hello everybody!

I just got my hands on a nice C++ library. Trouble is: it is designed
for Symantec and Watcom (i.e. it uses specific syntax/functions to
access hardware and such). Since I don't own neither of these compilers,
and I definately wanna use DJGPP, I considered porting the sources.
As a matter of fact, I've never been good at 'low-level' programming and
I know next to nothing about the aforementioned compilers. So I'd be
grateful if there would be someone helping me out.
The two methods I want to port are dealing with an often discussed
matter, I know. But since I don't wanna mess with the class library's
structure, I'd need to know a 1:1 port.
The methods are (both Symantec code):
   void AMem::GetPhysPtr(long addr)
   {
      static uchar *pAllLowMem;
      if(pAllLowMem == NULL)
         pAllLowMem=_x386_map_physical_adress(0, 0xFFFFF);
      return(pAllLowMem+addr);
   }

   ushort AMem::MallocLow(ushort size)
   {
      union REGS regs;
      regs.h.ah=0x48;
      regs.x.bx=(size+15)>>4;
      int86_real(0x21, &regs, &regs);
      return (regs.x.ax);
   }
-- 
 ////////////////////////////////|\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
/                                                                \
|   "Who quotes a lot, exhibits memory rather than intelligence!" |
|   (Leonardo da Vinci)                                           |
|                                                                 |
|   Alexander von L"unen                                          |
|                                                                 |
|   E-Mail: luenen AT informatik DOT uni-bonn DOT de                         |
|                                                                 |
|   WWW: http://titan.cs.uni-bonn.de/~luenen/index.html           |
|                                                                 |
 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\|/////////////////////////////////

- Raw text -


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