Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!CIS.OHIO-STATE.EDU!james_kent From: james_kent@CIS.OHIO-STATE.EDU Newsgroups: comp.sys.mac.programmer Subject: MIDI Manager/Think C/A5 Register Message-ID: <9004121500.AA00697@canoe.cis.ohio-state.edu> Date: 12 Apr 90 15:36:36 GMT Sender: james_kent@tut.cis.ohio-state.edu Lines: 29 I've been trying to use MIDI manager with Think C and have come across the following problem (at least as I understand it). MIDI manager uses interrupt routines to perform some types of tasks. When the interrupt routine is called, the A5 register does not necessarily contain the application's A5 value. A5 is used to point to an application's global variables. I need a method of doing the following, using Think C : 1) save the application's A5 value somewhere when the application starts (Location X) 2) when the interrupt routine is called, save the current A5 value (Location Y) and move the value from Location X into A5 3) when the interrupt routine completes, move the value from Location Y back into A5 before returning The problem is Location X can not be a global variable, since the interrupt routine cannot access the global variables until A5 has been properly set. I'd appreciate any code and/or comments about my understanding of this problem. Any pointers to Apple guidelines for methods of doing such a thing would also be appreciated. thanks Jim Kent (kent@cis.ohio-state.edu)