Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!husc6!bbn!oberon!orion.cf.uci.edu!uci-ics!bonnie.ics.uci.edu!poleary From: poleary@bonnie.ics.uci.edu (Petey O'Leary) Newsgroups: comp.sys.mac.programmer Subject: INIT's in LSC Message-ID: <11046@paris.ics.uci.edu> Date: 1 Apr 89 02:28:39 GMT References: <1474@ccnysci.UUCP> Sender: news@paris.ics.uci.edu Reply-To: Petey O'Leary Distribution: comp.sys.mac.programmer Organization: University of California, Irvine - Dept of ICS Lines: 20 I've been trying for some time to write an INIT in LightSpeed C that will stay resident after startup (it patches a trap). Writing an INIT is easy enough in LSC, writing a memory resident (what else do you call it?) INIT is also easy enough IF you use lots of inline assembler and use only one monolithic routine. But what I want to do is take a LSC program (any LSC program, for that matter) and turn it into an INIT without having to re-write it in assembler. Inside Mac says that when INIT 31 calls an INIT file, it places a handle to the INIT resource in A0 before the call. So all I have to do is call DetachResource on it and the INIT resource will stay in memory, then I just make sure to setup A4 correctly and the thing should work. Nope. I think I have a pretty good grasp of what is going on and what needs to be done but I guess I am overlooking something. Any help would be appreciated. Thanks in advance. -- Peter O'Leary. "Speak of the Devil and the Devil may speak of you." - W. Hussey