Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!xanth!nic.MR.NET!srcsip!smallberries!mnkonar From: mnkonar@smallberries.SRC.Honeywell.COM (Murat N. Konar) Newsgroups: comp.sys.mac.programmer Subject: Re: Calling Code resources? Message-ID: <20320@srcsip.UUCP> Date: 11 Apr 89 18:28:57 GMT References: <11817@ut-emx.UUCP> Sender: news@src.honeywell.COM Reply-To: mnkonar@src.honeywell.com (Murat N. Konar) Distribution: usa Organization: ipd Lines: 33 In article <11817@ut-emx.UUCP> newman@ut-emx.UUCP (David Newman) writes: > >Here is another question for the net-gods: how do you call a >code resource (like an XCMD or whatever) from another piece of >code? Can it be done from a high-level language? How might it >be done in Pascal? > >Thanks, >>>Dave This code is from the Jan '89 issue of MacTutor (page 12) and it works for me (LSP 2.x) FUNCTION MyFunction (firstArg: firstType; secondArg: secondType; VAR thirdArg: thirdType; MyFunctionResource: handle) resultType; INLINE $205F, {MOVE.L (A7)+, A0} $2050, {MOVE.L (A0), A0} $4E90; {JSR (A0) } Make sure the handle to your code is locked. This code also works for procedure calls. Good Luck! ____________________________________________________________________ Have a day. :^| Murat N. Konar Honeywell Systems & Research Center, Camden, MN mnkonar@SRC.honeywell.com (internet) {umn-cs,ems,bthpyd}!srcsip!mnkonar(UUCP)