set 19 n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
SET 19 PowerPoint Presentation
Download Presentation
SET 19

Loading in 2 Seconds...

  share
play fullscreen
1 / 10
symona

SET 19 - PowerPoint PPT Presentation

134 Views
Download Presentation
SET 19
An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
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 driverNote 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 = 01hOutput:   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. Ued to conceal the mouse pointer.  Decrements the counter (making it -1). Input:    AX = 02hOutput:   none 02h: Conceal Mouse Pointer • Used to conceal the mouse • pointer.  Decrements the counter (making it -1). • Input:    AX = 02hOutput:   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

  8. 03h: Get Button Status and Pointer Location • Gets current button status and pointer location. • Input:    AX = 03hOutput:   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