Mail Archives: djgpp/2001/07/31/09:50:49
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 -