Presentation is loading. Please wait.

Presentation is loading. Please wait.

SET 19 PROGRAMMING THE MOUSE. Mouse Features All mouse operations within a program are performed by standard INT 33H functions of the form: MOV AX, function.

Similar presentations


Presentation on theme: "SET 19 PROGRAMMING THE MOUSE. Mouse Features All mouse operations within a program are performed by standard INT 33H functions of the form: MOV AX, function."— Presentation transcript:

1 SET 19 PROGRAMMING THE MOUSE

2 Mouse Features All mouse operations within a program are performed by standard INT 33H functions of the form: MOV AX, function ; request mouse function... ; set arguments, if any INT 33h ; call mouse driver Note that INT 33h functions are loaded in the full AX register (not just AH).

3 00h: Initialize the mouse The First mouse function used in a program to initialize the mouse. Input: AX = 0

4 00h: Initialize the mouse (Cont.) Operations performed by mouse initialization: Sets mouse pointer to center screen Conceals mouse pointer, if visible Sets mouse pointer according to screen mode (text or graphics)

5 01h: Display Mouse Pointer Input: AX = 01h Output: none This function causes the mouse pointer to be displayed. The mouse driver uses a counter to determine whether or not to display the mouse.

6 01h: display the mouse (Cont.) If counter >= 0 display the mouse Otherwise, do not display the mouse When the mouse is initialized, the counter is set to -1. Function 01h increments the counter (making it zero) to display the mouse.

7 02h: Conceal Mouse Pointer Used to conceal the mouse pointer. Decrements the counter (making it - 1). Input: AX = 02h Output: none Do not use fn. 1 to display the mouse when it is already displayed or fn. 2 to conceal the mouse when it already concealed. Otherwise if, for instance, you employ fn. 2 three times to conceal the mouse, then you will have to use fn. 1 three times to display it Ued to conceal the mouse pointer. Decrements the counter (making it -1). Input: AX = 02h Output: noneUed to conceal the mouse pointer. Decrements the counter (making it -1). Input: AX = 02h Output: none

8 03h: Get Button Status and Pointer Location Gets current button status and pointer location. Input: AX = 03h Output: BX = Button status bit 0 = left button (0 = up, 1 = down) bit 1 = right button (0 = up, 1 = down) CX = horizontal position * 2 (x coordinate*2) DX = vertical position (y coordinate) Note: For some reason CX supplies twice times the X coord.

9 04h: Set Pointer Location Use this operation to set the horizontal and vertical coordinates for the mouse pointer on the screen (the values for the location are in terms of pixels). Input: AX = 04h CX = horizontal location*2 (Note again, double the X coord) DX = vertical location

10 Textbook Reading (Jones): None


Download ppt "SET 19 PROGRAMMING THE MOUSE. Mouse Features All mouse operations within a program are performed by standard INT 33H functions of the form: MOV AX, function."

Similar presentations


Ads by Google