home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / tsr / stayres / stayi21.410 < prev    next >
Text File  |  1986-06-17  |  3KB  |  45 lines

  1. Inline(
  2.                               {; STAYI21.400}
  3.                               {;-----------}
  4.                               {; Routine to Set a Flag when certain INT21 functions are active.}
  5.                               {; Functions to be flagged are identified in the main Stayres}
  6.                               {; routine. Cf. Functab array.}
  7.   $5D                         {         Pop   Bp                      ; Remove Turbo Prologue}
  8.   /$5D                        {         Pop   Bp}
  9.   /$9C                        {         PushF}
  10.   /$FB                        {         STI                           ; Allow interrupts}
  11.   /$80/$FC/$62                {         Cmp   Ah,$62                  ; Verify Max function}
  12.   /$7F/$28                    {         Jg    SkipI21}
  13.                               {; Some Int 21 functions must be left alone. They either never return,}
  14.                               {; grab parameters from the stack, or can be interrupted. This code}
  15.                               {; takes account of those possibilities.}
  16.   /$50                        {         Push  Ax                      ; Skip functions marked 1 in}
  17.   /$53                        {         Push  Bx                      ; in the function table.}
  18.   /$86/$C4                    {         Xchg  Ah,Al}
  19.   /$BB/>FUNCTAB               {         Mov   Bx,>FuncTab             ; Test Int 21 function}
  20.   /$2E                        {         CS:}
  21.   /$D7                        {         Xlat}
  22.   /$08/$C0                    {         Or    Al,Al                   ; Wait for functions marked zero}
  23.   /$5B                        {         Pop   Bx                      ; in the function table.}
  24.   /$58                        {         Pop   Ax}
  25.   /$75/$19                    {         Jnz   SkipI21}
  26.                               {SetI21:}
  27.   /$2E                        {         CS:}
  28.   /$80/$0E/>INTR_FLAGS/<INT21_ON{         Or by [<Intr_flags],<INT21_on ; Say INT 21 is Active}
  29.   /$9D                        {         PopF}
  30.   /$9C                        {         Pushf}
  31.   /$2E                        {         CS:}
  32.   /$FF/$1E/>DOS_INT21         {         Call dw [<DOS_INT21]          ; Invoke Original INT 21}
  33.   /$FB                        {         STI                           ; Insure interrupts enabled}
  34.   /$9C                        {         Pushf                         ; Save Return Flags}
  35.   /$2E                        {         CS:                           ; Clear INT 21 Active}
  36.   /$80/$26/>INTR_FLAGS/<FOXS-INT21_ON{         And by [<Intr_flags],<Foxs-INT21_on}
  37.   /$9D                        {         Popf                          ; Retrieve the flags}
  38.   /$CA/$02/$00                {         RETF  2}
  39.                               {SkipI21:                               ; Invoke Int 21 w/o return}
  40.   /$9D                        {         PopF}
  41.   /$2E                        {         CS:}
  42.   /$FF/$2E/>DOS_INT21         {         Jmp dw [>Dos_INT21]}
  43.                               {;......................................................................}
  44. );
  45.