Path: utzoo!news-server.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: Whaddya do in ioCompletion routine? Message-ID: <15951@hoptoad.uucp> Date: 8 Mar 91 19:14:12 GMT References: <63044@bbn.BBN.COM> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Electronics for Imaging, San Bruno CA Lines: 26 In article <63044@bbn.BBN.COM> rmitchel@bbn.com (Rob Mitchell) writes: > So, I'm writing all this AppleTalk Preferred Interface call, > post a few GetRequest asynchronously, and wait. > > Well, when the ioCompletion routine is called by Device Mgr., > what do I do? I know I have to SetupA5() and RestoreA5() and > call some a self-created function in the middle, but what does > that buy me? Which Parameter Block is being returned by the > Device Mgr. and how can I access it with "moving memory?" It's best not to use A5 if you can help it. I prefer to stuff an unused field of the parameter block with a pointer to some data area which may be used by the request. The Mac queue data structures work well for this, since Enqueue and Dequeue are interrupt-friendly. To get at the parameter block, look at register A0 on entry to your completion routine. If you must use A5, note that you can't rely on CurrentA5 at the interrupt level. You will have to stuff your A5 in the parameter block, in an unused field. -- Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com "Something was badly amiss with the spiritual life of the planet, thought Gibreel Farishta. Too many demons inside people claiming to believe in God." -- Salman Rushdie, THE SATANIC VERSES