home *** CD-ROM | disk | FTP | other *** search
/ Share Gallery 1 / share_gal_1.zip / share_gal_1 / LA / LA004.ZIP / TESS-A.ARC / TESS.INC < prev    next >
Text File  |  1988-10-02  |  18KB  |  457 lines

  1.         PAGE 60,132
  2. ;       TITLE TESS.INC - TesSeRact Copyright Notice and Data Definitions
  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. ;-----------------------------------------------------------------------------
  14. COMMENT | 
  15.  
  16.      This product  supports the  TesSeRact(TM)  Standard  for  Ram-Resident
  17.      Program Communication.   For  information about TesSeRact, contact the
  18.      TesSeRact Development Team at:
  19.      
  20.           TesSeRact Development Team
  21.           c/o Chip Rabinowitz
  22.           2084 Woodlawn Avenue
  23.           Glenside, PA 19038
  24.           1-215-884-3373
  25.      
  26.           Compuserve:    70731,20
  27.           MCIMAIL:       315-5415
  28.      
  29.      This MCIMAIL  Account has  been provided  to the TesSeRact Development
  30.      Team by Borland International, Inc.  The TesSeRact Development Team is
  31.      in no  way associated with Borland International, Inc.  TesSeRact is a
  32.      trademark of the TesSeRact Development Team.
  33.  
  34. ***************************************************************************
  35.                              Copyright Notice
  36. ***************************************************************************
  37.  
  38. This  document,   other  accompanying  written  and  disk-based  notes  and
  39. specifications, and all referenced and related program files, demonstration
  40. code and  object modules  accompanying this document are copyrighted by the
  41. TesSeRact Development  Team.   The copyright  owner hereby licenses you to:
  42. use the  software; make as many copies of the software and documentation as
  43. you wish;  give exact  copies of the original to anyone; and distribute the
  44. software and  documentation in  its unmodified  form via  electronic means.
  45. There is no charge for any of the above.
  46.  
  47. You are specifically prohibited from charging, or requesting donations, for
  48. any such  copies, however made.  Exceptions may be granted to organizations
  49. which charge  a small  fee for  materials, handling,  postage  and  general
  50. overhead.  NO   ORGANIZATION  IS   AUTHORIZED  TO  CHARGE  ANY  AMOUNT  FOR
  51. DISTRIBUTION OF  THE SOFTWARE  OR DOCUMENTATION UNDER ANY OTHER CONDITIONS.
  52. Organizations which  charge a fee for distribution of any and all TesSeRact
  53. materials, except  as noted  above or  with the express, written consent of
  54. the TesSeRact  Development Team,  will be  considered in  violation of this
  55. copyright, and will be prosecuted to the full extent of the law.
  56.  
  57. In addition,  you are specifically prohibited from making any modifications
  58. to the  TesSeRact Library  Routines and/or documentation, unless you have a
  59. license for  the use  of the  source code.   Under  no circumstances is the
  60. copyright notice embedded in the TesSeRact code to be modified or removed.
  61.  
  62. This is  not free  software.   This license allows you to use this software
  63. without charge  for a period of 30 days.  In order to include this software
  64. as part  of any  product, either commercial, shareware, freeware, or public
  65. domain, registration  is required.   TesSeRact  may not  be included in any
  66. product for  any use  without registration.   Any such use of the TesSeRact
  67. product are in violation of federal copyright laws, and will be prosecuted.
  68.  
  69. No copy  of the  software may  be distributed  or given  away without  this
  70. accompanying documentation; this notice must not be removed.
  71.  
  72.  
  73. ***************************************************************************
  74.                                  Warranty
  75. ***************************************************************************
  76.  
  77. There is  no warranty  of any  kind associated  with this software, and the
  78. copyright owner  is not  liable for  damages of  any kind.   By  using this
  79. software, you  agree to  this.  Every effort has been made by the TesSeRact
  80. Development Team  to make  this product  bug-free.   However, the nature of
  81. software development  is  that  it  is  impossible  to  guarantee  bug-free
  82. software.
  83.  
  84. In the event a verifiable bug is found, the TesSeRact Development Team will
  85. make every  attempt to  repair the  bug as  soon as possible.  
  86.  
  87. ***************************************************************************
  88.                              Acknowledgements
  89. ***************************************************************************
  90.  
  91. Grateful appreciation  is expressed  to CompuServe Information Service, the
  92. IBM Software  Forums and  their Sysops, and Computer Language Magazine, for
  93. providing us  with the  means to  accomplish the  development of TesSeRact.
  94. Without their  gracious assistance,  TesSeRact could  never have  come into
  95. existence.
  96.  
  97. And let's not forget Anne Marie, who suffered through the long evenings and
  98. nights spent getting this product ready.
  99.  
  100. ***************************************************************************
  101. The TesSeRact Development Team:
  102. ***************************************************************************
  103.      
  104.      Team Leader:   Chip Rabinowitz
  105.      Developers:    Lane Ferris
  106.                     Kim Kokkonen
  107.                     Jim Kyle
  108.                     Neil J. Rubenking
  109.                     Barry Simon
  110.                     Rick Wilson
  111.      Contributors:  Thomas Brandenborg
  112.                     Chris Dunford
  113.                     John Friend
  114.                     Mark Horvatich
  115.                     John Hensley
  116.      Advisors:      Robert Bierman
  117.                     David Intersimone
  118.                     Rick Kraus
  119.                     David Moskowitz
  120.                     Gary Saxer
  121.  
  122. ***************************************************************************
  123.  
  124. |                                       ; end of comment block
  125.  
  126.  
  127. Pascal equ 1                            ;defined for mixed.inc
  128.  
  129. ;
  130. ; dos delimiters and other utility equates
  131. ;
  132. CR              equ     0dh
  133. LF              equ     0ah
  134. SPACE           equ     ' '
  135. COMMA           equ     ','
  136. SEMICOLON       equ     ';'
  137. EQUAL_SIGN      equ     '='
  138. TAB             equ     9
  139.  
  140. ;
  141. ; These are the bits of the shift register at absolute 40:17 HEX
  142. ;
  143. ALTBIT          equ     08h
  144. CTLBIT          equ     04h
  145. LSHBIT          equ     02h
  146. RSHBIT          equ     01h
  147.  
  148. ;
  149. ; These are the keyboard ports
  150. ;
  151. KB_DATA         equ     60h
  152. KB_CTL          equ     61h
  153.  
  154. ;
  155. ; BIOS data areas
  156. ;
  157. KB_FLG1         equ     17h
  158. KB_FLG2         equ     18h
  159. BIOS_DATA       equ     40h
  160.  
  161. ;
  162. ; Command word 3 of the 8259 interrupt ctrlr
  163. ;
  164. OCW3_8259       equ     20h
  165.  
  166.  
  167. ;------------------------------------------------------------------------------
  168. ;       Text Equates for Global Variables
  169. ;------------------------------------------------------------------------------
  170.  
  171. TsrIntTable struc
  172.         OldVector       dd  ?           ;Old Interrupt Vector
  173.         IntNumber       db  ?           ;Interrupt Number
  174.         NewVector       dw  ?           ;offset of new vector
  175. TsrIntTable ends
  176.  
  177. ExtraHot struc
  178.         ExtHotKey       db  ?           ;hotkey to check for
  179.         ShiftState      db  ?           ;shift state for this hot key
  180.         FlagByte        db  ?           ;flag value to use
  181.                                         ; MAY NOT BE ZERO!!!
  182. ExtraHot ends
  183.  
  184. REVLVL        equ  <TESS_GLOBALS>       ;Revision Level of TESS Lib
  185. SAVEDINDOSFLG equ  <TESS_GLOBALS + 1>   ;Type of popup in effect
  186. WASINT8       equ  <TESS_GLOBALS + 2>   ;An Interrupt 08h occurred
  187. WASINT13      equ  <TESS_GLOBALS + 3>   ;An Interrupt 13h occurred
  188. INTFLAGS      equ  <TESS_GLOBALS + 4>   ;Which interrupts are active
  189. SOFTINTFLAGS  equ  <TESS_GLOBALS + 5>   ;Which soft ints are active
  190. DOSVERSION    equ  <TESS_GLOBALS + 6>   ;current major revision of DOS
  191. WAITCOUNT     equ  <TESS_GLOBALS + 7>   ;Count to wait before popping up
  192. INDOSFLAG     equ  <TESS_GLOBALS + 8>   ;Pointer to DOS INDOS flag
  193. DOSCRITERR    equ  <TESS_GLOBALS + 12>  ;Pointer to DOS Critical Error
  194. USERPSP       equ  <TESS_GLOBALS + 16>  ;PSP segment of user program
  195. USER28PSP     equ  <TESS_GLOBALS + 18>  ;PSP segment of user program
  196. USERDTA       equ  <TESS_GLOBALS + 20>  ;DTA of interrupted program
  197. USER28DTA     equ  <TESS_GLOBALS + 24>  ;DTA of interrupted program
  198. USERSS        equ  <TESS_GLOBALS + 28>  ;Stack segment of user program
  199. USERSP        equ  <TESS_GLOBALS + 30>  ;Stack pointer of user program
  200. USER28SS      equ  <TESS_GLOBALS + 32>  ;Stack segment of user program
  201. USER28SP      equ  <TESS_GLOBALS + 34>  ;Stack pointer of user program
  202. USERINT24     equ  <TESS_GLOBALS + 36>  ;pointer to use INT 24 handler
  203. OLDEXTERR     equ  <TESS_GLOBALS + 40>  ;storage for old DOS 3 extended
  204.                                         ;    error information
  205. OLDBREAK      equ  <TESS_GLOBALS + 46>  ;Old Break Setting
  206. OLDVERIFY     equ  <TESS_GLOBALS + 47>  ;Old Verify Setting
  207. INWORD4       equ  <TESS_GLOBALS + 48>  ;flag to indicate in WORD 4.0
  208. WASWORD4      equ  <TESS_GLOBALS + 49>  ;word 4 special popup flag
  209. NEWKBDFLAG    equ  <TESS_GLOBALS + 50>  ;Enhanced Keyboard Call in use
  210. WORD4DELAY    equ  <TESS_GLOBALS + 51>  ;Delay for Word 4
  211.  
  212. OLDINT8       equ  <TESS_GLOBALS + 52>  ;Interrupt vector tables
  213. OLDINT9       equ  <TESS_GLOBALS + 59>  ;
  214. OLDINT13      equ  <TESS_GLOBALS + 66>  ;
  215. OLDINT16      equ  <TESS_GLOBALS + 73>  ;
  216. OLDINT1C      equ  <TESS_GLOBALS + 80>  ;
  217. OLDINT21      equ  <TESS_GLOBALS + 87>  ;
  218. OLDINT28      equ  <TESS_GLOBALS + 94>  ;
  219. OLDINT2F      equ  <TESS_GLOBALS + 101> ;
  220. OLDINT1B      equ  <TESS_GLOBALS + 108> ;
  221. OLDINT24      equ  <TESS_GLOBALS + 115> ;
  222.  
  223.  
  224. USERPARMS     equ  <TESS_USERPARMS>      ;Unique TSR Identification String
  225.                                          ;NOTE -- NOT NULL-TERMINATED
  226. IDNUM         equ  <TESS_USERPARMS + 8>  ;Unique TSR Identification Number
  227. FUNCFLG       equ  <TESS_USERPARMS + 10> ;Bit map of supported functions
  228. HOTKEY        equ  <TESS_USERPARMS + 14> ;Hotkey used by TSR for popup
  229. SHIFTST       equ  <TESS_USERPARMS + 15> ;ShiftState used by this TSR pop
  230. HOTFLAG       equ  <TESS_USERPARMS + 16> ;which hotkey is in use
  231. HOTCOUNT      equ  <TESS_USERPARMS + 17> ;Number of Extra Hotkeys to use
  232. EXTRAHOTK     equ  <TESS_USERPARMS + 18> ;Pointer to extra hotkeys
  233. STATUS        equ  <TESS_USERPARMS + 22> ;Current TSR Status Flags
  234. OURPSP        equ  <TESS_USERPARMS + 24> ;TSR's PSP Segment
  235. OURDTA        equ  <TESS_USERPARMS + 26> ;Pointer to TSR's DTA region
  236. OURDSEG       equ  <TESS_USERPARMS + 30> ;TSR's Default Data Segment
  237. OURSSSP       equ  <TESS_USERPARMS + 32> ;Pointer to Popup Stack Area
  238. OUR28SP       equ  <TESS_USERPARMS + 36> ;Pointer to Background Stack
  239.  
  240. ;
  241. ;       Keyboard Scan Codes
  242. ;
  243. TSRHOT_A        equ     1eh
  244. TSRHOT_B        equ     30h
  245. TSRHOT_C        equ     2eh
  246. TSRHOT_D        equ     20h
  247. TSRHOT_E        equ     12h
  248. TSRHOT_F        equ     21h
  249. TSRHOT_G        equ     22h
  250. TSRHOT_H        equ     23h
  251. TSRHOT_I        equ     17h
  252. TSRHOT_J        equ     24h
  253. TSRHOT_K        equ     25h
  254. TSRHOT_L        equ     26h
  255. TSRHOT_M        equ     32h
  256. TSRHOT_N        equ     31h
  257. TSRHOT_O        equ     18h
  258. TSRHOT_P        equ     19h
  259. TSRHOT_Q        equ     10h
  260. TSRHOT_R        equ     13h
  261. TSRHOT_S        equ     1fh
  262. TSRHOT_T        equ     14h
  263. TSRHOT_U        equ     16h
  264. TSRHOT_V        equ     2fh
  265. TSRHOT_W        equ     11h
  266. TSRHOT_X        equ     2dh
  267. TSRHOT_Y        equ     15h
  268. TSRHOT_Z        equ     2ch
  269. TSRHOT_0        equ     0bh
  270. TSRHOT_1        equ     02h
  271. TSRHOT_2        equ     03h
  272. TSRHOT_3        equ     04h
  273. TSRHOT_4        equ     05h
  274. TSRHOT_5        equ     06h
  275. TSRHOT_6        equ     07h
  276. TSRHOT_7        equ     08h
  277. TSRHOT_8        equ     09h
  278. TSRHOT_9        equ     0ah
  279. TSRHOT_F1       equ     3bh
  280. TSRHOT_F2       equ     3ch
  281. TSRHOT_F3       equ     3dh
  282. TSRHOT_F4       equ     3eh
  283. TSRHOT_F5       equ     3fh
  284. TSRHOT_F6       equ     40h
  285. TSRHOT_F7       equ     41h
  286. TSRHOT_F8       equ     42h
  287. TSRHOT_F9       equ     43h
  288. TSRHOT_F10      equ     44h
  289.     
  290. ;
  291. ;Enhanced Keyboards only
  292. ;
  293. ;May not work with all computers, keyboards
  294. ;
  295. TSRHOT_F11      equ     57h
  296. TSRHOT_F12      equ     58h
  297.  
  298. ;
  299. ;defines for ShiftState
  300. ;
  301. TSRPOPRSHIFT    equ     01h
  302. TSRPOPLSHIFT    equ     02h
  303. TSRPOPCTRL      equ     04h
  304. TSRPOPALT       equ     08h
  305.  
  306. ;  #defines for TSRFLAGS
  307. ;  
  308. TSRUSEPOPUP     equ     0010h   ;Use TsrMain()
  309. TSRUSEBACK      equ     0020h   ;Use TsrBackProc()
  310. TSRUSETIMER     equ     0040h   ;Use TsrTimer()
  311. TSRUSEUSER      equ     0100h   ;Use TsrUserProc()
  312. NOPOPGRAPH      equ     1000h   ;Don't pop over graphics
  313. NOPOPCOMMAND    equ     2000h   ;Don't pop over command-line
  314.  
  315. ;  #defines for TsrStatus flags
  316. ;  
  317. HOTKEYON        equ     01h     ;hot key pressed
  318. SHIFTSON        equ     02h     ;shift states match
  319. TSRACTIVE       equ     04h     ;tsr is running in foreground
  320. INT28ACTIVE     equ     08h     ;INT28 routine is running in background
  321. ;
  322. POPUPSET        equ     10h     ;Popup resident routine installed
  323. BACKSET         equ     20h     ;Interrupt 28 Background routine installed
  324. TIMERSET        equ     40h     ;Interrupt 1C Timer Tick routine installed
  325. EXTRAHOTSET     equ     80H     ;Extra Hot Keys have been installed
  326. ;
  327. USERPROCON      equ     100h    ;User-defined procedure installed
  328. TSRENABLED      equ     200h    ;TSR currently enabled
  329. TSRRELEASED     equ     400h    ;TSR being released
  330. EXTRAINT24      equ     800h    ;user installed replacement INT 24h routine
  331. ;------------------------------------------------------------------------------
  332.  
  333. ;
  334. ; EQUates for IntFlags and SoftFlags
  335. ;
  336. ININT13         equ     04h     ;Interrupt 13 is currently active
  337. ININT21         equ     08h     ;Interrupt 21 is currently active
  338. ININT16         equ     10h     ;Interrupt 16 is currently active
  339. ININT28         equ     20h     ;Interrupt 28 is currently active
  340. ININT08         equ     40h     ;Interrupt 08 is currently active
  341. ININT1C         equ     80h     ;Interrupt 1C is currently active
  342.  
  343. ;
  344. ; EQUates for Keyboard Stuffing
  345. ;
  346. STUFF_SLOW      equ     0
  347. STUFF_MED       equ     1
  348. STUFF_FAST      equ     2
  349.  
  350. ;
  351. ; EQUates used internally by TesSeRact routines
  352. ;
  353. BIOSI8          equ     08h     ;Bios Timer interrupt
  354. BIOSI9          equ     09h     ;BIOS Hardware Keyboard interrupt
  355. BIOSIB          equ     0Bh
  356. BIOSIC          equ     0Ch
  357. BIOSI10         equ     10h
  358. BIOSI13         equ     13h     ;Bios Disk interrupt
  359. BIOSI14         equ     14h
  360. BIOSI15         equ     15h
  361. BIOSI16         equ     16h     ;Bios Keyboard interrupt
  362. BIOSI17         equ     17h
  363. BIOSI1C         equ     1Ch
  364. DOSI21          equ     21h     ;DOS service router interrupt
  365. DOSI28          equ     28h     ;DOS Idle interrupt
  366. BIOSI1B         equ     1Bh
  367. DOSI23          equ     23h
  368. DOSI24          equ     24h
  369. DOSI2F          equ     2fh
  370. BIOSI5          equ     05h
  371.  
  372. NUMINTS_1       equ     8
  373. NUMINTS_2       equ     3
  374. NUMINTS_3       equ     5
  375.  
  376. ;------------------------------------------------------------------------------
  377. ;       General Text Equates
  378. ;------------------------------------------------------------------------------
  379.  
  380. BPTR            equ     <BYTE PTR>
  381. WPTR            equ     <WORD PTR>
  382. DPTR            equ     <DWORD PTR>
  383.  
  384. ;------------------------------------------------------------------------------
  385. ;       Macros
  386. ;------------------------------------------------------------------------------
  387.  
  388. setdta  macro   ddptr
  389.         push    ds
  390.         mov     ax,1a00h                ;;Function used to set current DTA 
  391.         mov     dx,word ptr ddptr       ;;Offset of DTA 
  392.         mov     ds,word ptr ddptr+2     ;;Segment of DTA
  393.         int     21h                     ;;Execute MSDos function request
  394.         pop     ds
  395.         endm
  396.  
  397. getdta  macro   ddptr
  398.         push    es
  399.         mov     ax,2f00h                ;;Function used to get current DTA 
  400.         int     21h                     ;;Execute MSDos function request
  401.         mov     word ptr ddptr+2,es     ;;Segment of DTA returned by DOS
  402.         mov     word ptr ddptr,bx       ;;Offset of DTA returned
  403.         pop     es
  404.         endm
  405.  
  406. ASSUMENODS macro                        ;; Macro to set assumes for various
  407. IFDEF   TP4                             ;; segment configurations
  408. IFNDEF  ASMCOM                          ;; this one is used when DS register
  409.         ASSUME  CS:CODE, DS:NOTHING     ;; is undefined
  410. ELSE
  411.         ASSUME  CS:@code, DS:NOTHING
  412. ENDIF
  413. ELSE
  414.         ASSUME  CS:@code, DS:NOTHING
  415. ENDIF
  416.         endm
  417.  
  418. ASSUMEDS macro                          ;; Macro to set assumes for various
  419. IFDEF   TP4                             ;; segment configurations
  420. IFNDEF  ASMCOM                          ;; this one is used when DS register
  421.         ASSUME  CS:CODE, DS:CODE        ;; is same as CS register
  422. ELSE
  423.         ASSUME  CS:@code, DS:@code
  424. ENDIF
  425. ELSE
  426.         ASSUME  CS:@code, DS:@code
  427. ENDIF
  428.         endm
  429.  
  430. POPFF   macro                           ;; Macro used to avoid the 'popf'
  431. IFNDEF  TP4                             ;; bug on early 80286 chips
  432. IFNDEF  ASMCOM
  433.         EXTRN _TESS_INTERRUPTRETURN:near
  434. ENDIF
  435. ENDIF
  436.         push    cs
  437.         call    _TESS_INTERRUPTRETURN
  438.         endm
  439.  
  440. IFDEF TP4
  441.         ENDIT MACRO
  442.                 PAGE
  443.         ENDM
  444. ELSE
  445. IFDEF MASM
  446.         ENDIT MACRO
  447.                 END
  448.         ENDM
  449. ELSE
  450.         ENDIT equ END
  451. ENDIF
  452. ENDIF
  453.