[comp.arch] Why did Intel do it this way?

ts@cup.portal.com (Tim W Smith) (06/10/89)

The recent "discussion" here about the Intel processors has
reminded me of something I have wondered about for quite a
while.  I've asked about this on comp.sys.intel, but have
never received an answer, so I thought that I would ask here.

On the 80286 in protected mode, a segment register contains
13 bits of segment number and 3 bits of other stuff.  The
3 bits of other stuff are the least significant bits.

Why didn't they put those 3 bits as the most significant bits?
If they had, then by setting up the GDT and LDT properly, one
could have a linear address space.

Someone suggested to me once that perhaps they used the three
lower bits because the table that the segment number is used
to lookup in consists of 8 byte entries, and so they don't have
to do any shifting to generate the byte offset into the table.

						Tim Smith

johnl@ima.ima.isc.com (John R. Levine) (06/12/89)

In article <19324@cup.portal.com> ts@cup.portal.com (Tim W Smith) writes:
>On the 80286 in protected mode, a segment register contains 13 bits of
>segment number and ... 3 bits of other stuff [in] the least significant bits.
>
>If they had [put them in the high bits] then by setting up the GDT and LDT
>properly, one could have a linear address space.
>
>Someone suggested to me once that perhaps they used the three
>lower bits because ... they don't have to do any shifting to generate the
>byte offset into the [segment descriptor] table.

That doesn't make sense -- this is hardware, not software, and they can wire
the segment register to the descriptor address generator any way they want.
Besides, looking up a descriptor is still so slow that it's hard to believe
they would have been worried about that micro-optimization; they didn't even
check to see if the new descriptor value is the same as the old one.

I have two theories: A) They thought that being able to mask out the privilege
bits in the low bits would be somehow easier on the programmer, e.g. this way
you can compare two descriptors to see which is greater without doing any
masking. B) If they made it too easy to do 32-bit addressing, nobody would
want a 386.
-- 
John R. Levine, Segue Software, POB 349, Cambridge MA 02238, +1 617 492 3869
{ bbn | spdcc | decvax | harvard | yale }!ima!johnl, Levine@YALE.something
Massachusetts has 64 licensed drivers who are over 100 years old.  -The Globe