home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / teseract / source / tsint24.asm < prev    next >
Encoding:
Assembly Source File  |  1988-10-02  |  3.3 KB  |  116 lines

  1. IFNDEF TP4
  2.         PAGE 60,132
  3. ;----------------------------------------------------------------------------
  4. SUBTTL  TesSeRact Revision Level 1
  5. ;-----------------------------------------------------------------------------
  6. ;   TesSeRact(tm) -- A Library of Routines for Creating Ram-Resident (TSR)
  7. ;                    programs for the IBM PC and compatible Personal
  8. ;                    Computers.
  9. ;
  10. ;The software, documentation and source code are: 
  11. ;       Copyright (C) 1986, 1987, 1988 Tesseract Development Team
  12. ;       All Rights Reserved 
  13. ;       c/o Chip Rabinowitz
  14. ;       Innovative Data Concepts
  15. ;       2084 Woodlawn Avenue
  16. ;       Glenside, PA 19038
  17. ;       1-215-884-3373
  18. ;
  19. ;-----------------------------------------------------------------------------
  20. ;   This product supports the TesSeRact Standard for Ram-Resident Program 
  21. ;   Communication.  For information about TesSeRact, contact the TesSeRact 
  22. ;   Development Team at:
  23. ;       Compuserve:    70731,20
  24. ;       MCIMAIL:       315-5415
  25. ;   This MCIMAIL Account has been provided to the TesSeRact Development
  26. ;   Team by Borland International, Inc.  The TesSeRact Development Team
  27. ;   is in no way associated with Borland International, Inc.
  28. ;-----------------------------------------------------------------------------
  29.  
  30. INCLUDE TESS.INC
  31. IFDEF   ALLPUBLIC
  32. INCLUDE tsint24.pub
  33. ENDIF
  34.  
  35. .MODEL small
  36.  
  37. .CODE
  38.  
  39. EXTRN TESS_GLOBALS:byte
  40. EXTRN TESS_USERPARMS:byte
  41.  
  42. PUBLIC newint24, _TESS_ERROR24
  43.  
  44. ENDIF
  45.  
  46. ;---------------------------------------------------------------------;
  47. ;       I N T E R R U P T   2 4      -  Critical Error  -             ;
  48. ;---------------------------------------------------------------------;
  49. _TESS_ERROR24 dw        0
  50.  
  51. newint24 proc far
  52.         ASSUMENODS
  53.  
  54.         pushf
  55.         test    WPTR [STATUS],EXTRAINT24
  56.         jz      our24                   ;call user's INT 24 instead!
  57.  
  58.         POPFF
  59.         jmp     DPTR [USERINT24]
  60.  
  61. our24:
  62.         cmp     BPTR [DOSVERSION],3
  63.         jae     use_dos3
  64.  
  65.         POPFF                           ;for DOS 2.x only!
  66.  
  67.         add     sp,6                    ;discard DOS stack info
  68.         mov     _TESS_ERROR24,di        ;save the error
  69.  
  70.         les     di,DPTR [DOSCRITERR]    ;reset crit error flag
  71.         xor     al,al
  72.         stosb                           ;back to zero
  73.  
  74.         sti
  75.  
  76.         pop     ax
  77.         pop     bx
  78.         pop     cx
  79.         pop     dx
  80.         pop     si
  81.         pop     di
  82.         pop     bp
  83.         pop     ds
  84.         pop     es
  85.  
  86.         push    ax
  87.         push    dx
  88.         mov     ax,3300h                ;get ^C status is called
  89.         int     21h                     ;  to clear out DOS and fixup
  90.                                         ;future INT 21h calls
  91.  
  92.         pop     dx
  93.         pop     ax
  94.                                         ;now we have the caller's
  95.                                         ;CS,IP and Flags on the stack
  96.         mov     ax,_TESS_ERROR24        ;save error value
  97.         add     ax,19                   ;conform to DOS 3.+ error codes
  98.  
  99.         push    bp
  100.         mov     bp,sp
  101.  
  102.         or      WPTR [bp+6],01h ;set carry flag (01h) ...
  103.                                         ;    on stack
  104.         pop     bp
  105.         iret
  106.  
  107. use_dos3:
  108.         POPFF
  109.         mov     al,3
  110.         iret
  111. newint24 endp
  112.  
  113. ENDIT
  114.