ajl88@ecs.soton.ac.uk (Lewis AJ) (02/13/91)
I've been programming the Mac under MPW Pascal (3.1) for about two weeks, and have been having some success writing XCMDs for Hypercard 2.0. For various resons I decided to try experimenting with objects, and have run into severe problems. I wrote a small XCMD that used objects, which compiled no problem, but when I tried to link it, I got a set of errors which went more or less as follows... ### While reading file "ObjectWindow.p.o" ###Link: Error: OpCode is not JSR, JMP, LEA or PEA. (Error 41) at $FFFFFE in %_XWINOBJECT (with about ten more similar ones following. I've found that I only get these errors if the program instantiates an object (by using New()). I really haven't a clue what's wrong - I'm using the correct interfaces and library files etc, and have RTFM till I'm blue in the face. Can anybody please help? Thanks, Andy Lewis
keith@Apple.COM (Keith Rollin) (02/15/91)
In article <6748@ecs.soton.ac.uk> ajl88@ecs.soton.ac.uk (Lewis AJ) writes: >I've been programming the Mac under MPW Pascal (3.1) for about two >weeks, and have been having some success writing XCMDs for Hypercard >2.0. For various resons I decided to try experimenting with objects, >and have run into severe problems. Check out technote #239 for a brief explanation why what you are doing isn't as simply as you think. -- ------------------------------------------------------------------------------ Keith Rollin --- Apple Computer, Inc. --- Developer Technical Support INTERNET: keith@apple.com UUCP: {decwrl, hoptoad, nsc, sun, amdahl}!apple!keith "Argue for your Apple, and sure enough, it's yours" - Keith Rollin, Contusions
Bruce.Hoult@bbs.actrix.gen.nz (02/17/91)
It's simple: you can't use Object Pascal stuff in XCMDs. Sorry. I suppose if one were *really* clever, you might be able to get the %methtable and so forth linked into your XCMD. It would probably be tricky though, because all Object Pascal methods normally go through the CODE 0 jump table. (and probably for other reasons as well) -- Bruce.Hoult@bbs.actrix.gen.nz Twisted pair: +64 4 772 116 BIX: brucehoult Last Resort: PO Box 4145 Wellington, NZ "And they shall beat their swords into plowshares, for if you hit a man with a plowshare, he's going to know he's been hit."
keith@Apple.COM (Keith Rollin) (02/18/91)
In article <1991Feb16.161729.4483@actrix.gen.nz> Bruce.Hoult@bbs.actrix.gen.nz writes: >It's simple: you can't use Object Pascal stuff in XCMDs. Sorry. > > >I suppose if one were *really* clever, you might be able to get the >%methtable and so forth linked into your XCMD. It would probably be >tricky though, because all Object Pascal methods normally go through >the CODE 0 jump table. (and probably for other reasons as well) There's a company in Seattle that figured out how to do this. They're called Software Architects, and use Object Pascal for the SCSI drivers they write. They use the method you describe in a post-Link phase. I don't know if their tools are/will be commercially or otherwise available. If you have AppleLink, you might want to contact them. -- ------------------------------------------------------------------------------ Keith Rollin --- Apple Computer, Inc. --- Developer Technical Support INTERNET: keith@apple.com UUCP: {decwrl, hoptoad, nsc, sun, amdahl}!apple!keith "Argue for your Apple, and sure enough, it's yours" - Keith Rollin, Contusions
jspencer@p510.f22.n282.z1.mmug.edgar.mn.org (Jim Spencer) (02/23/91)
Lewis Aj writes in a message to All LA> I've been programming the Mac under MPW Pascal (3.1) for about LA> two weeks, and have been having some success writing XCMDs for LA> Hypercard 2.0. For various resons I decided to try experimenting LA> with objects, and have run into severe problems. LA> I wrote a small XCMD that used objects, which compiled no problem, LA> but when I tried to link it, I got a set of errors which went LA> more or less as follows... LA> ### While reading file "ObjectWindow.p.o" ###Link: Error: OpCode LA> is not JSR, JMP, LEA or PEA. (Error 41) at $FFFFFE in %_XWINOBJECT While I'm not exactly sure why this is the error message you get, the problem comes from the fact that Object Pascal accesses methods via a jump table referenced from A5. In an XCMD, A5 is not yours to play with. -- Jim Spencer (jspencer@mmug.edgar.mn.org) UUCP: ...jhereg!tcnet!vware!edgar!mmug!jspencer FidoNet: 1:282/22.510 --
John_Miller@mindlink.UUCP (John Miller) (03/27/91)
In article <49295@apple.Apple.COM>, keith@Apple.COM (Keith Rollin) writes >In article <1991Feb16.161729.4483@actrix.gen.nz> > Bruce.Hoult@bbs.actrix.gen.nz writes: >>It's simple: you can't use Object Pascal stuff in XCMDs. Sorry. >> >> >>I suppose if one were *really* clever, you might be able to get >>the %methtable and so forth linked into your XCMD. It would >> probably be tricky though, because all Object Pascal methods >> normally go through the CODE 0 jump table. (and probably for >> other reasons as well) > >There's a company in Seattle that figured out how to do this. >They're called Software Architects, and use Object Pascal for >the SCSI drivers they write. They use the method you describe >in a post-Link phase. I don't know if their tools are/will be >commercially or otherwise available. If you have AppleLink, you >might want to contact them. I have also found that it is fairly straightforward (although CFront-version dependent) to post-process the CFront output to translate the virtual tables into a form that can be included in stand-alone code resources without requiring an A5 world. My question is: why doesn't Apple do this for us? Over the years, Apple increasingly has been pushing object-oriented programming (oops, just plain "object programming", thank you). At the same time -- or, really, as part of this push -- the importance of stand-alone code is increasing: XCMDs, communications tools, query documents, the millions of print drivers that will be written for the future print architecture, and all the various third party add-ins. In many cases, the functionality supported by these code resources is getting more complex. It would be nice to have Apple-supported ways of using OOP languages to help deal with this complexity. The changes to C++ -- or, offhand, to Object Pascal -- required to support code resources would be relatively minor. It would help us reach a higher level of grooviness. _____________________________________________________________________ John Miller (604) 433-1795 Symplex Systems AppleLink (rarely) CDA0461 Burnaby, British Columbia Fax: (604) 430-8516 Canada usenet: john_miller@mindlink.uucp Macintosh Consulting and Software Development _____________________________________________________________________