PDP-11 data and function address spaces (was External ptrs and arrays)

Chris Torek chris at mimsy.umd.edu
Thu Nov 9 18:51:06 AEST 1989


In article <11567 at smoke.BRL.MIL> gwyn at smoke.BRL.MIL (Doug Gwyn) writes:
>By the way, the PDP-11 is the main example of a system where data and
>function address spaces are distinct ....

Before anyone jumps in and `corrects' Doug with stories of 11s in their
college days (`why, when I was a boy, we had to carry our 11/40s 5 miles
uphill through the snow to school each day, and 5 miles uphill back home
again, where we could not even use it since the electricity was all DC,
and . . .' :-) ), you should realise that PDPs came in different models
and had different operating systems that used different capabilities.
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.

This is reflected in C in that

	char *p;
	int fn();

	p = (char *)fn;

is non-portable, and hence, even after such an assignment, the result of

	(*(int (*)())p)();

is at best non-standard.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at cs.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.lang.c mailing list