Re: The different groups and segments of object files

gah4@u.washington.edu
Thu, 2 Jul 2020 00:36:28 -0700 (PDT)

          From comp.compilers

Related articles
[3 earlier articles]
Re: The different groups and segments of object files gah4@u.washington.edu (2020-06-21)
Re: The different groups and segments of object files johann@myrkraverk.invalid (Johann 'Myrkraverk' Oskarsson) (2020-06-25)
Re: The different groups and segments of object files johann@myrkraverk.invalid (Johann 'Myrkraverk' Oskarsson) (2020-06-25)
Re: The different groups and segments of object files DrDiettrich1@netscape.net (Hans-Peter Diettrich) (2020-06-25)
Re: The different groups and segments of object files DrDiettrich1@netscape.net (Hans-Peter Diettrich) (2020-06-25)
Re: The different groups and segments of object files DrDiettrich1@netscape.net (Hans-Peter Diettrich) (2020-06-26)
Re: The different groups and segments of object files gah4@u.washington.edu (2020-07-02)
| List of all articles for this month |

From: gah4@u.washington.edu
Newsgroups: comp.compilers
Date: Thu, 2 Jul 2020 00:36:28 -0700 (PDT)
Organization: Compilers Central
References: 20-06-004 20-06-005 20-06-023 20-06-024
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="9643"; mail-complaints-to="abuse@iecc.com"
Keywords: code, history
Posted-Date: 02 Jul 2020 10:52:52 EDT
In-Reply-To: 20-06-024

On Thursday, June 25, 2020 at 5:15:06 PM UTC-7, Hans-Peter Diettrich wrote:


(snip)




> The 16/32 bit address size prefix inverts the default address size, i.e.
> allows to use 32 bit addresses and offset registers with 16 bit code.


> I used 32 bit offsets in 16 bit code with the Borland compilers,
> disassembled the generated machine code. I never used the HUGE model.


> DoDi
> [Oh, running on a 386, sure, that would have worked. -John]


I suppose that works in real mode, but not in protected mode.


Well, I think the thing that makes OS/2 2.0 and up unusual is that
they know about both 16 bit segment descriptors and 32 bit descriptors.
That is, can run both 16 bit protected mode code and 32 bit protected
mode code.


Using both in the same program would be a little strange, though.


In any case, Watcom has a separate set of compilers for 16 bit
and 32 bit code generation. Some can be cross compilers, run on
other systems than the code they generate.


I had forgotten until I just looked it up, how the differences work.
Both use 64 bit descriptors, with origin, length, and some other bits.
For 16 bit, the length is 16 bit, with granularity of one byte.


In 286 days, I found this very useful for tracking down subscript
bounds errors by allocating a segment of the exact length.


The length field is 20 bits, but 32 bit segments have a 4K byte
granularity for length so they can describe 4GB segments.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.