home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / teseract / source / tsint1c.asm < prev    next >
Encoding:
Assembly Source File  |  1988-10-02  |  3.5 KB  |  138 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 tsint1c.pub
  33. ENDIF
  34.  
  35. .MODEL small
  36.  
  37. EXTRN TSRTIMERPROC:FAR
  38.  
  39. .CODE
  40.  
  41. EXTRN TESS_GLOBALS:byte
  42. EXTRN TESS_USERPARMS:byte
  43.  
  44. PUBLIC newint1C
  45.  
  46. ENDIF
  47.  
  48. ;---------------------------------------------------------------------;
  49. ;       I N T E R R U P T   1 C     -   t i m e r  -                  ;
  50. ;---------------------------------------------------------------------;
  51. newint1C proc far
  52.  
  53.         ASSUMENODS
  54.  
  55.         push    ds
  56.  
  57.         push    cs
  58.         pop     ds
  59.  
  60.         ASSUMEDS
  61.  
  62.         pushf
  63.  
  64.         test    WPTR [STATUS],TSRENABLED        ;is TSR enabled?
  65.         jz      do_old1c                ;no -- do original
  66.  
  67.         test    BPTR [SOFTINTFLAGS],ININT1C     ;See if recursion has taken place
  68.         jz      start_new_int1C         ;If not continue with new int 1C
  69.  
  70. do_old1c:
  71.         POPFF
  72.         pop     ds
  73.  
  74.         ASSUMENODS
  75.  
  76.         jmp     DPTR [OLDINT1C]         ;Jump to original int 1C
  77.  
  78. start_new_int1C:
  79.         ASSUMEDS
  80.  
  81.         or      BPTR [SOFTINTFLAGS],ININT1C     ;Set the int 1C active flag
  82.         POPFF
  83.  
  84.         pushf                           ;simulate interrupt ...
  85.         call DPTR [OLDINT1C]            ;do the original
  86.  
  87.         sti
  88.  
  89.         push    ax
  90.  
  91.         mov     ax,WPTR [STATUS]        ;is a Timer Procedure set?
  92.         test    ax,TIMERSET
  93.         jz      exit_1C                 ;nope
  94.  
  95.         push    bx
  96.         push    cx                      ;save registers
  97.         push    dx
  98.         push    es
  99.  
  100.         mov     ax,WPTR [OURDSEG]       ;set up data segments
  101.  
  102.         push    ax
  103.         push    ax
  104.         pop     ds
  105.         pop     es
  106.  
  107.         ASSUMENODS
  108.  
  109.         sti                             ;make sure ints are enabled ;v .66
  110.  
  111. IFDEF TP4
  112. IFNDEF ASMCOM
  113.         call    DPTR PTIMERPROC ;for TP4 must use procptr
  114. ELSE
  115.         call    TSRTIMERPROC            ;non-TP version
  116. ENDIF
  117. ELSE
  118.         call    TSRTIMERPROC            ;non-TP version
  119. ENDIF
  120.  
  121. end_1C:
  122.         pop     es
  123.         pop     dx
  124.         pop     cx
  125.         pop     bx
  126.  
  127. exit_1C:
  128.         and     BPTR [SOFTINTFLAGS],NOT ININT1C
  129.         pop     ax
  130.         pop     ds
  131.         iret
  132.  
  133. newint1C endp
  134.  
  135. ENDIT
  136.