Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uunet!ateng!chip From: chip@ateng.com (Chip Salzenberg) Newsgroups: comp.lang.c Subject: Re: Separate data and function address spaces Message-ID: <2559F3AE.9260@ateng.com> Date: 9 Nov 89 22:01:17 GMT References: <530@dftsrv.gsfc.nasa.gov> <225800239@uxe.cso.uiuc.edu> <11567@smoke.BRL.MIL> <20642@mimsy.umd.edu> Organization: A T Engineering, Tampa, FL Lines: 25 According to chris@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; or