home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / 1990 / 12 / grdlagen / mousekey.asm < prev    next >
Encoding:
Assembly Source File  |  1990-09-06  |  2.4 KB  |  96 lines

  1. ;* ------------------------------------------------------- *
  2. ;*                    MOUSEKEY.ASM                         *
  3. ;*              Assemblermodul für Unit Mouse              *
  4. ;*            (c) 1990 Raimond Reichert & TOOLBOX          *
  5. ;* ------------------------------------------------------- *
  6. DATA SEGMENT WORD PUBLIC
  7.      EXTRN OldInt09 : DWORD
  8. DATA ENDS
  9.  
  10. CODE SEGMENT BYTE PUBLIC
  11.      ASSUME CS:Code
  12.      PUBLIC NewMouHandler
  13.      PUBLIC NewKeybHandler
  14.      EXTRN  CallMouHandler  : NEAR
  15.      EXTRN  CallKeybHandler : NEAR
  16.  
  17. ;* ------------------------------------------------------- *
  18. NewMouHandler PROC FAR
  19.  
  20.      PUSH AX      ; Prozessorregister sichern
  21.      PUSH BX
  22.      PUSH CX
  23.      PUSH DX
  24.      PUSH DI
  25.      PUSH SI
  26.      PUSH BP
  27.      PUSH ES
  28.      PUSH DS
  29.                   ; Parameter für den Aufruf von
  30.                   ; CallMouhandler auf den Stack
  31.      PUSH AX      ; Flags
  32.      PUSH BX      ; Buttons
  33.      PUSH CX      ; X-Koordinate
  34.                   ; ACHTUNG: X- und Y-Koordinate sind auf
  35.                   ; den virtuellen Grafikbildschirm bezogen,
  36.                   ; der Handler muss sie für Textmodus um-
  37.                   ; rechnen
  38.      PUSH DX      ; Y-Koordinate
  39.      MOV  AX,Data ; Segmentadresse in AX
  40.      MOV  DS,AX   ; bzw in DX
  41.  
  42.      CALL CallMouHandler
  43.      POP DS
  44.      POP ES
  45.      POP BP
  46.      POP SI
  47.      POP DI
  48.      POP DX
  49.      POP CX
  50.      POP BX
  51.      POP AX
  52.      RET
  53.  
  54. NewMouHandler ENDP
  55.  
  56. ;* ------------------------------------------------------- *
  57. NewKeybHandler PROC FAR
  58.  
  59.      STI          ; Interruptaufrufe zulassen
  60.      PUSH AX      ; Prozessorregister sichern
  61.      PUSH BX
  62.      PUSH CX
  63.      PUSH DX
  64.      PUSH DI
  65.      PUSH SI
  66.      PUSH BP
  67.      PUSH ES
  68.      PUSH DS
  69.      IN   AL,60h   ; Scancode der Taste einlesen
  70.      XOR  AH,AH    ; ist nur in AL
  71.      PUSH AX       ; --> auf den Stack
  72.      MOV  AX,Data
  73.      MOV  DS,AX
  74.      PUSHF
  75.                    ; alten Interrupthandler aufrufen
  76.      CALL DS:[OldInt09]
  77.      CALL CallKeybHandler
  78.  
  79.      POP  DS       ; Register wiederherstellen
  80.      POP  ES
  81.      POP  BP
  82.      POP  SI
  83.      POP  DI
  84.      POP  DX
  85.      POP  CX
  86.      POP  BX
  87.      POP  AX
  88.      IRET          ; WICHTIG: ist Interrupt !
  89.  
  90. NewKeybHandler ENDP
  91.  
  92. CODE ENDS
  93.      END
  94. ;* ------------------------------------------------------- *
  95. ;*               Ende von MOUSEKEY.ASM                     *
  96.