home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR3 / MOUSE256.ZIP / SETMOUSE.ASM < prev   
Assembly Source File  |  1993-11-21  |  2KB  |  73 lines

  1. ;*****************************************************************************
  2. ;
  3. ; SETMOUSE.ASM
  4. ;
  5. ; Copyright (c) 1993 Ted Gruber Software.  All rights reserved.
  6. ;
  7. ; This source code is free for use in Fastgraph applications.
  8. ;
  9. ; Assemble with
  10. ;
  11. ;    MASM /MX /T SETMOUSE;
  12. ; or TASM /MX /T SETMOUSE
  13. ;
  14. ; then link SETMOUSE.OBJ with your Fastgraph application.
  15. ;
  16. ; Prototype
  17. ;
  18. ;    void setmouse (unsigned char far *masks);
  19. ;
  20. ; Description
  21. ;
  22. ;    Define the internal screen and cursor masks for the mouse driver in
  23. ;    XVGA and SVGA 256-color graphics modes.
  24. ;
  25. ; Parameters
  26. ;
  27. ;    masks        A 512-byte array of alternating screen and cursor mask
  28. ;                 values in expanded format.
  29. ;
  30. ; Return value
  31. ;
  32. ;    none
  33. ;
  34. ; Restrictions
  35. ;
  36. ;    This routine is only meaningful in modes 20 to 27.
  37. ;
  38. ;*****************************************************************************
  39.  
  40.           EXTRN   VGApairs:word
  41.  
  42. ;arg1     equ     [bp+4]        ; for small memory model
  43. arg1      equ     [bp+6]        ; for medium and large memory model
  44.  
  45. _TEXT     SEGMENT byte public 'CODE'
  46. _setmouse PROC    far
  47.           PUBLIC  _setmouse
  48.  
  49.           push    bp            ; save caller's BP register
  50.           mov     bp,sp         ; make BP point to argument list
  51.           push    si            ; save caller's SI register
  52.           push    di            ; save caller's DI register
  53.           cld                   ; set the direction flag to forward
  54.  
  55.           push    ds
  56.           pop     es            ; point ES to the data segment
  57.           lea     di,VGApairs   ; ES:DI = address of VGApairs array
  58.           lds     si,[bp+6]     ; DS:SI = address of masks parameter
  59.           mov     cx,256        ; size of VGApairs array in words
  60.           rep     movsw         ; copy masks array into the VGApairs array
  61.           push    es
  62.           pop     ds            ; restore caller's default data segment
  63.  
  64.           xor     ax,ax         ; in case setmouse was called as a function
  65.           pop     di            ; restore caller's DI register
  66.           pop     si            ; restore caller's SI register
  67.           pop     bp            ; restore caller's BP register
  68.           ret                   ; return to the caller
  69.  
  70. _setmouse ENDP
  71. _TEXT     ENDS
  72.           END
  73.