Path: utzoo!mnetor!uunet!husc6!uwvax!oddjob!gargoyle!ihnp4!chinet!dag
From: dag@chinet.UUCP (Daniel A. Glasser)
Newsgroups: comp.lang.c
Subject: Re: Variable function names
Message-ID: <1994@chinet.UUCP>
Date: 16 Dec 87 23:12:49 GMT
References: <973@russell.STANFORD.EDU> <47000025@uxe.cso.uiuc.edu> <3826@uw-june.UUCP>
Reply-To: dag@chinet.UUCP (Daniel A. Glasser)
Organization: Chinet - Public Access Unix
Lines: 26
Keywords: architecture

In article <3826@uw-june.UUCP> pardo@uw-june.UUCP (David Keppel) writes:
>[ why don't all machines let us execute code stored in an array ]
>
>Some machines make optimizations about where the executable code and
>data live, and trying to execute code from the data region breaks some
>of those optimizations.  [OK, not many, but a *few*]
>
[trailing stuff removed.]

To be more specific, many machines have separate instruction and data
address spaces, and unless they are mapped together, you cannot directly
execute the contents of arrays, since all instruction fetches will be
done from the instruction space and the array contents are stored in
the data address space.  The M68000 is capable of this separation, some
PDP-11's support I/D separation, the Intel 8086, Zilog Z8001/3, Intel 8051,
and many other "current" machines have this, but on systems where it is
supported you usually have the choice not to use it.

This particular discussion should move over to comp.arch, since it is
not a language issue.
-- 
					Daniel A. Glasser
					...!ihnp4!chinet!dag
					...!ihnp4!mwc!dag
					...!ihnp4!mwc!gorgon!dag
	One of those things that goes "BUMP!!! (ouch!)" in the night.