Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!zaphod.mps.ohio-state.edu!rpi!ispd-newsserver!hoffmann From: hoffmann@acl.kodak.com (marty hoffmann) Newsgroups: comp.sys.amiga.programmer Subject: RE: Need a helping hand(ler) Message-ID: <1991Feb4.143807.4658@ssd.kodak.com> Date: 4 Feb 91 14:38:07 GMT Sender: news@ssd.kodak.com Distribution: usa Organization: Eastman Kodak Lines: 37 Originator: hoffmann@acl I posted a note about trouble I've been having writing an event handler for the input device. From the number of replies I've received (0), I conclude: 1) My message never got out 2) It got out, but no one cared :^( 3) No one could figure out what I was talking about Anyway, I figured it out (All I had to do was RTFM). SAS C (and possible Lattice V5.0) doesn't automatically reload A4 with the base address of your data hunk when you enter a function (unless you ask it to with the -y option on the compile). When the input handler called my handler, I went and trashed memory in its address space. The solution was to use "-y". Global variables will be my undoing :^) While reading the manual, I also found a way to get rid of the assembly code needed to call my handler. I just declared it: struct InputEvent * __interrupt __asm myhandler (register __a0 struct InputEvent *ev, register __a1 struct MemEntry *mydata[]) { ... } NEAT! Of course, __interrupt doesn't do anything, but maybe someday... MRH