home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 2 / goldfish_vol2_cd1.bin / files / dev / c / rkrm / keyboard / keyhandler.a < prev    next >
Text File  |  1992-09-03  |  3KB  |  83 lines

  1. *
  2. * Copyright (c) 1992 Commodore-Amiga, Inc. 
  3. * This example is provided in electronic form by Commodore-Amiga, Inc. for 
  4. * use with the "Amiga ROM Kernel Reference Manual: Devices", 3rd Edition, 
  5. * published by Addison-Wesley (ISBN 0-201-56775-X).
  6. * The "Amiga ROM Kernel Reference Manual: Devices" contains additional 
  7. * information on the correct usage of the techniques and operating system 
  8. * functions presented in these examples.  The source and executable code 
  9. * of these examples may only be distributed in free electronic form, via 
  10. * bulletin board or as part of a fully non-commercial and freely 
  11. * redistributable diskette.  Both the source and executable code (including 
  12. * comments) must be included, without modification, in any copy.  This 
  13. * example may not be published in printed form or distributed with any
  14. * commercial product.  However, the programming techniques and support
  15. * routines set forth in these examples may be used in the development
  16. * of original executable software products for Commodore Amiga computers.
  17. * All other rights reserved.
  18. * This example is provided "as-is" and is subject to change; no
  19. * warranties are made.  All use is at your own risk. No liability or
  20. * responsibility is assumed.
  21. *
  22. ****************************************************************************
  23. *
  24. *       KeyHandler.a
  25. *
  26. * Keyboard reset handler that signals the task in the structure...
  27. *
  28. *
  29. * See Key_Reset.c for details on how to compile/assemble/link...
  30. *
  31. ************************************************************************
  32. * Required includes...
  33. *
  34. *       CSECT   KeyHandler      ;SAS/Lattice ASM command requires this
  35. *
  36.         INCDIR  "include:"
  37.         INCLUDE "exec/types.i"
  38.         INCLUDE "exec/io.i"
  39.         INCLUDE "devices/keyboard.i"
  40. *
  41.         xref    _AbsExecBase    ; We get this from outside...
  42.         xref    _LVOSignal      ; We get this from outside...
  43. *
  44. ************************************************************************
  45. * Make the entry point external...
  46. *
  47.         xdef    _ResetHandler
  48. *
  49. ************************************************************************
  50. *
  51. * This is the input handler
  52. * The is_Data field is passed to you in a1.
  53. *
  54. * This is the structure that is passed in A1 in this example...
  55. *
  56.         STRUCTURE       MyData,0
  57.         APTR            MyTask
  58.         ULONG           MySignal
  59. *
  60. ************************************************************************
  61. * The handler gets called here...
  62. *
  63. _ResetHandler:  move.l  MySignal(a1),d0 ; Get signal to send
  64.                 move.l  MyTask(a1),a1           ; Get task
  65. *
  66. * Now signal the task...
  67. *
  68.                 move.l  a6,-(sp)        ; Save the stack...
  69.                 move.l  _AbsExecBase,a6 ; Get ExecBase
  70.                 jsr     _LVOSignal(a6)  ; Send the signal
  71.                 move.l  (sp)+,a6        ; Restore A6
  72. *
  73. * Return to let other handlers execute.
  74. *
  75.                 rts                     ; return from handler...
  76. ************************************************************************
  77.                 END
  78.  
  79.