home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / masm / masm6 / tsr / tsr.inc < prev   
Encoding:
Text File  |  1990-11-16  |  3.7 KB  |  86 lines

  1. COMMENT +
  2. To force TSR to set up its own disk transfer area (see Section 17.5.3
  3. of the Programmer's Guide), define the equate constant DTA_SIZ with
  4. the desired buffer size in bytes.
  5. DTA_SIZ                 EQU     40      ; DTA size in bytes
  6. +
  7. STACK_SIZ               EQU     400h    ; Stack size in bytes
  8. STR_LEN                 EQU     20      ; Max length of multiplex ID string
  9.  
  10. TRUE                    EQU     -1
  11. FALSE                   EQU     0
  12. NULL                    EQU     0
  13. TAB                     EQU     09      ; ASCII code for Tab key
  14. LF                      EQU     10      ; ASCII code for line feed
  15. CR                      EQU     13      ; ASCII code for Enter key
  16. ESCAPE                  EQU     27      ; ASCII code for Escape key
  17. SHFT_STAT               EQU     417h    ; Offset of shift-key status mask at
  18.                                         ;   0:417h in the ROM BIOS data area
  19.  
  20. ; Return codes used by procedures in HANDLERS and INSTALL modules
  21. NOT_INSTALLED           EQU     0       ; TSR not installed
  22. IS_INSTALLED            EQU     1       ; TSR is installed
  23. ALREADY_INSTALLED       EQU     2       ; TSR already installed
  24. UNKNOWN_PROBLEM         EQU     3       ; Can't install
  25. FLAGS_NOT_FOUND         EQU     4       ; InDos / CritErr flags not found
  26. CANT_DEINSTALL          EQU     5       ; Can't deinstall
  27. WRONG_DOS               EQU     6       ; Can't handle DOS 1.x
  28. MCB_DESTROYED           EQU     7       ; Memory control block problem
  29. NO_IDNUM                EQU     8       ; No identity numbers available
  30. INVALID_ADDR            EQU     9       ; Free memory block problem
  31. OK_ACCESS               EQU     10      ; TSR accessed successfully
  32. CANT_ACCESS             EQU     11      ; TSR not installed: can't access
  33. BAD_ARGUMENT            EQU     12      ; Unrecognized argument
  34. NO_ARGUMENT             EQU     13      ; No argument in command line
  35. OK_ARGUMENT             EQU     14      ; Okay argument in command line
  36.  
  37. IFNDEF  FPVOID                          ; Already in DEMO.INC
  38. FPVOID  TYPEDEF FAR  PTR                ; Type for far pointer to void
  39. ENDIF
  40.  
  41. INTR            STRUCT                  ; Structure of handler information
  42.   Num           BYTE    ?               ; Interrupt number
  43.   Flag          BYTE    ?               ; Active flag (for device interrupts)
  44.   OldHand       FPVOID  ?               ; Address of original handler routine
  45.   NewHand       FPVOID  ?               ; Address of TSR's handler
  46. INTR            ENDS
  47.  
  48. ERRINFO         STRUCT                  ; Structure of extended error
  49.   AxReg         WORD    ?               ;   information (see Section 17.5.3
  50.   BxReg         WORD    ?               ;   of Programmer's Guide)
  51.   CxReg         WORD    ?
  52.   DxReg         WORD    ?
  53.   SiReg         WORD    ?
  54.   DiReg         WORD    ?
  55.   DsReg         WORD    ?
  56.   EsReg         WORD    ?
  57.   ErrResrv      WORD    3 DUP (0)
  58. ERRINFO         ENDS
  59.  
  60. ; Prototypes
  61. Install         PROTO FAR PASCAL,
  62.                 Param1:WORD, Param2:WORD, Param3:WORD, Param4:FAR PTR FAR
  63.  
  64. Deinstall       PROTO FAR
  65.                 ; No arguments
  66.  
  67. InitTsr         PROTO FAR PASCAL,
  68.                 PspParam:WORD, StrParam:FPVOID, ShrParam:FPVOID
  69.  
  70. KeepTsr         PROTO FAR PASCAL ParaNum:WORD
  71.  
  72. FreeTsr         PROTO FAR PASCAL PspSeg:WORD
  73.  
  74. CallMultiplex   PROTO FAR
  75.                 ; AL = Function number for multiplex handler
  76.  
  77. CallMultiplexC  PROTO FAR PASCAL FuncNum:WORD, RecvPtr:FPVOID
  78.  
  79. GetResidentSize PROTO FAR PASCAL PspSeg:WORD
  80.  
  81. FatalError      PROTO FAR PASCAL Err:WORD
  82.  
  83. GetOptions      PROTO NEAR
  84.                 ; ES = Segment of Program Segment Prefix
  85.                 ; AL = Argument character for which to scan
  86.