www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/10/16/19:24:00

Message-ID: <3265850F.7EE9@gbrmpa.gov.au>
Date: Thu, 17 Oct 1996 08:59:59 +0800
From: Leath Muller <leathm AT gbrmpa DOT gov DOT au>
Reply-To: leathm AT gbrmpa DOT gov DOT au
Organization: Great Barrier Reef Marine Park Authority
MIME-Version: 1.0
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
CC: djgpp AT delorie DOT com
Subject: Re: VESA pointers ... again
References: <Pine DOT SUN DOT 3 DOT 91 DOT 961016140445 DOT 22571C-100000 AT is>

> > What would the correct order of the
> > seg:offset in the Vesamode variable be: is it HiWord = Segment, LoWord ==
> > Offset, or the other way around? 

> Usually, if the far pointer is a 32-bit int, its higher 16 bits are the
> segment and lower 16 bits are the offset.

Bascially, this is right... :) But its still kinda strange how it is
stored. The segment (4 bits) is stored in the most significant bits of
the first data _word_ and the offset is stored in the second _word_. The
VESA mode specs stats that you have to declare the pointer as a long,
or 4 bytes.

To get the correct address you need to do something like:

In your structure, have:
	unsigned long VesaModeList;
In your program have:
	unsigned int DosAddress;
	DosAddress = ((VesaModeList & 0xFFFF0000) >> 12)
		| (VesaModeList & 0xFFFF);

Leathal.

- Raw text -


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