Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!umd5!purdue!i.cc.purdue.edu!j.cc.purdue.edu!pur-ee!uiucdcs!uxc.cso.uiuc.edu!ccvaxa!aglew From: aglew@ccvaxa.UUCP Newsgroups: comp.arch Subject: Re: self-modifying code Message-ID: <28200108@ccvaxa> Date: 21 Feb 88 17:46:00 GMT References: <486@taux01.UUCP> Lines: 21 Nf-ID: #R:taux01.UUCP:486:ccvaxa:28200108:000:610 Nf-From: ccvaxa.UUCP!aglew Feb 21 11:46:00 1988 >[re: how to overcome the code versus data distinction] > >To allow data to be safely treated as code... > > #include > if (modech(startadd, endadd, TO_CODE) == -1) > error ("could not change data into code for execution"); > >Rahul Dhesi UUCP: !{iuvax,pur-ee,uunet}!bsu-cs!dhesi That's along the right track, but won't necessarily work on strict Harvard architectures. How about int f(); f = codealloc(size); codecpyin(f,data,size); codecpyout(f,data,size); I promised Karl Heuer that I'd come up with a standard proposal - one day, maybe.