;----------------------------------------------------------------------- ; FASTMOUS.ASM Public Domain 1992 Ralf Brown ; You may do with this software whatever you want, but ; common courtesy dictates that you not remove my name ; from it. ; ; Convert slow (on some systems) hardware reset mouse call into a fast ; software reset call. This is a demonstration program to show just ; how small a useful program can be made and still be fully compliant ; with the alternate multiplex interrupt specification v3.4. FASTMOUS ; contains just 128 bytes of resident code and data. ; ; Version 0.80 ; LastEdit: 4/19/92 ;----------------------------------------------------------------------- __TINY__ equ 1 ; using Tiny model INCLUDE AMIS.MAC ;----------------------------------------------------------------------- ; VERSION_NUM equ 0050h ; v0.80 VERSION_STR equ "0.80" ;----------------------------------------------------------------------- ; Declare our segments in the order we want them in the executable. ; _TEXT SEGMENT PUBLIC BYTE 'CODE' _TEXT ENDS TSRcode@ TSRcodeEnd@ ;----------------------------------------------------------------------- ; Put the resident code into its own segment so that all the offsets are ; proper for the new location after copying it into a UMB or down into ; the PSP. ; TSRcode@ start_TSRcode label byte ;----------------------------------------------------------------------- ; Declare the interrupt vectors hooked by the program, then set up the ; Alternate Multiplex Interrupt Spec handler ; HOOKED_INTS 2Dh,33h ; it isn't actually necessary to list 2Dh ALTMPX 'Ralf B','FASTMOUS',VERSION_NUM ;----------------------------------------------------------------------- ; Now the meat of the resident portion, the mouse interrupt handler. ; We can save one byte by specifying the hardware reset handler set up by ; the ALTMPX macro above ; ISP_HEADER 33h,hw_reset_2Dh or ax,ax ; hardware reset call? jne use_old_int33 ; skip if not push ds mov ds,ax ; DS <- 0000h test byte ptr ds:[417h],13h ; shift or scroll lock pressed? pop ds jnz use_old_int33 ; skip if yes mov al,21h ; do software reset instead use_old_int33: jmp ORIG_INT33h resident_code_size equ offset $ TSRcodeEnd@ ;----------------------------------------------------------------------- _TEXT SEGMENT 'CODE' ASSUME cs:_TEXT,ds:_TEXT,es:_TEXT,ss:_TEXT ORG 100h FASTMOUSE: DISPLAY_STRING banner CHECK_DOS_VER 2,00 mov bx,1000h ; set memory block to 64K mov ah,4Ah int 21h mov si,81h ; SI -> command line cld ; ensure proper direction for string ops cmdline_loop: lodsb cmp al,' ' ; skip blanks and tabs on commandline je cmdline_loop cmp al,9 je cmdline_loop and al,0DFh ; force to uppercase cmp al,'R' je removing installing: ; ; place any necessary pre-initialization here ; INSTALL_TSR ,RELBYTE,resident_code_size,BYTE,,BEST,TOPMEM,inst_notify,already_installed removing: UNINSTALL ,RELBYTE,cant_uninstall push cs pop ds DISPLAY_STRING uninstalled_msg mov ax,4C00h int 21h cant_uninstall: mov dx,offset _TEXT:cant_remove_msg jmp short exit_with_error already_installed: mov dx,offset _TEXT:already_inst_msg exit_with_error: mov ah,9 int 21h mov ax,4C01h int 21h inst_notify: DISPLAY_STRING installed_msg ret banner db 'FASTMOUS v',VERSION_STR,' Public Domain 1992 Ralf Brown ' db '[Type "FASTMOUS R" to remove]',13,10,"$" installed_msg db "Installed.",13,10,"$" already_inst_msg db "Already installed.",13,10,"$" cant_remove_msg db "Can't remove from memory.",13,10,"$" uninstalled_msg db "Removed.",13,10,"$" _TEXT ENDS end FASTMOUSE