home *** CD-ROM | disk | FTP | other *** search
- IFNDEF TP4
- PAGE 60,132
- ;----------------------------------------------------------------------------
- SUBTTL TesSeRact Revision Level 1
- ;-----------------------------------------------------------------------------
- ; TesSeRact(tm) -- A Library of Routines for Creating Ram-Resident (TSR)
- ; programs for the IBM PC and compatible Personal
- ; Computers.
- ;
- ;The software, documentation and source code are:
- ;
- ; Copyright (C) 1986, 1987, 1988 Tesseract Development Team
- ; All Rights Reserved
- ;
- ; c/o Chip Rabinowitz
- ; Innovative Data Concepts
- ; 2084 Woodlawn Avenue
- ; Glenside, PA 19038
- ; 1-215-884-3373
- ;
- ;-----------------------------------------------------------------------------
- ; This product supports the TesSeRact Standard for Ram-Resident Program
- ; Communication. For information about TesSeRact, contact the TesSeRact
- ; Development Team at:
- ; Compuserve: 70731,20
- ; MCIMAIL: 315-5415
- ; This MCIMAIL Account has been provided to the TesSeRact Development
- ; Team by Borland International, Inc. The TesSeRact Development Team
- ; is in no way associated with Borland International, Inc.
- ;-----------------------------------------------------------------------------
-
- INCLUDE TESS.INC
- INCLUDE mixed.inc
-
- IFDEF ALLPUBLIC
- INCLUDE tschkres.pub ;public definitions (uses Periscope PUBLIC.COM /E)
- ENDIF
-
- .MODEL small
- .CODE
-
- EXTRN _TESS_INTERRUPTRETURN:near
-
- PUBLIC _TESS_TEMPPARMS
-
- ENDIF
-
- IFNDEF ASMCOM
-
- hProc <TSVERIFY2F FAR>
-
- ELSE
-
- hProc <TSVERIFY2F NEAR> ; This procedure is used internally
- ; by TsCheckResident to ensure
- ENDIF ; that a valid INT 2Fh vector
- ASSUMENODS ; exists. DOS 2.x initializes
- ; this vector to 00 00
- xor ax,ax
- mov es,ax
- mov bx,2fh
- shl bx,1
- shl bx,1
- mov ax,es:[bx]
- or ax,es:[bx+2]
- jnz ok_2f
-
- mov ax,offset _TESS_INTERRUPTRETURN
- mov es:[bx],ax
- mov es:[bx+2],cs
- ok_2f:
-
- hRet
- hEndp
-
-
- _TESS_TEMPPARMS db 10 dup(0) ; temporary data area to hold
- ; ID String and ID Number on return
- ; from TSCHECKRESIDENT before TsDoInit
- ; v0.66
-
-
- IFNDEF ASMCOM
-
- hProc <TSCHECKRESIDENT FAR> <USES SI, DI>, UserName:dword, IDNumber:dword
-
- else
-
- PUBLIC TSCHECKRESIDENT
- TSCHECKRESIDENT proc near
- ;
- ; in the assembler version, ES=DS=CS on entry, and SI should
- ; the offset of the UserName, DI should contain the address
- ; to store the returned ID number
- ;
- ENDIF
- push ds
-
- IFDEF ASMCOM
- push di
- push si ;save parms for later
- ENDIF
-
- ASSUMENODS
-
- call TSVERIFY2F
-
- IFNDEF ASMCOM
- lds si,UserName
- ELSE
- pop si ;get UserName back
- ENDIF
- push ds
- push si
- xor cx,cx ;call Multiplex Function 0
- xor bx,bx
- mov ax,5453h
- int 2fh
-
- pop si
- pop ds
-
- cmp ax,-1 ; if AX==ffff, we're already
- je already_res ; resident
-
- push cx
- lea di,_TESS_TEMPPARMS
- push cs
- pop es
- mov cx,8 ;store the user name in TsrParms
- rep movsb ;structure
- pop ax
-
- stosw ;store the ID Number returned by
- ;function 0 in TsrParms
- IFNDEF ASMCOM
- les di,IDNumber
- ELSE
- pop di
- ENDIF
-
- stosw ;also store ID number in user's
- ;pointer
- xor ax,ax
- jmp short check_out
-
- already_res:
- IFNDEF ASMCOM
- les di,IDNumber ;store returned id number of
- mov es:[di],cx ;already loaded TSR in user data
- ELSE
- pop di
- mov [di],cx
- ENDIF
-
- check_out:
- pop ds
- IFNDEF ASMCOM
- hRet
- hEndp
-
- ELSE
- ret
- TSCHECKRESIDENT endp
-
- ENDIF
-
- ENDIT
-
-