delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/26/10:13:09

Date: Sun, 26 Jan 1997 16:58:25 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Gregary J Boyles <boylesgj AT lion DOT cs DOT latrobe DOT edu DOT au>
cc: djgpp AT delorie DOT com
Subject: Re: Segment/Offset vs Selector/Offset.
In-Reply-To: <5cd3ca$5eo@lion.cs.latrobe.edu.au>
Message-ID: <Pine.SUN.3.91.970126165424.6498G-100000@is>
MIME-Version: 1.0

On 25 Jan 1997, Gregary J Boyles wrote:

> Can some one briefly explain offset/selector to me.
> Is it similar to segment/offset where the high byte of an address is the segment
> address and the low byte is the offset?

Did you read section 18.4 of the DJGPP FAQ list (available as 
v2/faq210b.zip from the same place you get DJGPP)?  I think it should 
explain these things to you; if not, ask specific questions about what's 
described there.

> // Determines the height and width of the screen.
> void WindowC::GetDimensions()
> {
>   // We need a 64 byte buffer for the display info returned by the interrupt
>   // function.
>   static unsigned char Buffer[64];
> 
>   Regs.w.bx=0x0;
> 
>   // Place the segment and offset into es:di.
>   SegRegs.es=Seg(Buffer);
>   Regs.w.di=Off(Buffer);

The usual method is to use the transfer buffer for these things.  Section 
18.2 of the FAQ explains how to do that.

- Raw text -


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