delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/01/24/21:26:49.1

From: "Marp" <Marp AT 0 DOT 0 DOT 0 DOT 0>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Help porting some 16 bit c code to DJGPP
Date: Sun, 24 Jan 1999 20:55:36 -0500
Organization: Netcom
Lines: 43
Message-ID: <78gius$c9e@dfw-ixnews11.ix.netcom.com>
References: <1a49fd10 DOT 36aa53d9 AT aol DOT com>
NNTP-Posting-Host: prn-nj1-21.ix.netcom.com
X-NETCOM-Date: Sun Jan 24 7:55:40 PM CST 1999
X-Newsreader: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

You should read chapter 18 of the djgpp faq. Read the whole chapter.

Apester000 AT aol DOT com wrote in message <1a49fd10 DOT 36aa53d9 AT aol DOT com>...
>Hi, I'm trying to convert a snippet of code that will find a 64k boundary
in
>memory for a DMA wav player program I'm writing.  I've found some code to
do
>this, but it's written for borland c 3.1, and I'm new to DJGPP and don't
know
>how to port it, since it contains references to segments and offsets.
Here's
>the code:
>
>void sbmalloc ( void )
>{
>    char *data;
>    char *aligned, *aligned_physical;
>    unsigned long physical;
>    data=farmalloc(131000L);
>    if(data==NULL)
>    {
>        printf("Memory Allocation Error\n");
>        exit(1);
>    }
>    physical=((unsigned long)FP_OFF(data))+(((unsigned
long)FP_SEG(data))<<4);
>    physical+=0x0FFFFL;
>    physical&=0xF0000L;
>    aligned_physical=(physical>>16)&15;
>    aligned=MK_FP(((unsigned short)aligned_physical<<12)&0xF000,0);
>}
>
>
>I understand what the code is doing, but how do I find the physical address
of
>'data'?  Also, what is the equivelant (if there is one) of MK_FP?  Thanks
in
>advance for any help you guys can offer.
>
>Brandon Tallent
>Apester000 AT aol DOT com


- Raw text -


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