Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!zephyr.ens.tek.com!tektronix!percy!parsely!psueea!eecs.cs.pdx.edu!bartonr From: bartonr@eecs.cs.pdx.edu (Robert L Barton) Newsgroups: comp.sys.amiga Subject: Re: BCPL vs. 2.0 Message-ID: <2915@psueea.UUCP> Date: 28 May 90 11:11:25 GMT Sender: news@psueea.UUCP Reply-To: bartonr@eecs.cs.pdx.edu (Robert L Barton) Organization: Portland State University, Portland, OR Lines: 29 bartonr@eecs.cs.pdx.edu (Robert L Barton) writes: RLB> You don't need 2.0 to do this. SetPatch 1.34, for example, RLB> changes the Execute() vector to make use of a resident Run command. deven@rpi.edu (Deven T. Corzine) replies: DTC> Which does not mean that the SetFunction() call works on it. It means DTC> SetPatch knows the bizarre jump format and patches that. No, SetFunction() works just fine on Execute(). SetFunction simply replaces the first two bytes with a JMP instruction and the last four with an address. Of course the return value won't be meaningful, so if you patch an entry with oldFunc = SetFunction(DOSBase, offset, newFunc) and then try to undo that by following it later with newFunc = SetFunction(DOSBase, offset, oldFunc) you would have a problem, since oldFunc would not be an absolute address, as it would be with a non-DOS function. But for one-time patching, such as in the startup-sequence, it does the trick. Also SetFunction does not change the entry in the Global Vector, so any internal calls to Execute() would still go to the original place, but I don't think there are any of these in dos.library. --------------- Robert L Barton Memorial Coliseum Portland OR