Path: utzoo!attcan!uunet!husc6!mailrus!ncar!tank!nucsrl!jln From: jln@eecs.nwu.edu (John Norstad) Newsgroups: comp.sys.mac.programmer Subject: Re: SlotVInstall problem Message-ID: <10050050@eecs.nwu.edu> Date: 18 Nov 88 18:10:42 GMT References: <10050047@eecs.nwu.edu> Organization: Northwestern U, Evanston IL, USA Lines: 47 I discovered the reason why my SlotVInstall call failed in MPW C - it's bad glue in the MPW library {Libraries}Interface.o. I thought it worthwhile to alert people to the problem, hence this follow-up posting. The header file Retrace.h defines SlotVInstall as follows: pascal OSErr SlotVInstall (VBLBlockPtr, theSlot) QElemPtr VBLBLockPtr; short theSlot; extern; I set a breakpoint on the SlotVInstall trap using MacsBug and discovered that the glue code is the following: movea.l (a7)+,a1 movea.l (a7)+,a0 move.w (a7)+,d0 _SlotVInstall move.w d0,(a7) jmp (a1) This glue code is popping the two parameters in the wrong order. The trap is getting both a bad pointer to the parameter block and a bad slot number. The second and third lines of code above should be interchanged. I've checked both the MPW 2.0 and 2.0.2 Interface.o libraries, and the have the same bad glue. I don't use MPW Pascal, but it seems to me that it would have the same problem, since it uses the same glue routine as MPW C in this case. This doesn't completely solve my problem, because the programmer I'm trying to help is actually using LS Pascal, not MPW C! It's probably something similar, and I'll have to investigate further. Thanks to the folks who sent me notes and pointed out the missing & in my test program. This wasn't the problem, however - I had the & in my test program, but it mysteriously disappeared in my posting. John Norstad Academic Computing and Network Services Northwestern University Bitnet: jln@nuacc Internet: jln@nuacc.acns.nwu.edu