home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / STAYRESP.ZIP / STAYI9.410 < prev    next >
Encoding:
Text File  |  1986-05-02  |  2.9 KB  |  42 lines

  1. Inline(
  2.                               {; STAYI9.400}
  3.                               {; Routine to watch for the HOTKEY within Keyboard Interrupt 9}
  4.                               {; Set a flag if found, and Ignore the key therafter}
  5.   $5D                         {         Pop   Bp                      ; Remove Turbo Prologue}
  6.   /$5D                        {         Pop   Bp}
  7.   /$50                        {         Push  Ax                      ; Save scratch register}
  8.   /$1E                        {         Push  DS                      ; Save interrupted DataSeg}
  9.   /$B8/$40/$00                {         Mov   Ax,$40                  ; Address BIOS data segment}
  10.   /$8E/$D8                    {         Mov   DS,Ax}
  11.   /$A0/$17/$00                {         Mov   Al,[$17]                ; Fetch Shift codes}
  12.   /$1F                        {         Pop   DS}
  13.   /$2E                        {         CS:}
  14.   /$3A/$06/>OUR_HOTKEY+1      {         Cmp   Al,[<Our_HotKey+1]      ; Test Shift status}
  15.   /$75/$0D                    {         Jne   NotHot}
  16.   /$E4/$60                    {         In    Al,$60 ;Kb_Port         ; Fetch the current scan code}
  17.   /$88/$C4                    {         Mov   Ah,Al                   ; Save Scan Code}
  18.   /$24/$7F                    {         And   Al,$7F                  ; Kill the break Bit}
  19.   /$2E                        {         CS:}
  20.   /$3A/$06/>OUR_HOTKEY        {         Cmp   Al,[<Our_HotKey]        ; If Our HotKey, get Hot}
  21.   /$74/$06                    {         Je    AmHot}
  22.                               {NotHot:}
  23.   /$58                        {         Pop   Ax                      ; Else call BIOS INT_9}
  24.   /$2E                        {         CS:}
  25.   /$FF/$2E/>BIOS_INT9         {         Jmp   dword [>Bios_Int9]}
  26.                               {AmHot:                                 ; We've got some action}
  27.   /$E4/$61                    {         In    Al,$61 ;Kb_Ctrl         ; Fetch Keyboard Status}
  28.   /$88/$C4                    {         Mov   Ah,Al}
  29.   /$0C/$80                    {         Or    Al,$80                  ; Thank him for the info}
  30.   /$E6/$61                    {         Out   $61,Al ;KB_ctrl}
  31.   /$86/$C4                    {         Xchg  Ah,Al                   ; Get back original Status}
  32.   /$E6/$61                    {         Out   $61,Al ;KB_ctrl         ; Reset the Keyboard}
  33.   /$FA                        {         Cli                           ; Send End-of-Interrupt}
  34.   /$B0/$20                    {         Mov   Al,$20 ;EOI}
  35.   /$E6/$20                    {         Out   $20,Al}
  36.   /$2E                        {         CS:                           ; Say we're in the money}
  37.   /$80/$0E/>STATUS/<HOTKEY_ON {         Or    by [<Status],<HotKey_On }
  38.   /$58                        {         Pop   Ax}
  39.   /$CF                        {         IRET}
  40.                               {;....................................................................}
  41. );
  42.