Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!elroy.jpl.nasa.gov!sdd.hp.com!briang From: briang@sdd.hp.com (Brian Gragg) Newsgroups: comp.sys.amiga.programmer Subject: Input handler question Summary: I'm having trouble getting an input handler to call a C routine. Keywords: handler input assembly help questions seeking Message-ID: <1991May28.184358.29226@sdd.hp.com> Date: 28 May 91 18:43:58 GMT Organization: Hewlett Packard, San Diego Division Lines: 66 Hi, I've been trying to have an input handler call a C subroutine and it's just not working. The C program installs the assembly handler just fine. I've even checked the handler by having it set the ie_Qualifier to shift so all my keystokes get shifted to upper case, which works fine. But if I include a jsr _myhandler in the assembly routine, the system crashes. What am I doing wrong? I've written a short C program to call an assembly routine which calls a C routine. That seemed to work. Is there something special about the assembly routine being a handler. The C routine is just: struct InputEvent *myHandler( struct InputEvent *ev) { return(ev); } The assebly routine is: include "exec/types.i" include "exec/io.i" include "devices/inputevent.i" CSECT TEXT xdef _HandlerInterface xref _myhandler _HandlerInterface: LINK A5,#-16 move.l A0,D0 cmp.b #IECLASS_RAWKEY,ie_Class(a0) bne.s doneit MOVEM.l A0,-(A7) JSR _myhandler movem.l (A7)+,A0 doneit: UNLK A5 rts END I'm somewhat new to C and even newer to assembly (68000 at least). Is there a problem if the C program is too large? Are my compile options wrong? I've tried most of them. The above routine only crashes the system if the bne.s doneit branch is not taken. PLEASE email me any ideas. I've spent way too much time trying to get this working! Thanks in advance, Brian. -- ----------------------------------------------------------------------------- Brian Gragg briang@sdd.hp.com hp-sdd!briang uunet!ucsd!hp-sdd!briang -----------------------------------------------------------------------------