Calls to the MS Mouse Driver (INT 33H)

Function 0 -- Reset
Input
AX = 0
Output
AX = mouse status -1 = installed
0 = not installed
BX = number of buttons

Function 1 -- Show Mouse Cursor
Input
AX = 1
Output
NONE

Function 2 -- Hide Mouse Cursor
Input
AX = 2
Output
NONE

Function 3 -- Get Mouse Position & Button Status
Input
AX = 3
Output
BX = Button Status
xxxx xxxx xxxx xMRL
M=middle (if present) R=right L=left
0= not pressed 1 = pressed
CX = Horizontal Mouse Cursor Position
DX = Vertical Mouse Cursor Position
(div positions by 2 for med res
graphics; div by 8 for text mode)

Function 4 -- Set Mouse Cursor Position
Input
AX = 4
CX = new horizontal cursor position
DX = new vertical cursor position
Output
NONE

Function 5 -- Get Button Press Information
Input
AX = 5
BX = button of interest (0=L; 1=R; 2=M)
Output
AX = button status (current status of ALL buttons)
BX = number of buutton presses on specified button
CX = horizontal position at last press
DX = vertical position at last press

Function 6 -- Get Button Release Information
Input
AX = 6
BX = button of interest (0=L; 1=R; 2=M)
Output
AX = button status (current status of ALL buttons)
BX = number of buutton presses on specified button
CX = horizontal position at last release
DX = vertical position at last release
Function 7 -- Set Minimum and Maximum X Position
Input
AX = 7
CX = new minimum horizontal cursor position
DX = new maximum horizontal cursor position
Output
NONE

Function 8 -- Set Minimum and Maximum Y Position
Input
AX = 8
CX = new minimum vertical cursor position
DX = new maximum vertical cursor position
Output
NONE

Function 9 -- Define Graphics Cursor
Input
AX = 9
BX = horizontal cursor hot spot (0,0) upper left
CX = vertical cursor hot spot
ES:DX = address of screen and cursor mask
Output
NONE

Notes: The graphics cursor as displayed on the screen is an array of pixels (16x16 or 8x8 depending on the screen mode). It is defined by two 16x16 arrays of bits called the SCREEN MASK and the CURSOR mask. (For medium resolution, two bits are taken at a time, corresponding to the four possible colors).
The screen masked is ANDed with the screen contents. The cursor mask is then XORed with the result. The operational behavior of these bit arrays are summarized by the following table:

screen mask cursor mask resulting screen bit
0 0 0
0 1 1
1 0 Unchanged
1 1 Inverted

Here is the definition for the DEFAULT graphics cursor:

mov ax, 9
mov bx, -1 ;default hot spot - past tip of arrow
mov cx, -1
mov dx, offset default ; assuming that ES points there
int 33h ; already (see next page)
  
Here is the default graphics cursor defined:

 

default:
;
;screen mask ---
;
db 0011111111111111b
db 0001111111111111b
db 0000111111111111b
db 0000011111111111b
db 0000001111111111b
db 0000000111111111b
db 0000000011111111b
db 0000000001111111b
db 0000000000111111b
db 0000000111111111b
db 0001000011111111b
db 0011000011111111b
db 1111100001111111b
db 1111100001111111b
db 1111110000111111b
;
;cursor mask ---
;
db 0000000000000000b
db 0100000000000000b
db 0110000000000000b
db 0111000000000000b
db 0111100000000000b
db 0111110000000000b
db 0111111000000000b
db 0111111100000000b
db 0111111110000000b
db 0111111111000000b
db 0111110000000000b
db 0100011000000000b
db 0000011000000000b
db 0000001100000000b
db 0000001100000000b
db 0000000000000000b