Newsgroups: comp.sys.mac.programmer Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!cec2!news From: jyp@wucs1.wustl.edu (Jerome Yvon Plun) Subject: Shared addresses between applications with system 7 Message-ID: <1991Jun12.204031.11225@cec1.wustl.edu> Summary: Converting A5-based address into absolute address Keywords: Shared data, A5, Memory Manager Sender: news@cec1.wustl.edu (USENET News System) Organization: Washington University, St. Louis MO Distribution: usa Date: Wed, 12 Jun 91 20:40:31 GMT I need to have a block of memory available to two applications running concurrently (one of the applications doesn't know about the goodies of System 7 so I can't use either AppleEvents or raw PPC, and using a shared file is too slow). I though of allocating a Ptr in one application, pass the address of the Ptr to the other application (with the value of A5), and flip A5 whenever I need to access the shared data. This works fine if I assigne a constant to the shared data, since the constant is not dependent on A5. But if I want to copy a variable from one application's A5 world into the shared data from the other application's A5 world, I need to write a little routine in assembly that copies the value of the source into a register (say d0), changes A5, and writes d0 into the destination variable. Doing that for a buffer of data is cumbersome. So, I would like to know if it possible to convert an "Address Register Indirect with Displacement" (i.e. A5 + offset) into an absolute address for a global variable, thus making that variable independent of what application is being executed. Thanks. Jerome. Jerome Plun [] Is it a crime to want something else? jyp@wucs1.wustl.edu [] Is it a crime to believe in something different? Washington University [] St Louis, MO [] "Smalltown England", New Model Army, Vengeance