Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!bellcore!faline!ulysses!gatech!seismo!rutgers!mit-eddie!uw-beaver!tektronix!tekcrl!vice!tekfdi!bobb From: bobb@tekfdi.UUCP Newsgroups: comp.sys.amiga Subject: Re: HNeed help with MIDI program Message-ID: <812@tekfdi.TEK.COM> Date: Wed, 4-Mar-87 12:38:50 EST Article-I.D.: tekfdi.812 Posted: Wed Mar 4 12:38:50 1987 Date-Received: Sat, 7-Mar-87 00:04:57 EST References: <432@unisec.USI.COM> Reply-To: bobb@tekfdi.UUCP (Robert Bales) Distribution: comp Organization: Tektronix, Inc., Beaverton, OR. Lines: 41 Keywords: interrupt handler [This article dealt with trying to make an interrupt handler work in a public- domain MIDI program.] After 1/2 week, I've succeeded (I think) in getting an interrupt handler to work. My application was somewhat different, so I don't know if all this applies, but here goes. . . . The "move d1,a4" sounds like it comes from the Aztec manual, which is wrong. The RKM indicates the data area pointer is in a4, so the instruction is "move.l a1,a4." This is the 2nd thing to be done, however. The first is to save the existing registers on the stack, since, at least for Aztec, a4 must be preserved. If memory serves me right, the instruction to do this is "movem.l d0-d7/a0-a7, -(a7)." Actually, probably only the registers needed by the compiler must be saved. So my handler looks like: handleInt() { #asm MOVEM.L D0-D7/A0-A7, -(A7) MOVE.L A1,A4 #endasm [C interrupt code] #asm MOVEM.L (A7)+, D0-D7/A0-A7 [Set interrupt return code] #endasm } Like I said, the assembler syntax may not be exact. Setting the return code depends on exactly what you are doing, as discussed in the RKM. I set up the date field pointer in the Interrupt structure as discussed in the Aztec manual (probably different for Lattice). Anyway, I'm using one handler in the vertical blank chain to count frames, and then call another handler via Cause() every second. So far, the guru has stayed away. . . . Bob Bales Tektronix, Inc. I help Tektronix make their instruments. They don't help me make my opinions.