home *** CD-ROM | disk | FTP | other *** search
- ;---------------------------------------------------------------
- ; Program: TST24.ASM
- ;
- ; Description: This program demonstrates mouse function 24.
- ;
- ; To Run: MASM TST24;
- ; LINK TST24;
- ; TST24
- ;
- ; Note: Program assumes mouse and mouse driver are installed.
- ;
- ;---------------------------------------------------------------
-
- .MODEL LARGE
- .STACK 100h
- .CODE
-
- ; This is the subroutine activated by function 24
- msub PROC
- mov ax,4 ; Function 4, Set Mouse Cursor
- xor cx,cx ; Left edge of screen
- mov dx,cx ; Top edge of screen
- int 33h ; Move the cursor
- ret
- msub ENDP
-
- ; Set up DS for the data segment
- start: mov ax,@DATA
- mov ds,ax
-
- ; Mouse Reset and Status
- xor ax,ax
- int 33h
-
- ; Show Cursor
- mov ax,1
- int 33h
-
- ; Set Interrupt Subroutine Call Mask and Address
- mov ax,SEG msub
- mov es,ax ; Segment of sub into ES
- mov ax,24 ; Mouse function 24
- mov cx,34 ; When Shift key and left button pressed
- mov dx,OFFSET msub ; Offset of sub into DX
- int 33h
-
- ; Wait for a key press, allowing testing of mouse
- mov ah,8
- int 21h
-
- ; Deactivate Function 24
- mov ax,24
- mov cx,32
- int 33h
-
- ; Reset the mouse
- xor ax,ax
- int 33h
-
- ; Exit to DOS
- exit: mov ax,4C00h
- int 21h
-
- END start
- END