home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PROGRAMS / UTILS / MOUSE / MSMOUSE1.ZIP / ASM.ZIP / TST24.ASM < prev   
Encoding:
Assembly Source File  |  1989-02-10  |  1.6 KB  |  66 lines

  1. ;---------------------------------------------------------------
  2. ; Program:      TST24.ASM
  3. ;
  4. ; Description:  This program demonstrates mouse function 24.
  5. ;
  6. ; To Run:       MASM TST24;
  7. ;               LINK TST24;
  8. ;               TST24
  9. ;
  10. ; Note: Program assumes mouse and mouse driver are installed.
  11. ;
  12. ;---------------------------------------------------------------
  13.  
  14. .MODEL  LARGE
  15. .STACK  100h
  16. .CODE
  17.  
  18. ; This is the subroutine activated by function 24
  19. msub    PROC
  20.         mov ax,4                  ; Function 4, Set Mouse Cursor
  21.         xor cx,cx                 ; Left edge of screen
  22.         mov dx,cx                 ; Top edge of screen
  23.         int 33h                   ; Move the cursor
  24.         ret
  25. msub    ENDP
  26.  
  27.         ; Set up DS for the data segment
  28. start:  mov ax,@DATA
  29.         mov ds,ax
  30.  
  31.         ; Mouse Reset and Status
  32.         xor ax,ax
  33.         int 33h
  34.  
  35.         ; Show Cursor
  36.         mov ax,1
  37.         int 33h
  38.  
  39.         ; Set Interrupt Subroutine Call Mask and Address
  40.         mov ax,SEG msub
  41.         mov es,ax                 ; Segment of sub into ES
  42.         mov ax,24                 ; Mouse function 24
  43.         mov cx,34                 ; When Shift key and left button pressed
  44.         mov dx,OFFSET msub        ; Offset of sub into DX
  45.         int 33h
  46.  
  47.         ; Wait for a key press, allowing testing of mouse
  48.         mov ah,8
  49.         int 21h
  50.  
  51.         ; Deactivate Function 24
  52.         mov ax,24
  53.         mov cx,32
  54.         int 33h
  55.  
  56.         ; Reset the mouse
  57.         xor ax,ax
  58.         int 33h
  59.  
  60.         ; Exit to DOS
  61. exit:   mov ax,4C00h
  62.         int 21h
  63.  
  64. END     start
  65.         END
  66.