home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / mac / programm / 20351 < prev    next >
Encoding:
Internet Message Format  |  1992-12-28  |  1.5 KB

  1. Path: sparky!uunet!paladin.american.edu!gatech!enterpoop.mit.edu!eru.mt.luth.se!kth.se!dront.nada.kth.se!d88-jwa
  2. From: d88-jwa@dront.nada.kth.se (Jon Wtte)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: Problem with patch to HFSDispatch
  5. Message-ID: <1992Dec28.104104.10313@kth.se>
  6. Date: 28 Dec 92 10:41:04 GMT
  7. References: <1992Dec22.182710.26751@panix.com> <absurd-221292190600@seuss.apple.com> <1992Dec28.022559.2496@panix.com>
  8. Sender: usenet@kth.se (Usenet)
  9. Organization: Royal Institute of Technology, Stockholm, Sweden
  10. Lines: 38
  11. Nntp-Posting-Host: dront.nada.kth.se
  12.  
  13. In <1992Dec28.022559.2496@panix.com> rmah@panix.com (Robert Mah) writes:
  14.  
  15. >Thanks I'll try it and see how it works.  But won't changing the return 
  16. >address mess up some toolbox things.  I seem to recall that that was why
  17. >"tail patches" were not allowed -- of course, I could be totally confused
  18. >here :->
  19.  
  20. But that's the beauty of it; we DON'T change the normal return
  21. address. The stack will look a little like:
  22.  
  23.     <Junk>
  24.     Return Address
  25.     <Saved Space>
  26.     <Saved registers>
  27.  
  28. Then we push the address to chain to:
  29.  
  30.     <Junk>
  31.     Return Address
  32.     Chain Address
  33.     <Saved registers>
  34.  
  35. and restore registers and do an RTS:
  36.  
  37.     <Junk>
  38.     Return Address
  39.  
  40. The stack looks JUST like it did on entry to our routine!
  41. The patch has preserved all registers and the original return
  42. address, so it isn't a tail patch and it isn't zapping any
  43. registers; it's clean.
  44.  
  45.  
  46. -- 
  47.  -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
  48.  
  49.   "From now on I will re-label the EQ on the deck as Fizz and Wobble
  50.    instead of HF and LF."
  51.