home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 June / SIMTEL_0692.cdr / msdos / turbopas / stay42.arc / STAYI8.420 < prev    next >
Text File  |  1986-08-02  |  3KB  |  53 lines

  1. Inline(
  2.                               {; STAYI8.413}
  3.                               {;-----------}
  4.                               {; Routine to Await Outstanding I/O, then post Stayres Active}
  5.   $5D                         {    Pop   Bp                      ; Remove Turbo Prologue}
  6.   /$5D                        {    Pop   Bp}
  7.   /$9C                        {    Pushf}
  8.   /$2E                        {    CS:}
  9.   /$FF/$1E/>BIOS_INT8         {    Call dw [>BIOS_INT8]          ; Invoke Original INT 8}
  10.   /$2E                        {    CS:}
  11.   /$F6/$06/>STATUS/<HOTKEY_ON {    Test by [<Status],<HotKey_on  ; Have we received the HOKEY}
  12.   /$74/$39                    {    Jz    NoGo}
  13.   /$2E                        {    CS:}
  14.   /$F6/$06/>STATUS/<INUSE     {    Test by [<Status],<Inuse      ; If Inuse.. then No go}
  15.   /$75/$31                    {    Jnz   NoGo}
  16.   /$2E                        {    CS:                           ; Have the HotKey}
  17.   /$80/$3E/>WAITCOUNT/$00     {    Cmp by [<WaitCount],00        ; If waiting, check time}
  18.   /$75/$22                    {    Jnz   Waiting}
  19.                               {; If Not already waiting I/O, not already in use, and HotKey received}
  20.                               {; see if DOS is now interruptable}
  21.                               {ChkIO:}
  22.   /$06                        {    Push  ES                      ; Save registers}
  23.   /$56                        {    Push  Si}
  24.   /$50                        {    Push  Ax}
  25.   /$2E                        {    CS:}
  26.   /$C4/$36/>DOSSTAT1          {    LES   Si,[>DOSstat1]          ; Fetch Dos status 1}
  27.   /$26                        {    ES:}
  28.   /$AC                        {    Lodsb                         ; Fetch Status byte from dos}
  29.   /$2E                        {    CS:}
  30.   /$C4/$36/>DOSSTAT2          {    LES   SI,[>DOSstat2]          ; Add second status byte}
  31.   /$26                        {    ES:}
  32.   /$0A/$04                    {    Or    Al,[SI]}
  33.   /$2E                        {    CS:}
  34.   /$0A/$06/>INTR_FLAGS        {    Or    Al,[<Intr_Flags]        ; Add Interrupt active flags}
  35.   /$58                        {    Pop   Ax}
  36.   /$5E                        {    Pop   Si}
  37.   /$07                        {    Pop   ES}
  38.   /$74/$0E                    {    Jz    Go                      ; Wait for inactivity}
  39.   /$2E                        {    CS:}
  40.   /$C6/$06/>WAITCOUNT/$10     {    Mov by [<WaitCount],$10       ; Set Wait count}
  41.                               {Waiting:}
  42.   /$2E                        {    CS:}
  43.   /$FE/$0E/>WAITCOUNT         {    Dec by [<WaitCount]           ; Decrement wait count}
  44.   /$74/$D7                    {    Jz   ChkIO}
  45.                               {NoGo:}
  46.   /$CF                        {    IRET}
  47.                               {GO:   ; Enter the User's Turbo Procedure}
  48.   /$2E                        {    CS:}
  49.   /$FF/$16/>USERPROGRAM       {    Call [<UserProgram]}
  50.   /$CF                        {    IRET}
  51.                               {;.......................................................................}
  52. );
  53.