Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #2547

Re: The different groups and segments of object files

From gah4@u.washington.edu
Newsgroups comp.compilers
Subject Re: The different groups and segments of object files
Date 2020-07-02 00:36 -0700
Organization Compilers Central
Message-ID <20-07-001@comp.compilers> (permalink)
References <20-06-004@comp.compilers> <20-06-005@comp.compilers> <20-06-023@comp.compilers> <20-06-024@comp.compilers>

Show all headers | View raw


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.

Back to comp.compilers | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

The different groups and segments of object files Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.com> - 2020-06-19 23:22 +0800
  Re: The different groups and segments of object files gah4@u.washington.edu - 2020-06-19 14:12 -0700
    Re: The different groups and segments of object files gah4@u.washington.edu - 2020-06-21 01:50 -0700
    Re: The different groups and segments of object files Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2020-06-25 22:41 +0800
    Re: The different groups and segments of object files Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2020-06-25 22:40 +0200
      Re: The different groups and segments of object files Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2020-06-26 00:09 +0200
        Re: The different groups and segments of object files gah4@u.washington.edu - 2020-07-02 00:36 -0700
  Re: The different groups and segments of object files Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2020-06-20 16:01 +0200
    Re: The different groups and segments of object files Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2020-06-25 23:13 +0800
      Re: The different groups and segments of object files Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2020-06-25 22:52 +0200

csiph-web