Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!ginosko!uunet!crdgw1!crdos1!davidsen From: davidsen@crdos1.crd.ge.COM (Wm E Davidsen Jr) Newsgroups: comp.arch Subject: Re: Self-modifying code Summary: It's been done Message-ID: <1032@crdos1.crd.ge.COM> Date: 12 Oct 89 15:05:46 GMT References: <6481@pt.cs.cmu.edu> <9175@etana.tut.fi> Reply-To: davidsen@crdos1.UUCP (bill davidsen) Organization: GE Corp R&D Center Lines: 27 In article <9175@etana.tut.fi>, pl@etana.tut.fi (Lehtinen Pertti) writes: | I've been lately wondering if there is any architecture | with possibility to execute instruction indirectly. Among others the GE-600 series, currently marketed as the Honeywell DPS. It has an execute and execute double (execute two instructions at location) to use. One use of self-modifying code is to get around bad hardware design, such as making i/o port numbers immediate addresses. If this is the case, as it has been on a number of machines, you either need to have one device driver per port or modify the code. There was some such limitation on the DPS, and the way I got around it, rather than write self modifying code, was to build the instruction I needed on the stack and do a XEC on it. This was useful on the models which support pure code segments. I think the 8080 had i/o port as part of the address of the instruction, and the Z80 added the ability to have the port address in a register. Someone will undoubtedly remember it better than I do. -- bill davidsen (davidsen@crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen) "The world is filled with fools. They blindly follow their so-called 'reason' in the face of the church and common sense. Any fool can see that the world is flat!" - anon