🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.micro.pc
Article #6752

Segment Registers -- 8086/80286

#6752
From: skip
Date: Sun, 01 Jun 1986 23:50
35 lines
2350 bytes
In article <146@apr.UUCP> las@apr.UUCP (Larry Shurr) writes:
> ...
>I haven't tried to bring up 3.6 yet, but I have brought up 3.5.  The
>D model works great iiiiiiffffffff..... you also use the -s switch
>(or use -mds if you compile with lc).  This tells the compiler that
>you don't want him to "normalize" all pointers and all results of
>pointer arithmetic.  A normalized pointer is one in which the offset
>is always in the range 0x0 - 0xF and the segment is pointing at the
>appropriate paragraph.  For example:
>
>	0900:1237	is converted to		0A23:0007
>
>The advantages include: comparisons between arbitrary pointers are
>meaningful and addressing (using pointers) > 64k of data.  Disadvantage
>is significant CPU time consumed normalizing pointers.
> ...

... and if you ever plan on writing programs for the i80286, don't
"normalize" pointers.  To paraphrase some Microsoft documentation:

	When a program loads a segment register on an 8086, it is
	actually loading a displacement value.  On the 80286, what
	is loaded is actually a segment number indexing to an entry
	in the master segment table.  The actual displacement value
	is loaded from that table.  There is NO relation between
	segment N and segment N+1 (ie N+1:0 != N:10h).

I assume that they're talking about the protected mode of the 286.  Since
DOS presently doesn't use the protected mode, you're OK for now.  Still,
any programming practice which counts on two segment:offset pairs pointing
to the same place in memory will need to be changed before DOS 5.0.
If segment:offset pairs are used properly, normalization is not needed.

-- Skip Addison
   {lll-crg, decwrl, ihnp4}!amdcad!cae780!ubvax!skip
Technical Details
Message-ID: <494@ubvax.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!linus!philabs!cmcl2!seismo!caip!princeton!allegra!ulysses!bellcore!decvax!decwrl!pyramid!pesnta!amd!amdcad!cae780!ubvax!skip
References: <165@sci.UUCP> <146@apr.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!linus!philabs!cmcl2!seismo!caip!princeton!allegra!ulysses!bellcore!decvax!decwrl!pyramid!pesnta!amd!amdcad!cae780!ubvax!skip
From: skip@ubvax.UUCP
Newsgroups: net.micro.pc
Subject: Segment Registers -- 8086/80286
Message-ID: <494@ubvax.UUCP>
Date: Sun, 1-Jun-86 19:50:50 EDT
Article-I.D.: ubvax.494
Posted: Sun Jun  1 19:50:50 1986
Date-Received: Thu, 5-Jun-86 06:41:58 EDT
References: <165@sci.UUCP> <146@apr.UUCP>
Reply-To: skip@ubvax.UUCP (Skip Addison)
Organization: Ungermann-Bass, Inc., Santa Clara, Ca.
Lines: 35
Keywords: 286 segment registers