www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/01/10/07:56:36

Date: Sun, 10 Jan 1999 13:52:09 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Alex Lowe <ayin AT 2xtreme DOT net>
cc: djgpp AT delorie DOT com
Subject: Re: Pointer to memory
In-Reply-To: <36985DB7.C5C7D160@2xtreme.net>
Message-ID: <Pine.SUN.3.91.990110135031.20678h-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

On Sat, 9 Jan 1999, Alex Lowe wrote:
> And I want to have the pointers added, for example if the segement is
> 0xAA and the offset is 0x03 then I can make a pointer to 0xAD...

This is wrong.  You need to shift the segment 4 bits to the left before 
adding the offset.  So the pointer is 0xAA3, not 0xAD.

> The code I am trying to port looks like this:
> 
> char *offset=regs.x.bp;
> char *segment=regs.x.es;
> 
> char *font=*MK_FP(segment, offset);

The FAQ describes how to do these things in DJGPP.  See sections 18.2 and 
18.4 there.

- Raw text -


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