Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!aplcen!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: How can a CDEV "talk" to its INIT? Message-ID: <9284@hoptoad.uucp> Date: 14 Dec 89 05:47:14 GMT References: <8183@cs.yale.edu> <871@excelan.COM> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 33 From article <8183@cs.yale.edu>, by kishon-amir@CS.Yale.EDU (amir kishon): >> I would like to write a CDEV that can change the global variables of a >> patch to GetNextEvent (the patch was done by an INIT that I wrote). >> How can I have both the CDEV and the patch (INIT) point to the same >> global variables, so the CDEV can change those values? In article <871@excelan.COM> mahboud@kinetics.com (Mahboud Zabetian, Kinetics,4511,9457194,) writes: >Make the first instruction in your init be a JMP to the third instruction. >Make the second instruction be a JMP to code that will set up your globals >for you(these globals will probably be imbedded in your patch). > >Now when you change the settings in the cdev, load in your init resource, >and jump to 2(A0) where A0 is the begining of the code. No, INIT resources don't stick around *as* *resources* past the closing of their file during the INIT 31 procedure. There's no way to find out where the resource is after the INIT process has finished. Presumably, it's loaded itself (or possibly a separate resource) into the system heap or above BufPtr, but exactly where is up for grabs. The same goes of globals. They will not be loaded in at some fixed address on the machine, but wherever there happened to be space at the time the INIT was run by INIT 31. You can't figure anything out from the trap address either, because your INIT was not necessarily the last thing to patch the trap. -- Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com FROM THE FOOL FILE: "Yet another piece of evidence that it's a Communist society which is being presented as good, but which we probably would not want to live in." -- Ken Arromdee on rec.arts.startrek, on the Federation's Red Menace