GCC and memory segments

Jim Wilson wilson@specifixinc.com
Fri Sep 26 07:01:00 GMT 2003


Bernd Jendrissek wrote:
> I believe DJ Delorie has done some work on realmode x86 code generation.

This is off the link I gave.  To be a little more precise
	http://www.delorie.com/djgpp/16bit

> So how do I work with segments?

I would suggest making Pmode be PSImode.  This will let you distinguish 
pointers from integers.  You can then write PSImode patterns that know 
how to load the upper part of an address into a segment register.  This 
effectively makes every pointer a far pointer.  After you get this 
working, you can worry about optimizing it to avoid redundant segment 
register loads.

Or you could make pointers HImode, then every pointer is a near pointer.

Gcc only supports one size of pointer, so you either have to make all 
pointers near pointers or all pointers far pointers.  If you need both, 
you are out of luck.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



More information about the Gcc mailing list