Path: utzoo!attcan!uunet!husc6!bloom-beacon!bu-cs!purdue!i.cc.purdue.edu!k.cc.purdue.edu!l.cc.purdue.edu!cik
From: cik@l.cc.purdue.edu (Herman Rubin)
Newsgroups: comp.arch
Subject: Re: Self-modifying code
Summary: And how would you call a function which is an argument?
Keywords: self modification, code generation, Seymour, CDC, FAST!
Message-ID: <835@l.cc.purdue.edu>
Date: 17 Jul 88 11:08:50 GMT
References: <5254@june.cs.washington.edu> <76700032@p.cs.uiuc.edu> <361@scolex>
Organization: Purdue University Statistics Department
Lines: 26

In article <361@scolex>, seanf@sco.COM (Sean Fagan) writes:
> In article <1276@edge.UUCP> gregr@edge.UUCP (Greg Rose) writes:
> [brief summary of the SM code discussion]

			........

> NO NO NO NO!!!!!! The CDC 6600 (and 7600, and the Crays, as well) had a Jump
> to Subroutine instruction:  RJ  (Return Jump) (on the 6600); what this
> would do is write a  into  

			........

The RJ would set up the return address, but how about the address in the call?
It is not that unusual to have subroutines or functions as arguments of called
subroutines, or computed by the program in some other way.  

I have used a program which allowed the user to decide which way something
should be done in a small subprogram, with the main program having many calls
to a dummy procedure in that module which changed the call to the desired
program.  This way the dozens of places in the main program would compile the
call to the dummy, and the first execution would change the call (and the
return at that time).
-- 
Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907
Phone: (317)494-6054
hrubin@l.cc.purdue.edu (Internet, bitnet, UUCP)