delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/05/11/03:50:42

From: DavMac AT iname DOT com (Davin McCall)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: buffer pointer....
Date: Tue, 11 May 1999 07:18:28 GMT
Organization: Monash Uni
Lines: 31
Distribution: world
Message-ID: <3737d89d.3571236@newsserver.cc.monash.edu.au>
References: <3737CA29 DOT 313E459B AT geocities DOT com>
NNTP-Posting-Host: damcc5.halls.monash.edu.au
X-Trace: towncrier.cc.monash.edu.au 926407084 239 130.194.198.138 (11 May 1999 07:18:04 GMT)
X-Complaints-To: abuse AT monash DOT edu DOT au
NNTP-Posting-Date: 11 May 1999 07:18:04 GMT
X-Newsreader: Forte Free Agent 1.1/32.230
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

In most cases, it's not possible. You'd probably have to go to a lot
of trouble to make it possible. That's because 20 bit seg:offs style
addresses can only exist within the first megabyte of the address
space, and your programs memory (generally) lies beyond that region.

If you *must* use segment:offset style addresses and *really* don't
want to use djgpp_near_pointer_enable(), you could allocate some
memory in the 1st MB region and use dosmemput to transfer data to it.
I believe there are DPMI functions to allocate memory in that region.

I also believe there is stuff in the FAQ about dealing with the 'real
mode' region of memory (ie the 1st MB).

Davin.

On Tue, 11 May 1999 01:11:53 -0500, Derek
<removethismerlin__ AT geocities DOT com> wrote:

>Hello...
>  I was curious how I would get a segment:offset pair from a 32 bit
>address in djgpp?
>why you may ask? Because I need to get the segment:offset pair of a
>pointer to calculate it's 20 bit absolute address so I can use it in my
>sound routine(I'm *trying* to avoid using
>djgpp_near_pointer_enable();)....
>but being relativly new to protected mode programming I haven't a clue
>how to do this...

__________________________________________________________
       *** davmac - sharkin'!! davmac AT iname DOT com ***
my programming page: http://yoyo.cc.monash.edu.au/~davmac/

- Raw text -


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