www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/07/31/09:50:49

Date: Tue, 31 Jul 2001 16:51:22 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Christian Merz <cmerz AT bndlg DOT de>
cc: djgpp AT delorie DOT com
Subject: Re: ds==ss why?
In-Reply-To: <3b66ad7a$0$414$7d5a4a58@news.compuserve.de>
Message-ID: <Pine.SUN.3.91.1010731164712.3973C-100000@is>
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

On Tue, 31 Jul 2001, Christian Merz wrote:

> can I change the behavior of gcc concerning that ds==ss?

Not easily.  GCC generates 32-bit code which assumes a flat address space 
with no segmentation, so it uses 32-bit addresses to reference 
variables on the stack and in the data section.  To make this work, the 
DJGPP startup code loads DS and SS with the same selector, and assumes 
that these selectors stick.  If you break this assumption, programs will 
start crashing high and low, unless you modify the GCC code-generating 
back-end to produce instructions with 48-bit addresses that include the 
selector as well as the offset.

- Raw text -


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