Path: utzoo!utgpu!attcan!uunet!lll-winken!lll-tis!ames!mailrus!uwmcsd1!nic.MR.NET!umn-cs!crayview!imp From: imp@crayview.msi.umn.edu (Chuck Lukaszewski) Newsgroups: comp.sys.mac.programmer Subject: Re: Register saving conventions Summary: you still don't need to save anything Message-ID: <6605@umn-cs.cs.umn.edu> Date: 10 Aug 88 00:59:14 GMT References: <664@iraun1.ira.uka.de> <1133@lzsc.ATT.COM> <15055@santra.UUCP> <25556@ucbvax.BERKELEY.EDU> Sender: news@umn-cs.cs.umn.edu Lines: 26 Mike Carlton writes in response to my article on register saving: > and diactritical sensitive). The trap dispatcher stuffs the trap number in > D2 and the trap word in D1 (I may have these backwords). The code for the > trap will then check one of these words and jranch accordingly. So you > better not munge D1 or D2 in these cases. > > Another potential problem could be tail patches on register based traps. > (I know, tail patches are frowned upon, but they're useful sometimes). If > a result is returned in D0 the dispatcher tests D0 before returning to set But Mike, you haven't given any reason to save any registers in a trap patch. In your first example, you are discussing operating system traps, which take it upon themselves to save D1 and D2 in addition to the usual D3-D7/A2-A4! Also, you can touch them all you want if you are providing a complete patch. If you are doing a 'header' patch, then you need to avoid them, but you do not need to save them. As far as trailer patches go, D0 is never saved anyways. Implicit in the idea of a 'patch' is the test that you talk about, or you haven't properly emulated the routine you are replacing. So, as I see it, there is still no reason to save any registers in replacement traps. ---===---===---===---===--/* Chuck Lukaszewski */--===---===---===---===--- ARPAnet/NSFnet/MRnet: AppleLink: SnailMail: Ma Bell: imp@crayview.msi.umn.edu UG0138 Minneapolis MN 55418 612/789-0931