home *** CD-ROM | disk | FTP | other *** search
- IFNDEF TP4
- PAGE 60,132
- ;----------------------------------------------------------------------------
- SUBTTL TesSeRact Revision Level 1
- ;-----------------------------------------------------------------------------
- ; TesSeRact(tm) -- A Library of Routines for Creating Ram-Resident (TSR)
- ; programs for the IBM PC and compatible Personal
- ; Computers.
- ;
- ;The software, documentation and source code are:
- ;
- ; Copyright (C) 1986, 1987, 1988 Tesseract Development Team
- ; All Rights Reserved
- ;
- ; c/o Chip Rabinowitz
- ; Innovative Data Concepts
- ; 2084 Woodlawn Avenue
- ; Glenside, PA 19038
- ; 1-215-884-3373
- ;
- ;-----------------------------------------------------------------------------
- ; This product supports the TesSeRact Standard for Ram-Resident Program
- ; Communication. For information about TesSeRact, contact the TesSeRact
- ; Development Team at:
- ; Compuserve: 70731,20
- ; MCIMAIL: 315-5415
- ; This MCIMAIL Account has been provided to the TesSeRact Development
- ; Team by Borland International, Inc. The TesSeRact Development Team
- ; is in no way associated with Borland International, Inc.
- ;-----------------------------------------------------------------------------
-
- INCLUDE TESS.INC
- IFDEF ALLPUBLIC
- INCLUDE tsint9.pub ;public definitions (uses Periscope PUBLIC.COM /E)
- ENDIF
-
- .MODEL small
- .CODE
-
- EXTRN TESS_USERPARMS:byte
- EXTRN TESS_GLOBALS:byte
- EXTRN _TESSCLEARKEYS:near
-
- PUBLIC newint9, _TESS_INTERRUPTRETURN
-
- ENDIF
-
- newint9 proc far
-
- ASSUMENODS
-
- push ax
-
- in al,KB_DATA ;get scan code
-
- mov ah,al ;get scan code to AH
-
- push ds
- push si
-
- push ax
- mov ax,BIOS_DATA
- mov ds,ax ;set data segment
- mov si,KB_FLG1 ;set source to keyboard flags
-
- cld
- pop ax
- lodsb ;get the low bytes of kbflags to AL
- pop si
- pop ds
-
- and al,0fh ;only want four low bits
-
- push ds
-
- push cs
- pop ds
-
- ASSUMEDS
-
-
- check_break:
- test WPTR [STATUS],TSRENABLED
- jz no_9_1
-
- cmp ah,46h ;is it scroll lock (or break)?
- je check_ctl
- cmp ah,2eh ;is it a 'c'??
- jne check_keys
-
- check_ctl:
- cmp al,04h ;is control key down?
- jne check_keys ;no, process further
-
- check_stat: ;^C, so .....
- call _TESSCLEARKEYS ;clear the kbd buffer
-
- test WPTR [STATUS],TSRACTIVE+INT28ACTIVE ;are we already running?
- jnz end_9_2
-
-
- check_keys:
- test WPTR [STATUS],TSRACTIVE+INT28ACTIVE ;are we already running?
- jnz no_9_1
-
- cmp al,BPTR [SHIFTST] ;check shift state
- jne check_extra ;don't match!
-
- cmp BPTR [HOTKEY],0
- je hotkeyon ;Hotkey = 0, shift-state check only
-
- cmp ah,BPTR [HOTKEY] ;do they match
- jne check_extra ;nope!
-
- hotkeyon:
- xor al,al ;so let's do it!
- setflags:
- or WPTR [STATUS],HOTKEYON
- mov BPTR [HOTFLAG],al
- jmp short end_9_2
-
- check_extra:
- test WPTR [STATUS],EXTRAHOTSET
- jz no_9_1 ;extra hot keys?
-
- push cx ;save registers
- push es
- push bx
-
- xor ch,ch
- mov cl,BPTR [HOTCOUNT] ;load count of extra keys
- les bx,DPTR [EXTRAHOTK] ;load structure
- extra_loop:
- cmp BPTR es:[bx+1],al ;does the shift state match?
- jne next_check
-
- cmp BPTR es:[bx],0
- je nokey ;Hotkey = 0, shift-state check only
-
- cmp BPTR es:[bx],ah ;does the scan code match?
- jne next_check
-
- nokey:
- mov al, BPTR es:[bx+2]
- pop bx
- pop es
- pop cx
- jmp setflags
-
- next_check:
- add bx,3
- loop extra_loop
-
- pop bx
- pop es
- pop cx
-
- no_9_1:
- pop ds
- pop ax
-
- ASSUMENODS
-
- jmp DPTR [OLDINT9]
-
- end_9_2:
- in al,KB_CTL ;get keyboard status
- mov ah,al ;save it
- or al,80h ;acknowledge it
- out KB_CTL,al ;Thanks ...
- xchg ah,al ;get status back
- out KB_CTL,al ;reset the keyboard
-
- mov al,20h
- out 20h,al ;EOI
-
- pop ds
- pop ax
- ;
- ; ***************************************************************************
- ; This is the interrupt return address used for dummy routines
- ; for INT1b and INT23 during popup
- ;
- ;
- _TESS_INTERRUPTRETURN:
- iret
-
- newint9 endp
-
- ENDIT
-