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

  1. ;* Eric Fogelin
  2.  
  3. func12          segment para public 'CODE'
  4.                 assume  cs:func12
  5.                 public  _MSFCN12        ; Must declare PUBLIC with underscore
  6.                                         ;    for reference in C program.
  7. ;
  8. _MSFCN12        proc    far             ; Function 12 enables a far CALL.
  9.  
  10.                 ; Routine to display custom cursor.
  11.                 ;   Hide cursor at old location/restore what was under cursor
  12.                 ;   Save what's under cursor's new position and show cursor
  13.                 ; Return to mouse ISS.
  14.  
  15. ;*********************** Example Specific Code **********************
  16.                 ; Save current mouse cursor position
  17.                 push    cx
  18.                 push    dx
  19.                 mov     cx, cs:[oldx]
  20.                 mov     dx, cs:[oldy]
  21.                 ; Hide cursor at old position
  22.                 mov     bh, 0           ; Video Page 0
  23.                 mov     al, 0           ; Black pixel
  24.                 mov     ah, 12          ; Video BIOS Write Pixel
  25.                 int     10h             ; Call Video BIOS routine
  26.  
  27.                 ; Get cursor's new position
  28.                 pop     dx
  29.                 pop     cx
  30.                 mov     cs:[oldx],cx
  31.                 mov     cs:[oldy],dx
  32.                 ; Show cursor at new position
  33.                 mov     bh, 0           ; Video Page 0
  34.                 mov     al, 1           ; White pixel
  35.                 mov     ah, 12          ; Video BIOS Write Pixel
  36.                 int     10h             ; Call Video BIOS routine
  37.  
  38.                 ret
  39. oldx            DW      320             ; New vertical cursor position
  40. oldy            DW      100             ; Old vertical cursor position
  41. ;**************************************************************************
  42. _MSFCN12        endp
  43. ;
  44. func12          ends
  45.                 end
  46.