www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/06/14/19:46:03

Message-Id: <5.0.2.1.1.20010615092912.00a8ca10@rsbsgpo.anu.edu.au>
X-Sender: siebke AT rsbsgpo DOT anu DOT edu DOT au
X-Mailer: QUALCOMM Windows Eudora Version 5.0.2
Date: Fri, 15 Jun 2001 09:44:47 +1000
To: djgpp AT delorie DOT com
From: Katharina Siebke <siebke AT rsbs DOT anu DOT edu DOT au>
Subject: still fighting with DOS, here memory allocation
In-Reply-To: <Pine.SUN.3.91.1010614154402.6220B-100000@is>
References: <20010614133028 DOT EFDE DOT H DOT M DOT BRAND AT hccnet DOT nl>
Mime-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

Hi group, this is my first question to you.
I hope I am in the right place to ask this question:
who still knows DOS?
I have got a program wich contains this code:
-----------------------------------------------------------------------------------------------------------
/* this is just to recall the definition */

typedef struct {
   unsigned short offset16;
   unsigned short segment;
} __dpmi_raddr;

This structure is used to hold a real-mode address, which consists of a 
segment:offset pair.

typedef struct {
   unsigned long  offset32;
   unsigned short selector;
} __dpmi_paddr;
-------------------------------------------------------------------------------------------------------------

static __dpmi_raddr dosside;       /*dos address of  buffer*/
static __dpmi_paddr protectside; /*protect side of  buffer*/
int sel,

dosside.offset16=0;
dosside.segment = __dpmi_allocate_dos_memory((MEM_BLOCK+15)>>4, &sel);
protectside.selector= (unsigned short) sel;


My question is, are these both pointers:
dosside.segment and protectside.segment really show to the same piece of 
memory.
Or in other words how does an integer pointing to a piece of memory 
translated into the given structure.

Who can help me with that?
Thank you Katharina


- Raw text -


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