Path: utzoo!mnetor!uunet!husc6!rutgers!mtunx!mtune!codas!ateng!chip
From: chip@ateng.UUCP (Chip Salzenberg)
Newsgroups: comp.unix.wizards
Subject: Re: Referencing through a null pointer
Message-ID: <257@ateng.UUCP>
Date: 4 May 88 14:39:38 GMT
References: <4729@cup.portal.com> <1988Apr24.092740.8673@utzoo.uucp> <50676@sun.uucp>
Reply-To: chip@ateng.UUCP (Chip Salzenberg)
Organization: A T Engineering, Tampa, FL
Lines: 21

In article <50676@sun.uucp> guy@gorodish.Sun.COM (Guy Harris) writes:
>(I seem to remember a claim that the '286 or '386 port of S5 has no
>location zero, and the Motorola 68K port may also have no location zero;
>alas, none of the fixes made to programs that broke got folded back into
>the mainstream S5 releases.)

The following comments apply to the '286 in protected mode.

In small and medium models (<= 64K of data), it is possible to set up the
data segment so that offset zero doesn't exist.  I don't know of any
implementations that bother to do this.  (Which is unfortunate.)

In compact and large models (data limited only by memory/swap space), a
NULL pointer is (in all implementations I know of) 32 bits of zeros.  This
value for NULL causes a protection trap whenever it is dereferenced, since
the '286 defines segment selector zero to mean "no segment".

-- 
Chip Salzenberg                "chip@ateng.UU.NET" or "codas!ateng!chip"
A T Engineering                My employer may or may not agree with me.
  "I must create a system or be enslaved by another man's." -- Blake