mov ax,fcn ; fcn=mouse function number ... int 33hNote that this is unlike other int's which use only the ah (not ax) register for specifying function number. The first mouse instruction a program issues should be fcn=00h. This initializes the interface between the mouse driver and the program. This is usually done only once. Next it should issue fcn=01h, which cause the mouse pointer to appear.
RETURNS AX=0000h if no mouse support available,
AX=FFFFh otherwise.
RETURNS BX=number of mouse buttons available (if AX=FFFFh).
Other actions:
Function Number | Actions | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fcn=00h: initialize mouse | (described above) | ||||||||||||||
fcn=01h: display mouse pointer | no other input or outputs. | ||||||||||||||
fcn=02h: conceal mouse pointer | no other input or outputs. Usage: usually, we issue this at the end of a program | ||||||||||||||
fcn=03h: get button status and pointer location. | OUTPUTS: BX=status of buttons
CX=x-coordinate, DX=y-coordinate. The coordinates are in pixels, even if text mode. These values are always within the max and min limits of these coordinates. |
||||||||||||||
fcn=04h: set pointer location. | INPUTS: CX=x-coord, DX=y-coord. The coordinates are in pixels. | ||||||||||||||
fcn=05h: get button-press information |
INPUT: BX specifies button (0=left,1=right,2=center).
OUTPUT:
|
||||||||||||||
fcn=06h: get button-release information | analogous to fcn=04h. | ||||||||||||||
fcn=07h: set horizontal limits for pointer | INPUT: CX=min x-coord, DX=max x-coord. These coordinates are in pixels. The operation also moves the pointer to within the new limits, if necessary. | ||||||||||||||
fcn=08h: set vertical limits for pointer | Analogous to fcn=07h. | ||||||||||||||
fcn=09h: define graphics cursor |
INPUT:
OUTPUT: none. See additiona information below. |
||||||||||||||
fcn=0bh: read mouse motion counters | returns the horizontal and vertical mickey count since the last call to this function (the range of the counts are -32768 to +32,767). OUTPUT: CX=horizontal count, DX=vertical count. | ||||||||||||||
fcn=0ch: install interrupt handler for mouse events |
OUTPUT: none.
INPUT ES:DX= address of handler routine The procedure is a FAR procedure. On entry to the interrupt handler, push all registers and initialize the DS register to your data segment. Within the handler, use only BIOS, not DOS interrupts. On exit pop all registers. The mouse driver will initialize the following inputs for the procedure:
The correspondence between bits of the event mask and the events are as follows:
SEE ALSO: fcn=14h |
||||||||||||||
fcn=10h: set pointer exclusion area |
The pointer is not displayed outside a rectangular
region defined as follows:
INPUT CX:DX=(x,y) coordinates of the upper left corner. INPUT SI:DI=(x,y) coordinates of the lower right corner. This exclusion rectangle is reset by functions fcn=00h or 01h. | ||||||||||||||
fcn=13h: set double-speed threshhold | DX=new threshhold value (default 64 mickeys/second). See also fcn=1ah. | ||||||||||||||
fcn=14h: swap interrupt subroutines |
Analogous to fcn=0ch above.
INPUT ES:DX=far pointer to user interrupt routine. INPUT CX=new interrupt mask. OUTPUT ES:DXfar pointer to previous user interrupt routine. OUTPUT CX=previous interrupt mask. The interrupt routines receives arguments in AX,BX,CX,DX,DI,SI,DS as described under fcn=0ch. |
||||||||||||||
fcn=1ah: set mouse sensitivity. | INPUTS: BX=horizontal sensitivity, CX=vertical sensitivity, DX=threshhold. Sensitivity is measured in terms of number of mickeys per 8 pixels. Default for BX, CX is 8 and 16, respectively. See also fcn=0fh,13h,1bh. | ||||||||||||||
fcn=1bh: get mouse sensitivity. | OUTPUTS: BX, CX, DX. These are used just as in fcn=1ah above. | ||||||||||||||
fcn=1dh: set display page for mouse pointer. | INPUT: BX=video page number. Note that each page has its own mouse pointer (location). The page for video display is set with int 10h, fcn=05h. | ||||||||||||||
fcn=1eh: get display page for mouse pointer. | OUTPUT: BX=current video page number. | ||||||||||||||
fcn=24h: get installed mouse information. | OUTPUT BH:BL=major:minor version number. OUTPUT CH=mouse type, where 1=bus mouse, 2=serial mouse, 3=inport mouse, 4=ps/2 mouse, 5=hp mouse. |
The SCREEN MASK is AND'ed with the display screen. The CURSOR MASK is OR'ed with the result. Thus we have the following behaviour:
SCREEN MASK CURSOR MASK RESULTING SCREEN BIT 0 0 0 0 1 1 1 0 unchanged 1 1 invertedThe definition of the DEFAULT graphics cursor is given as follows:
mov ax, 9 mov bx, -1 ; default hot spot is past arrow tip mov cx, -1 mov dx, offset default ; we assume ES is properly set up already int 33h ; 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 db 1111111111111111b ; ; 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