home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 June / SIMTEL_0692.cdr / msdos / turbopas / stay42.arc / STAYI28.410 < prev    next >
Text File  |  1986-05-11  |  3KB  |  45 lines

  1. Inline(
  2.                               {; STAYI28.400}
  3.                               {;------------}
  4.                               {; Routine to Invoke User Code When HotKey or DOS idle}
  5.   $5D                         {         Pop   Bp                      ; Remove Turbo Prologue}
  6.   /$5D                        {         Pop   Bp}
  7.   /$9C                        {         Pushf}
  8.   /$2E                        {         CS:}
  9.   /$FF/$1E/>DOS_INT28         {         Call dw [>DOS_INT28]          ; Invoke Original INT 28}
  10.   /$2E                        {         CS:}
  11.   /$F6/$06/>STATUS/<HOTKEY_ON {         Test by [<Status],<HotKey_on  ; Have we received the HOKEY}
  12.   /$74/$25                    {         Jz    NoGo}
  13.   /$2E                        {         CS:}
  14.   /$F6/$06/>STATUS/<INUSE     {         Test by [<Status],<Inuse      ; If Inuse.. then No go}
  15.   /$75/$1D                    {         Jnz   NoGo}
  16.                               {; If Not already waiting I/O, not already in use, and HotKey received}
  17.                               {; see if DOS is now interruptable}
  18.                               {ChkIO:}
  19.   /$06                        {         Push  ES                      ; Save registers}
  20.   /$56                        {         Push  Si}
  21.   /$50                        {         Push  Ax}
  22.   /$2E                        {         CS:}
  23.   /$C4/$36/>DOSSTAT2          {         LES   SI,[>DOSstat2]          ; Fetch DOS Critical status byte}
  24.   /$26                        {         ES:}
  25.   /$AC                        {         LodSb}
  26.   /$2E                        {         CS:}
  27.   /$0A/$06/>INTR_FLAGS        {         Or    Al,[<Intr_Flags]        ; Add Interrupt active flags}
  28.   /$58                        {         Pop   Ax}
  29.   /$5E                        {         Pop   Si}
  30.   /$07                        {         Pop   ES}
  31.   /$75/$09                    {         Jnz   NoGo                      ; Wait for inactivity}
  32.   /$2E                        {         CS:                           ; Have the HotKey}
  33.   /$80/$3E/>WAITCOUNT/$00     {         Cmp by [<WaitCount],00        ; If timer waiting, go}
  34.   /$E9/$01/$00                {         Jmp Go}
  35.                               {NoGo:}
  36.   /$CF                        {         IRET}
  37.                               {GO:                                    ; Enter the User's Turbo Procedure}
  38.   /$2E                        {         CS:}
  39.   /$C6/$06/>WAITCOUNT/$00     {         Mov by [<WaitCount],00        ; Kill INT8 wait count}
  40.   /$2E                        {         CS:}
  41.   /$FF/$16/>USERPROGRAM       {         Call [<UserProgram]}
  42.   /$CF                        {         IRET}
  43.                               {;.......................................................................}
  44. );
  45.