home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / teseract / source / tsstack.asm < prev    next >
Encoding:
Assembly Source File  |  1988-10-02  |  2.6 KB  |  100 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. INCLUDE mixed.inc
  32.  
  33. .MODEL small
  34. .CODE
  35.  
  36. EXTRN TESS_USERPARMS:byte
  37.  
  38. ENDIF
  39.  
  40. IFNDEF ASMCOM
  41.  
  42. hProc <TSSETSTACK FAR> PopStack:dword, BackStack:dword
  43.  
  44. ELSE
  45.  
  46. PUBLIC TSSETSTACK 
  47. TSSETSTACK proc near
  48. ;
  49. ;       in the assembler version, CS=DS=ES, and DI=offset of Popup Stack,
  50. ;       and SI = offset of background stack.
  51. ;
  52.  
  53. ENDIF
  54.  
  55.         ASSUMENODS
  56.  
  57. IFNDEF ASMCOM
  58.         les     bx,PopStack             ;load stack for popup
  59. ELSE
  60.         push    cs
  61.         pop     es
  62.         mov     bx,di
  63. ENDIF
  64.         or      bx,bx                   ;is it NULL?
  65.         jnz     not_default
  66.  
  67.         mov     WPTR [OURSSSP],sp       ;if so, use current SS:SP for
  68.         mov     WPTR [OURSSSP+2],ss     ;  popup stack
  69.         jmp     short get_back_stack
  70.  
  71. not_default:
  72.     and    bx,0fffeh        ;make sure it's even
  73.         mov     WPTR [OURSSSP],bx       ;else use passed pointer
  74.         mov     WPTR [OURSSSP+2],es
  75.  
  76. get_back_stack:
  77. IFNDEF ASMCOM
  78.         les     bx,BackStack            ;load stack pointer for background
  79. ELSE
  80.         mov     bx,si
  81. ENDIF
  82.     and    bx,0fffeh        ;make sure it's even
  83.         mov     WPTR [OUR28SP],bx       ;store it
  84.         mov     WPTR [OUR28SP+2],es
  85.  
  86. IFNDEF ASMCOM
  87.  
  88.         hRet
  89. hEndp
  90.  
  91. ELSE
  92.         ret
  93. TSSETSTACK endp
  94.  
  95. ENDIF
  96.  
  97. ENDIT
  98.