🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #2541

Re: Self-modifying code

#2541
From: Tim Olson
Date: Thu, 12 Oct 1989 14:04
22 lines
1488 bytes
In article <6481@pt.cs.cmu.edu> koopman@a.gp.cs.cmu.edu (Philip Koopman) writes:
| In my case, the self-modification is limited to changing the
| addresses of subroutine call instructions.  If a RISC architecture
| such as the R2000 had a jump to subroutine that took an address
| out of the data cache (perhaps by using the suceeding word
| in memory as an address, referenced through the data cache)
| this would be good enough for my application.

But it does!  The R{2,3}000, SPARC, Am29000, (and 88K, I believe) all
have the ability to perform a register-indirect call, where the target
of the call is sourced from a general-purpose register.  These
instructions normally are used to build "big" addresses, but can be
used in your application simply by loading the modified address into
the register before performing the call.

A similar technique for branches is normally used for performing
"switch" statements via a jump table stored in data memory.


	-- Tim Olson
	Advanced Micro Devices
	(tim@amd.com)
Technical Details
Message-ID: <27743@amdcad.AMD.COM>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!amdcad!cayman!tim
References: <1080@mipos3.intel.com> <6481@pt.cs.cmu.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!amdcad!cayman!tim
From: tim@cayman.amd.com (Tim Olson)
Newsgroups: comp.arch
Subject: Re: Self-modifying code
Message-ID: <27743@amdcad.AMD.COM>
Date: 12 Oct 89 14:04:54 GMT
References: <1080@mipos3.intel.com> <6481@pt.cs.cmu.edu>
Sender: news@amdcad.AMD.COM
Reply-To: tim@amd.com (Tim Olson)
Organization: Advanced Micro Devices, Austin, TX
Lines: 22