home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / teseract / source / tsint2f.asm < prev    next >
Encoding:
Assembly Source File  |  1988-10-02  |  20.7 KB  |  648 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 tsint2f.pub
  33. ENDIF
  34.  
  35. .MODEL small
  36.  
  37. EXTRN TSRUSERPROC:FAR
  38.  
  39. .CODE
  40.  
  41. ;
  42.  
  43. EXTRN _TESSSTOREKEYS:near
  44. EXTRN newint8:dword
  45. EXTRN newint9:dword
  46. EXTRN newint13:dword
  47. EXTRN newint16:dword
  48. EXTRN newint1C:dword
  49. EXTRN newint21:dword
  50. EXTRN newint28:dword
  51. EXTRN _TESSBACKGROUND:near
  52. ;
  53. ; external declarations for popup interrupt vectors
  54. ;
  55. EXTRN _TESS_INTERRUPTRETURN:near
  56. EXTRN newint24:dword
  57.  
  58.  
  59. PUBLIC TESS_GLOBALS, newint2F, TESS_USERPARMS, _TESS_CPYRT, _TESS_ENDOFDATA
  60. ;PUBLIC oldint8, oldint9, oldint13, oldint16, oldint1C, oldint21, oldint28
  61. ;PUBLIC oldint2F, oldint1B, oldint24
  62.  
  63. ENDIF
  64.  
  65. ;-----------------------------------------------------------------------------
  66.  
  67. stopsnoops      db      1bh,'[2J',1ah,0   ;ANSI Clear Screen
  68.  
  69. TESS_GLOBALS equ this byte
  70.  
  71. RevLvl          db      1       ;revision level of TesSeRact Product
  72.  
  73. SaveIndosPop    db      0       ;Type of Popup in use
  74.  
  75. Was8            db      0       ;Int 8 occurred
  76.  
  77. Was13           db      0       ;Int 13 occurred
  78.  
  79. intflags        db      0       ;which interrupts are active
  80.  
  81. Soft_Int_flags  db      0       ;Soft interrupts are active
  82.  
  83. dosversion      db      0       ;current version of DOS
  84.  
  85. waitcount       db      0       ;wait to activate count
  86.  
  87. InDosflag       dd      0       ;Pointer to INDOS flag
  88.  
  89. DosCritErr      dd      0       ;Pointer to DOS Critical Error Flag
  90.  
  91. UserPSP         dw      0       ;PSP segment of interrupted program
  92.  
  93. User28PSP       dw      0       ;PSP segment of interrupted program
  94.  
  95. UserDTA         dd      0       ;DTA of interrupt program
  96.  
  97. User28DTA       dd      0       ;DTA of interrupt program
  98.  
  99. UserSS          dw      0       ;Interrupted Stack Segment
  100.  
  101. UserSP          dw      0       ;Interrupt Stack Pointer
  102.  
  103. ss28            dw      0       ;interrupt stack segment during INT 28
  104.  
  105. sp28            dw      0       ;interrupt stack pointer during INT 28
  106.  
  107. UserInt24       dd      0       ;location to store pointer to user's INT 24
  108.  
  109. ; ***************************************************************************
  110. ;       It is necessary to temporarily steal the INT 9 vector on popup
  111. ;           to work in the Microsoft QuickBasic and QuickC Programming
  112. ;           environments.
  113. ;
  114.  
  115. ;SavedInt9       dd      0       ;additional interrupt 9 vector
  116. ;
  117. OldExtErr       dw      3 dup (0) ;AX,BX,CX of ext err    ;v0.51
  118.  
  119. OldBreak        db      0       ;Saved Ctrl Break setting               ;v0.51
  120.  
  121. OldVerify       db      0       ;Saved Write Verify setting             ;v0.51
  122.  
  123. InWord4         db      0       ;flag to indicate in Word 4.0!!
  124.  
  125. WasWord4        db      0       ;flag to indicate word 4.0 popup
  126.  
  127. New_kybd_flag   db      0       ; x'10' indicates an enhanced keyboard function
  128.  
  129. Word4Delay      db      0       ;delay counter for second popup during word 4
  130.  
  131. ;
  132. ; ***************************************************************************
  133. ;       These are the bios interrupt vectors
  134. ; ***************************************************************************
  135. ;
  136. ; ***************************************************************************
  137. ;       We take Interrupts 08h, 09h, 13h, 16h, 1Ch, 21h, 28h and 2Fh
  138. ;           when we initialize for the first time.
  139. ;
  140.  
  141. oldint8         dd      0       ;BIOS Hardware Timer Interrupt
  142.                 db      BIOSI8
  143.                 dw      offset newint8  ;replacement vector
  144. oldint9         dd      0       ;BIOS Hardware Keyboard Interrupt
  145.                 db      BIOSI9   
  146.                 dw      offset newint9  ;replacement vector
  147. oldint13        dd      0       ;BIOS Disk Interrupt
  148.                 db      BIOSI13
  149.                 dw      offset newint13 ;replacement vector
  150. oldint16        dd      0       ;BIOS Software Keyboard Interrupt
  151.                 db      BIOSI16
  152.                 dw      offset newint16 ;replacement vector
  153. oldint1C        dd      0       ;BIOS Software Timer interrupt
  154.                 db      BIOSI1C
  155.                 dw      offset newint1C ;replacement vector
  156. oldint21        dd      0       ;DOS Services Interrupt
  157.                 db      DOSI21
  158.                 dw      offset newint21 ;replacement vector
  159. oldint28        dd      0       ;DOS Idle Interrupt
  160.                 db      DOSI28
  161.                 dw      offset newint28 ;replacement vector
  162. oldint2F        dd      0       ;DOS Multiplex Interrupt
  163.                 db      DOSI2F
  164.                 dw      offset newint2F ;replacement vector
  165. ;
  166. ; ***************************************************************************
  167. ;       We take Interrupts 1Bh, 23h, 24h on popup, and restore them on
  168. ;           popdown.
  169. ;
  170.  
  171. oldint1B        dd      0       ;control-C vector
  172.                 db      BIOSI1B
  173.                 dw      offset _TESS_INTERRUPTRETURN   ;replacement vector
  174. oldint23        dd      0       ;control-C vector
  175.                 db      DOSI23
  176.                 dw      offset _TESS_INTERRUPTRETURN   ;replacement vector
  177. oldint24        dd      0       ;critical error vector
  178.                 db      DOSI24
  179.                 dw      offset newint24 ;replacement vector
  180.  
  181. ;
  182. ; ***************************************************************************
  183. ;       These interrupts are taken if the user requests additional
  184. ;           interrupt servicing: 05h, 10h, 14h, 15, 17h
  185. ;
  186.  
  187. ;oldint5        dd      0       ;BIOS PrintScreen Interrupt
  188. ;               db      BIOSI5
  189. ;               dw      offset newint5 ;replacement vector
  190. ;oldint10       dd      0       ;BIOS Video Interrupt
  191. ;               db      BIOSI10
  192. ;               dw      offset newint10 ;replacement vector
  193. ;oldint14       dd      0       ;BIOS Communications Interrupt
  194. ;               db      BIOSI14
  195. ;               dw      offset newint14 ;replacement vector
  196. ;oldint15       dd      0       ;BIOS Cassette and Misc. Interrupt
  197. ;               db      BIOSI15
  198. ;               dw      offset newint15 ;replacement vector
  199. ;oldint17       dd      0       ;BIOS Printer Interrupt
  200. ;               db      BIOSI17
  201. ;               dw      offset newint17 ;replacement vector
  202. ;
  203.  
  204. ;
  205. ;
  206.  
  207. newint2F        proc    far
  208.  
  209.         ASSUMENODS
  210.         jmp     overparms
  211.  
  212. ; ***************************************************************************
  213. ;       The UserParms vector points to structure that contains individual
  214. ;           information about the TSR vectors used by this program.
  215. ;           The format of this structure is as follows:
  216. ;       IDCODE  db      8 dup (0);eight-byte unique ASCII identification code
  217. ;       IDNUM   dw      0       ;internal identification number
  218. ;       FUNCFLG dd      0       ;Bit-map of supported functions
  219. ;       HOTKEY  db      0       ;scan code of TSR Activation Key
  220. ;       SHIFTST db      0       ;shift state of TSR Activation
  221. ;       EXTHOT  dd      0       ;pointer to extra hot keys
  222. ;       STATUS  dw      0       ;TSR Status Flags
  223. ;       OURPSP  dw      0       ;TSR's PSP segment
  224. ;       OURDTA  dd      0       ;TSR's DTA region
  225. ;       DSEG    dw      0       ;Default Data Segment of TSR Program
  226. ;       SSSP    dd      0       ;TsrMain Stack Segment & Pointer
  227. ;       SS28SP  dd      0       ;TsrBackProc Stack Segment & Pointer
  228. ;
  229. ;
  230. ;       The 'FUNCFLG' variable contains a bit map of all supported 
  231. ;           functions using this multiplex interrupt.  This is primarily
  232. ;           designed to be used by TSRs that do not use the TESS library,
  233. ;           but intend to support the standard method of TSR communication
  234. ;           through INT 2fh.  The FUNCFLG variable is mapped as follows:
  235. ;           
  236. ;           Bit 0       Function 0h (check install -- REQUIRED)
  237. ;           Bit 1       Function 1h (return userparms -- REQUIRED)
  238. ;           Bit 2       Function 2h (check hotkey)
  239. ;           Bit 3       Function 3h (replace INT 24h)
  240. ;           Bits 4-7    Undefined -- reserved for future use
  241. ;           Bit 8       Function 10h (enable TSR)
  242. ;           Bit 9       Function 11h (disable TSR)
  243. ;           Bit 10      Function 12h (release TSR from RAM)
  244. ;           Bit 11      Function 13h (restart TSR)
  245. ;           Bit 12      Function 14h (get current status)
  246. ;           Bit 13      Function 15h (set TSR status)
  247. ;           Bit 14      Function 16h (get popup type)
  248. ;           Bit 15      Undefined -- reserved for future use
  249. ;           Bit 16      Function 20h (Call user procedure)
  250. ;           Bit 17      Function 21h (stuff keyboard)
  251. ;           Bits 18-31  Undefined -- reserved for future use
  252. ;
  253. ;       The 'WAS8' and 'WAS13' bytes are for the developer's convenience.
  254. ;           They are set by the TesSeRact Interrupt Handlers, but are never 
  255. ;           cleared.  It is the developer's resposibility to clear these
  256. ;           bytes if they are to be used.
  257. ;
  258. TESS_USERPARMS equ this byte
  259.  
  260. UserParms       db      8 dup (0)
  261.         IdNum   dw      0               ;TSR Identification Number
  262.         FuncFlg dd      0ffffffffh      ;supported functions
  263.         HotKey  db      0               ;Scan code of hotkey to use
  264.         ShiftSt db      0               ;shift state to use for popup
  265.         HotFlag db      0               ;Which hotkey is in use
  266.         ExtCnt  db      0               ;number of extra hotkeys
  267.         ExtHot  dd      0               ;pointer to extra hot keys
  268.         Status  dw      0               ;TSR status flags
  269.         OurPSP  dw      0               ;our PSP segment
  270.         OurDTA  dd      0               ;our DTA region
  271.         DSeg    dw      0               ;User's Default Data Segment
  272.         sssp    dd      0               ;TsrMain Stack Segment & Pointer
  273.         ss28sp  dd      0               ;TsrBackProc Stack Segment & Pointer
  274.  
  275. IFNDEF NOCKSUM
  276.  
  277. _TESS_ENDOFDATA equ this byte
  278.  
  279. cpyrt   db      'TesSeRact(tm) Library, Version ',VER
  280. IFDEF   TP4
  281. IFNDEF  ASMCOM
  282.         db      ' (TP4)'
  283. ELSE
  284.         db      ' (ASM)'
  285. ENDIF
  286. ELSE
  287.         db      ' (LIB)'
  288. ENDIF
  289.         db      0dh,0ah
  290.  
  291. _TESS_CPYRT equ this byte
  292.  
  293. cpyrt1  db      'Copyright (c) 1986, 1987, 1988 TesSeRact Development Team'
  294.         db      0dh,0ah,'All Rights Reserved',0dh,0ah,0
  295. ELSE
  296.  
  297. _TESS_ENDOFDATA equ this byte
  298. _TESS_CPYRT equ this byte
  299.  
  300. ENDIF
  301.  
  302. jmptbl:
  303. ;
  304. ;       Functions 00h through 0fh are initialization & information
  305. ;           routines
  306. ;
  307.         dw      offset check_install    ;fn 00h
  308.         dw      offset return_userparms ;fn 01h
  309.         dw      offset check_hotkey     ;fn 02h
  310.         dw      offset replace_int24    ;fn 03h
  311.         dw      offset return_data      ;fn 04h
  312.         dw      offset setextrahot      ;fn 05h
  313.         dw      offset get_out_2f       ;fn 06h
  314.         dw      offset get_out_2f       ;fn 07h
  315.         dw      offset get_out_2f       ;fn 08h
  316.         dw      offset get_out_2f       ;fn 09h
  317.         dw      offset get_out_2f       ;fn 0ah
  318.         dw      offset get_out_2f       ;fn 0bh
  319.         dw      offset get_out_2f       ;fn 0ch
  320.         dw      offset get_out_2f       ;fn 0dh
  321.         dw      offset get_out_2f       ;fn 0eh
  322.         dw      offset get_out_2f       ;fn 0fh
  323.  
  324.  
  325. ;
  326. ;       Functions 10h through 1fh are TSR manipulation & status routines
  327. ;
  328.         dw      offset enable_tsr       ;fn 10h
  329.         dw      offset disable_tsr      ;fn 11h
  330.         dw      offset release_tsr_mem  ;fn 12h
  331.         dw      offset restart_tsr      ;fn 13h
  332.         dw      offset get_tsr_stat     ;fn 14h
  333.         dw      offset set_tsr_stat     ;fn 15h
  334.         dw      offset get_popup_type   ;fn 16h
  335.         dw      offset get_out_2f       ;fn 17h
  336.         dw      offset get_out_2f       ;fn 18h
  337.         dw      offset get_out_2f       ;fn 19h
  338.         dw      offset get_out_2f       ;fn 1ah
  339.         dw      offset get_out_2f       ;fn 1bh
  340.         dw      offset get_out_2f       ;fn 1ch
  341.         dw      offset get_out_2f       ;fn 1dh
  342.         dw      offset get_out_2f       ;fn 1eh
  343.         dw      offset get_out_2f       ;fn 1fh
  344.  
  345.  
  346. ;
  347. ;       Functions 20h through 2fh are TSR utility routines
  348. ;
  349.         dw      offset call_user_proc   ;fn 20h
  350.         dw      offset stuff_keyboard   ;fn 21h
  351.         dw      offset trigger_pop      ;fn 22h
  352.         dw      offset trigger_back     ;fn 23h
  353.         dw      offset get_out_2f       ;fn 24h
  354.         dw      offset get_out_2f       ;fn 25h
  355.         dw      offset get_out_2f       ;fn 26h
  356.         dw      offset get_out_2f       ;fn 27h
  357.         dw      offset get_out_2f       ;fn 28h
  358.         dw      offset get_out_2f       ;fn 29h
  359.         dw      offset get_out_2f       ;fn 2ah
  360.         dw      offset get_out_2f       ;fn 2bh
  361.         dw      offset get_out_2f       ;fn 2ch
  362.         dw      offset get_out_2f       ;fn 2dh
  363.         dw      offset get_out_2f       ;fn 2eh
  364.         dw      offset get_out_2f       ;fn 2fh
  365.  
  366.  
  367. MAXENT  equ 2fh
  368.  
  369. ;
  370. ;  exit routines
  371. ;
  372. finish_2f:
  373.         add     sp,4                    ;get rid of two words on stack
  374.         xor     ax,ax                   ;clear AX to show we got it
  375. done_2f:
  376.         iret
  377.  
  378. next_one:
  379.         inc     cx                      ;try next higher ID code
  380. get_out_2f:
  381.         pop     bx
  382.         pop     ax
  383.  
  384. not_our_2f:
  385.         jmp     DPTR [oldint2F]
  386.  
  387.  
  388. overparms:
  389.         cmp     ax,5453h                ;ax = 5453h for TesSeRact multiplex
  390.         jne     not_our_2f
  391.  
  392.         cmp     bx,MAXENT
  393.         ja      not_our_2f
  394.  
  395.         push    ax
  396.         push    bx
  397.  
  398.         or      bx,bx                   ;do check for install first,
  399.         jz      check_install           ;so we can check ID number only
  400.                                         ;one time!
  401.  
  402.         cmp     bx,2
  403.         je      check_hotkey            ;also skip ID check for hotkey
  404.  
  405.         cmp     cx,WPTR [IDNUM]         ;if it's not for us, don't
  406.         jne     get_out_2f              ;even bother going through jump
  407.                                         ;table!
  408.  
  409.         shl     bx,1
  410.         add     bx,offset jmptbl
  411.  
  412.         jmp     cs:[bx]
  413.  
  414. check_install:
  415.                                         ;DS:SI points to ID string
  416.                                         ;DI contains hotkey for check
  417.                                         ;CX is current number in chain
  418.                                         ;   must be 0 from caller
  419.         push    cx
  420.  
  421.         push    si                      ;save SI for next one
  422.         
  423.         lea     di,[USERPARMS]
  424.         push    cs
  425.         pop     es
  426.         mov     cx,8
  427.  
  428.         rep     cmpsb
  429.  
  430.         pop     si
  431.  
  432.         pop     cx
  433.         jnz     next_one                ;no match, not us
  434.  
  435.         pop     bx
  436.         pop     ax
  437.  
  438.         mov     cx,es:[di]              ;return ID number in CX
  439.  
  440.         test    WPTR [STATUS],TSRRELEASED
  441.         jz      return_idnum
  442.  
  443.  
  444.         or      cx,0ff00h               ;say we're released!
  445.  
  446. return_idnum:
  447.  
  448.         xor     ax,ax
  449.         dec     ax                      ;AX=-1 means already here
  450.         jmp     short done_2f
  451.  
  452. ;
  453. ; Function 01h
  454. ;
  455. return_userparms:
  456.         lea     bx,[USERPARMS]
  457.         push    cs
  458.         pop     es                      ;ES:BX points to UserParms
  459.         jmp     finish_2f
  460. ;
  461. ; function 02h
  462. ;
  463. check_hotkey:
  464.         cmp     cl,BPTR HOTKEY          ;is it our hotkey?
  465.         jne     get_out_2f              ;nope -- try next one down
  466.         xor     ax,ax
  467.         dec     ax                      ;AX=-1 means key is in use
  468.         add     sp,4                    ;get rid of two words on stack
  469.         jmp     done_2f
  470.  
  471. ;
  472. ; Function 03h
  473. ;
  474. replace_int24:                          ;DS:SI points to user routine
  475.         mov     WPTR [USERINT24],si
  476.         mov     ax,ds
  477.         mov     WPTR [USERINT24+2],ax
  478.         or      WPTR [STATUS],EXTRAINT24        ;turn on the flag
  479.         jmp     finish_2f
  480.  
  481. ;
  482. ; Function 04h
  483. ;
  484. return_data:
  485.         lea     bx,[REVLVL]
  486.         push    cs
  487.         pop     es                      ;ES:BX points to TESS_GLOBALS
  488.         jmp     finish_2f
  489.  
  490. ;
  491. ; Function 05h
  492. ;
  493. setextrahot:                            ;ds:si points to new keys
  494.                                         ;dl contains count of keys
  495.         mov     WPTR [EXTRAHOTK],si
  496.         mov     ax,ds
  497.         mov     WPTR [EXTRAHOTK+2],ax
  498.         mov     BPTR [HOTCOUNT],dl
  499.         or      WPTR [STATUS],EXTRAHOTSET       ;turn on the flag
  500.         jmp     finish_2f
  501.  
  502. ;
  503. ; function 10h
  504. ;
  505. enable_tsr:
  506.         or      WPTR [STATUS],TSRENABLED
  507.         jmp     finish_2f
  508.  
  509. ;
  510. ; function 11h
  511. ;
  512. disable_tsr:
  513.         and     WPTR [STATUS],NOT TSRENABLED
  514.         jmp     finish_2f
  515.  
  516. ;
  517. ; function 12h
  518. ;
  519. release_tsr_mem:
  520.         and     WPTR [STATUS],NOT TSRENABLED
  521.         test    WPTR [STATUS],TSRACTIVE
  522.         jnz     was_active
  523.  
  524.         or      WPTR [STATUS],HOTKEYON+POPUPSET
  525. was_active:
  526.         or      WPTR [STATUS],TSRRELEASED
  527.         jmp     finish_2f
  528.  
  529. ;
  530. ; function 13h
  531. ;
  532. restart_tsr:
  533.         and     WPTR [STATUS],NOT TSRRELEASED+HOTKEYON
  534.         or      WPTR [STATUS],TSRENABLED
  535.         jmp     finish_2f
  536.  
  537. ;
  538. ; function 14h
  539. ;
  540. get_tsr_stat:
  541.         mov     bx,WPTR [STATUS]
  542.         jmp     finish_2f
  543.         
  544. ;
  545. ; function 15h
  546. ;
  547. set_tsr_stat:
  548.         mov     WPTR [STATUS],dx
  549.         jmp     finish_2f
  550. ;
  551. ; function 16h
  552. ;
  553. get_popup_type:
  554.         test    WPTR [STATUS],TSRACTIVE
  555.         jnz     get_type_2
  556.         jmp     get_out_2f
  557.  
  558. get_type_2:
  559.         mov     bl,BPTR [SAVEDINDOSFLG]
  560.         xor     bh,bh
  561.         jmp     finish_2f
  562.  
  563. ;
  564. ; function 20h
  565. ;
  566. call_user_proc:
  567.         test    WPTR [STATUS],USERPROCON
  568.         jnz     skip1
  569.         jmp     get_out_2f
  570. skip1:
  571.         test    WPTR [STATUS],INT28ACTIVE       ;wait until INT28 is finished
  572.         jnz     call_user_proc
  573.  
  574.         or      WPTR [STATUS],INT28ACTIVE       ;say int28 is busy
  575.  
  576.         cli
  577.         mov     WPTR [USER28SS],ss              ;save user's stack segment
  578.         mov     WPTR [USER28SP],sp              ;... and stack pointer
  579.  
  580.         mov     ss,WPTR [OUR28SP+2]     ;load TSR stack segment ...
  581.         mov     sp,WPTR [OUR28SP]       ;... and stack pointer
  582.  
  583.         sti
  584.  
  585.         push    ds
  586.         mov     ax,WPTR [OURDSEG]
  587.         mov     ds,ax
  588.  
  589. IFNDEF ASMCOM
  590.         push    es
  591.         push    di                      ;push user pointer on stack
  592. ENDIF
  593.  
  594. IFDEF   TP4
  595. IFNDEF  ASMCOM
  596.         call    DPTR PUSERPROC  ;call user routine (TP4 version)
  597. ELSE
  598.         call    TSRUSERPROC             ;call user routine
  599. ENDIF
  600.  
  601. ELSE
  602.         call    TSRUSERPROC             ;call user routine
  603. ENDIF
  604.  
  605.         pop     ds
  606.  
  607.         cli
  608.         mov     ss,WPTR [USER28SS]      ;restore user's stack segment
  609.         mov     sp,WPTR [USER28SP]      ;... and stack pointer
  610.         sti                             ;enable interrupts again
  611.  
  612.         and     WPTR [STATUS],NOT INT28ACTIVE   ;say int28 is finished
  613.  
  614.         jmp     finish_2f
  615.  
  616. ;
  617. ; Function 21h
  618. ;
  619. stuff_keyboard:
  620.         call    _TESSSTOREKEYS
  621.  
  622.         add     sp,4                    ;get rid of two words on stack
  623.         jmp     done_2f                 ;return with value from _TESSSTOREKEYS
  624.                                         ; 0 if stuffed, -1 if no room
  625.  
  626. ;
  627. ; function 22h
  628. ;
  629. trigger_pop:
  630.         or      WPTR [STATUS],HOTKEYON + SHIFTSON
  631.         jmp     finish_2f
  632.  
  633. ;
  634. ; function 23h
  635. ;
  636. trigger_back:
  637.     call    _TESSBACKGROUND
  638.         add     sp,4                    ;get rid of two words on stack
  639.         jmp     done_2f                 ;return with value from _TESSBACKGROUND
  640.                                         ; 0 if called, -1 if not safe
  641.  
  642.  
  643. newint2F        endp
  644.  
  645. ENDIT
  646.