Separate data and function address spaces

Chip Salzenberg chip at ateng.com
Fri Nov 10 09:01:17 AEST 1989


According to chris at mimsy.umd.edu (Chris Torek), about the PDP-11:
>One of the (somewhat less frequently used) capabilities was what was
>called `split I&D', in which each machine address had to be qualified
>with `instruction' or `data' before it was unique.  There were two
>separate locations 0400, one containing code, and one containing data.

Recent processors also have this "feature".  When the '286 and '386
processors are in protected mode -- i.e. when they're running Unix
-- they do not permit program execution from any data segment. This
restriction can be bypassed only by the subterfuge of pointing two
segment descriptors at the same piece of memory. 

I happen to think it's a feature.  So sue me.

>	char *p;
>	int fn();
>	p = (char *)fn;
>
>is non-portable.

Definitely.  It's too bad that Kyoto Common Lisp includes code like this.
KCL won't run on '386s.
-- 
You may redistribute this article only to those who may freely do likewise.
Chip Salzenberg at A T Engineering;  <chip at ateng.com> or <uunet!ateng!chip>



More information about the Comp.lang.c mailing list