home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / turbopas / tsrhelp.zip / CHECK.INC next >
Text File  |  1992-05-29  |  1KB  |  46 lines

  1. ;---------------------------------------------------------------------------
  2. ; Program Name:  Check.Inc
  3. ;
  4. ; Author:        Steve Poulsen
  5. ;
  6. ; This program is an include file to check if an interrupt points to the
  7. ; procedure about to be removed.  If it doesn't [another interrupt is present]
  8. ; it could be dangerous to try to restore the vector.  In this case the carry
  9. ; is set.  Otherwise a carry clear is returned.  AL is the interrupt to check
  10. ; and ES is the segment to match it with.
  11. ;
  12. ; Entry:
  13. ;       AL = interrupt
  14. ;       ES = segment
  15. ; Return:
  16. ;       Carry Set : no match
  17. ;       Carry Clr : match
  18. ; Changes:
  19. ;       AX
  20. ;---------------------------------------------------------------------------
  21.  
  22. Check   Proc    Far
  23.         Assume CS:Code,DS:Nothing,ES:Nothing
  24.         CLC 
  25.         Push ES
  26.         Push CX
  27.         Push BX
  28.         Push DS
  29.         
  30.         Mov CX,ES                   ; Segment of procedure
  31.         Mov AH,35h                  ; Find segment vector points to
  32.         Int 21h
  33.         Mov AX,ES                   ; Segment of vector
  34.         Cmp CX,AX                   ; Are they the same?
  35.         Pop DS
  36.         Pop BX
  37.         Pop CX
  38.         Pop ES
  39.         JE No_Error_x               
  40.         STC                         ; If not then set the carry
  41.                 
  42. No_Error_x:
  43.         
  44.         Ret
  45. Check   EndP        
  46.