home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / mac / programm / 13110 < prev    next >
Encoding:
Internet Message Format  |  1992-07-28  |  1.9 KB

  1. Path: sparky!uunet!dtix!darwin.sura.net!mips!sdd.hp.com!uakari.primate.wisc.edu!ames!agate!ewylie
  2. From: ewylie@ocf.berkeley.edu (Elizabeth Wylie)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: Altering the TRAP dispatch table.
  5. Message-ID: <1548hiINN809@agate.berkeley.edu>
  6. Date: 28 Jul 92 19:52:18 GMT
  7. References: <9207271916.AA19926@ucbvax.Berkeley.EDU>
  8. Organization: U.C. Berkeley Open Computing Facility
  9. Lines: 32
  10. NNTP-Posting-Host: tornado.berkeley.edu
  11.  
  12. In article <9207271916.AA19926@ucbvax.Berkeley.EDU> glalonde@VNET.IBM.COM ("Glen Lalonde") writes:
  13. >I need to change the location that one of the OS Traps goes go.
  14. >IM detains how to do this, but under sys 7 the effect seems to be local
  15. >to that process. Once the application that did the patch exits, the OS Trap
  16. >went back to its old value. Is there any way to make the patch GLOBAL and
  17. >PERSISTENT?
  18. >
  19. >For now I just figured out the location in memory and patched it via
  20. >C. I doubt if the trap table always starts at location $400 in memory
  21. >for all models though.
  22.  
  23.  ^^^^ I really do hope that's temporary! ^^^^
  24.  
  25. >I want to trap BlockMove to a version optimized for the 030, my SE has
  26. >a 030 card.
  27.  
  28. In order for your patch to be active as long as the computer is turned on,
  29. you'll need to write an INIT (er, extension...).  (Is that kinda like
  30. 'wetlands' and 'marshes' ?)
  31.  
  32. Anyway, you're lucky.  Your patch doesn't need to call the system when it's
  33. done.  You just want to totally yank out the existing one.  At startup,
  34. use SetTrapAddress to point to your routine.  This routine should be loaded
  35. as a locked-system heap code resource.  (Not 'CODE', code.)
  36.  
  37. Be sure to detach the rtesource so you're initextention won't be purged when
  38. the file is closed.  Also remember that BlockMove is register based.
  39.  
  40. Finally, good luck on beating apple's code.  They write _very tight_ assembly
  41. where it counts.  (Elsewhere they tend to do some rather wierd C++).
  42.  
  43. -E. Wylie
  44.