home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / 1991 / 09_10 / oop / moukeyas.asm < prev    next >
Encoding:
Assembly Source File  |  1991-01-04  |  3.0 KB  |  97 lines

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