home *** CD-ROM | disk | FTP | other *** search
- * Copyright (c) 1990 Commodore-Amiga, Inc.
- *
- * This example is provided in electronic form by Commodore-Amiga, Inc. for
- * use with the 1.3 revisions of the Addison-Wesley Amiga reference manuals.
- * The 1.3 Addison-Wesley Amiga Reference Manual series contains additional
- * information on the correct usage of the techniques and operating system
- * functions presented in this example. The source and executable code of
- * this example may only be distributed in free electronic form, via bulletin
- * board or as part of a fully non-commercial and freely redistributable
- * diskette. Both the source and executable code (including comments) must
- * be included, without modification, in any copy. This example may not be
- * published in printed form or distributed with any commercial product.
- * However, the programming techniques and support routines set forth in
- * this example may be used in the development of original executable
- * software products for Commodore Amiga computers.
- * All other rights reserved.
- * This example is provided "as-is" and is subject to change; no warranties
- * are made. All use is at your own risk. No liability or responsibility
- * is assumed.
- *
- ***********************************************************************
-
- *
- * This is in two parts...
- *
- * Compile the C code with:
- * LC -cfist -v keyreset.c
- *
- * Assemble this ASM code with: (Cape 68K)
- * CAsm -a keyhandler.a -i include: -o keyhandler.o
- *
- * Link with:
- * BLink FROM lib:c.o+keyreset.o+keyhandler.o LIB LIB:lc.lib LIB:amiga.lib TO keyreset
- *
-
- *
- * Keyboard reset handler that signals the task in the structure...
- *
- ************************************************************************
- * Required includes...
- *
- INCLUDE "exec/types.i"
- INCLUDE "exec/io.i"
- INCLUDE "devices/keyboard.i"
- *
- xref _AbsExecBase ; We get this from outside...
- xref _LVOSignal ; We get this from outside...
- *
- ************************************************************************
- * Make the entry point external...
- *
- xdef _ResetHandler
- *
- ************************************************************************
- *
- * This is the input handler
- * The is_Data field is passed to you in a1.
- *
- * This is the structure that is passed in A1 in this example...
- *
- STRUCTURE MyData,0
- APTR MyTask
- ULONG MySignal
- *
- ************************************************************************
- * The handler gets called here...
- *
- _ResetHandler: move.l MySignal(a1),d0 ; Get signal to send
- move.l MyTask(a1),a1 ; Get task
- *
- * Now signal the task...
- *
- move.l a6,-(sp) ; Save the stack...
- move.l _AbsExecBase,a6 ; Get ExecBase
- jsr _LVOSignal(a6) ; Send the signal
- move.l (sp)+,a6 ; Restore A6
- *
- * Return to let other handlers execute.
- *
- rts ; return from handler...
- *
- ************************************************************************
-