Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!munnari.oz.au!uniwa!vaxa!a_dent From: a_dent@vaxa.uwa.oz Newsgroups: comp.sys.mac.programmer Subject: Re: THINK Pascal saving A4 for Objects in CODE resource Message-ID: <1651.261273d0@vaxa.uwa.oz> Date: 29 Mar 90 12:45:04 GMT References: <1645.2610e886@vaxa.uwa.oz> <2377@husc6.harvard.edu> Organization: University of Western Australia Lines: 28 In article <2377@husc6.harvard.edu>, siegel@endor.harvard.edu (Rich Siegel) writes: > In article <1645.2610e886@vaxa.uwa.oz> a_dent@vaxa.uwa.oz (ME) writes: >>I am working on a Quickmail bridge which requires a CODE resource. >>The THINK documentation says you can't use globals in CODE resources but it >>would be LOTS easier to write if I could use Object Pascal. Am I correct in >>assuming that Object Pascal can be used if you can save and restore A4? > > Right now, you can't write code resources in Object Pascal, because > you need a jump table to support the method dispatches, and no mechanism is > supported for the jump table at this time. > WOW - thanks for the speed of response. I'm still not entirely convinced that I can't hack a way round this. On page 131 of the manual it states that "If your driver uses Object Pascal, you must check the Multi-segment option..." So, your driver glue somehow can fake having a jump table (that's also why multiple segments work, for those who were wondering). Now, in this Quickmail environment, I CAN have other resources providing their numbering corresponds to a base address from the CODE resource. Is there any way I can actually compile a DRIVER and then hack it? How secret is your driver glue and particularly the bits setting up the jump table? I'm prepared to dissassemble code if I have to but don't want to write a commercial product that violates any patents or stuff. Andy Dent A.D. Software phone 09 249 2719 Mac & VAX programmer 94 Bermuda Dve, Ballajura a_dent@vaxa.uwa.oz Western Australia 6066