🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.micro.pc
Article #6771

Re: microemacs 3.6 on ibm pc with lattic

#6771
From: jrv
Date: Wed, 04 Jun 1986 13:41
52 lines
3145 bytes


>... 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


Lattice's handling of 4 byte pointers has advantages which allows you to
do things which other implementations of C on the 8086 family do not.
The one thing which has saved me on a number of occassions is the ability
to have an array which goes beyond the 64k segment size. This array must
be dynamically allocated at run time but it can be as big as all of the
available memory.

When using large data model without the '-s' option the normalizing of
pointers is a side effect of Lattice's pointer handling. For any arithmetic
operations on a pointer Lattice will convert the pointer(s) in question
to real 20 bit addresses perform the calculation or comparision and then
provide a normalized 4 byte pointer as a result. These operations are all
done by compiler functions. (I once attempted to rewrite all these functions
so that any NULL pointer references could be trapped. NULL pointer
references in large data model can have disastrous effects, i.e. crash
hard disks with a single store.) Presumably, a compiler for the 286
protected mode would have to perform the proper real address computation
using the values in the master segment table.

Because of the architecture of the 8086 and 80286 I know of no other
way to do the pointer operations to get access to data which exceeds the
size of one segment. Is there another "proper" way to use segment:offset
pairs? (An Intel rep suggested that I wait until the 386 is available!)


Jim Vallino
Siemens Research and Technology Lab.
Princeton, NJ
{allegra,ihnp4,seismo,philabs}!princeton!siemens!jrv
Technical Details
Message-ID: <23900021@siemens.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!allegra!princeton!siemens!jrv
References: <165@sci.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: $Revision: 1.6.2.14 $; site siemens.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!allegra!princeton!siemens!jrv
From: jrv@siemens.UUCP
Newsgroups: net.micro.pc
Subject: Re: microemacs 3.6 on ibm pc with lattic
Message-ID: <23900021@siemens.UUCP>
Date: Wed, 4-Jun-86 09:41:00 EDT
Article-I.D.: siemens.23900021
Posted: Wed Jun  4 09:41:00 1986
Date-Received: Sat, 7-Jun-86 04:26:39 EDT
References: <165@sci.UUCP>
Lines: 52
Nf-ID: #R:sci:-16500:siemens:23900021:000:2492
Nf-From: siemens!jrv    Jun  4 09:41:00 1986