Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!usc!ucsd!ucbvax!mtxinu!taniwha!paul From: paul@taniwha.UUCP (Paul Campbell) Newsgroups: comp.sys.mac.programmer Subject: Re: StripAddress... Message-ID: <478@taniwha.UUCP> Date: 3 Feb 90 22:12:30 GMT References: <1990Feb2.010425.28126@oracle.com> <1461@husc6.harvard.edu> Reply-To: paul@taniwha.UUCP (Paul Campbell) Organization: Taniwha Systems Design, Oakland Lines: 37 In article <1461@husc6.harvard.edu> siegel@endor.UUCP (Rich Siegel) writes: >In article <1990Feb2.010425.28126@oracle.com> gstein@oracle.uucp (Gregory Stein) writes: >> >>Geez, it seems like StripAddress needs to be called *everywhere* if >>you want to be 32-bit clean. If you maintain any kind of information > > Not quite. You should call StripAddress if you want to be sure >that the address you get by dereferencing a handle is clear of any >extra information such as flag bits. This is useful if you're planning to >do any kind of address arithmetic. However, in the normal case, you >can double-indirect a locked (or purgeable, or resource) handle and >still get the right thing, because the system only uses the low-order >24 bits of whatever addresses you use. It is also a problem if you are going to do a SwapMMUMode(1) call to get to 32-bit addressing on a 24-bit system in order to access a board with more than 1Mb of slot space and then want to work with any indirected handle, including the address of HLock()ed code - you have to load the address of code, Stripaddress it and jump to it ie: lea @1, a0 move.l a0, d0 _StripAddress move.l d0, a0 jmp (a0) @1: move.l #1, d0 _SwapMMUMode Paul -- Paul Campbell UUCP: ..!mtxinu!taniwha!paul AppleLink: CAMPBELL.P "Skifield": N, device to collect and refine assholes