Presentation is loading. Please wait.

Presentation is loading. Please wait.

Mouse handling Suthida Chaichomchuen

Similar presentations


Presentation on theme: "Mouse handling Suthida Chaichomchuen"— Presentation transcript:

1 Mouse handling Suthida Chaichomchuen std@kmtnb.ac.th

2 Mouse Features Pixel Mouse pointer Mickey Mickey count Threshold speed Use INT 33H functions –AX = function values

3 Mouse Functions 00H : Initialize the mouse 01H : Display the mouse pointer 02H : Conceal the mouse pointer 03H : Get button status and pointer location 04H : Set pointer location 05H : Get button-press information 06H : Get button-release information 07H : Set horizontal limits for pointer 08H : Set vertical limits for pointer

4 Mouse Functions 09H : Set graphics pointer type 0AH : Set text pointer type 0BH : Read mouse-motion counters 0CH : Install interrupt handler for mouse events 0DH : Turn on light pen emulation 0EH : Turn off light pen emulation 0FH : Set mickey-to-pixel ratio 10H : Set pointer exclusion area 13H : Set double-speed threshold 14H : Swap mouse-event interrupt

5 Mouse Functions 15H : Get buffer size for mouse driver state 16H : Save mouse driver state 17H : Restore mouse driver state 18H : Install alternative handler for mouse events 19H : Get address of alternative handler 1AH : Set mouse sensitivity 1BH : Get mouse sensitivity 1CH : Set mouse interrupt rate 1DH : Select display page for pointer 1EH : Get display page for pointer

6 Mouse Functions 1FH : Disable mouse driver 20H : Enable mouse driver 21H : Reset mouse driver 22H : Set language for mouse driver messages 23H : Get language number 24H : Get mouse information

7 INT 33H Function 00H Initialize the mouse AX = 00H Values return of operation –AX = 0000H : no mouse support is available –AX = FFFFH : mouse support is available –BX = number of mouse buttons Example –MOVAX,00H –INT33H

8 INT 33H Function 01H Display the mouse pointer AX = 01H Example –MOVAX,01H –INT33H

9 INT 33H Function 02H Conceal the mouse pointer AX = 02H Example –MOVAX,02H –INT33H

10 INT 33H Function 03H Get button status and pointer location AX = 03H Values return –BX = status of buttons bit 0 : left button(0=up, 1=pressed down) bit 1 : right button(0=up, 1=pressed down) bit 2 : center button (0=up, 1=pressed down) bit 3-15 : reserved for internal use –CX = horizontal (x) coordinate –DX = vertical (y) coordinate

11 INT 33H Function 03H Example –MOVAX,03H –INT33H

12 INT 33H Function 04H Set pointer location AX = 04H CX = horizontal location DX = vertical location Example –MOVAX,04H –MOVCX,horiz-locn –MOVDX,vertl-locn –INT33H

13 Example : Basic mouse operations MOVAX,00H INT33H CMPAX,00H JEexit MOVAX,01H INT33H MOVAX,04H MOVCX,24 MOVDX,16 INT33H... MOVAX,02H INT33H

14 INT 33H Function 05H Get button-press information AX = 05H BX = button number –0 = left –1 = right –2 = center Example –MOVAX,05H –MOVBX,button-no –INT33H

15 INT 33H Function 05H Values return –AX = status of buttons bit 0 : left button(0=up, 1=pressed down) bit 1 : right button(0=up, 1=pressed down) bit 2 : center button (0=up, 1=pressed down) bit 3-15 : reserved for internal use BX = button-press counter CX = horizontal coordinate of last button press DX = vertical coordinate of last button press

16 INT 33H Function 06H Get button-release information AX = 06H BX = button number –0 = left –1 = right –2 = center Example –MOVAX,06H –MOVBX,button-no –INT33H

17 INT 33H Function 06H Values return –AX = status of buttons bit 0 : left button(0=up, 1=pressed down) bit 1 : right button(0=up, 1=pressed down) bit 2 : center button (0=up, 1=pressed down) bit 3-15 : reserved for internal use BX = button-release counter CX = horizontal coordinate of last button release DX = vertical coordinate of last button release

18 INT 33H Function 07H Set horizontal limits for pointer AX = 07H CX = minimum limit DX = maximum limit Example –MOVAX,07H –MOVCX,min-locn –MOVDX,max-locn –INT33H

19 INT 33H Function 08H Set vertical limits for pointer AX = 08H CX = minimum limit DX = maximum limit Example –MOVAX,08H –MOVCX,min-locn –MOVDX,max-locn –INT33H

20 INT 33H Function 0BH Read mouse-motion counters Range (-32768 to +32767) AX = 0BH Values return –CX = horizontal count (+ : travel to the right, - : left) –DX = vertical count (+ : travel downwards, - : upwards) Example –MOVAX,0BH –INT33H

21 INT 33H Function 0CH Install interrupt handler for mouse events AX = 0CH CX = address of event mask DX = address of handler (ES:DX) Example –MOVAX,0CH –LEACX,mask –LEADX,handler –INT33H

22 INT 33H Function 0CH Bits for define the event mask –0 = mouse pointer moved –1 = left button pressed –2 = left button released –3 = right button pressed –4 = right button released –5 = center button pressed –6 = center button released –7-15 = reserved, define as 0

23 INT 33H Function 0CH Define the interrupt handler as a FAR procedure –AX = event mask –BX = button state –CX = horizontal coordinate –DX = vertical coordinate –SI = last vertical mickey count –DI = last horizontal mickey count –DS = data segment for the mouse driver

24 INT 33H Function 10H Set pointer exclusion area AX = 10H CX = upper left x coordinate DX = upper left y coordinate SI = lower right x coordinate DI = lower right y coordinate

25 INT 33H Function 10H Example –MOVAX,10H –MOVCX,upleft-x –MOVDX,upleft-y –MOVSI,lowrgt-x –MOVDI,lowrgt-y –INT33H

26 INT 33H Function 13H Set double-speed threshold Default speed = 64 mickeys per second AX = 13H DX = value of threshold speed Example –MOVAX,13H –MOVDX,threshold –INT33H

27 INT 33H Function 1AH Set mouse sensitivity AX = 1AH BX = horizontal mickeys (default = 8) CX = vertical mickeys (default = 16) DX = threshold speed (default = 64) Example –MOVAX,1AH –MOVBX,horzon –MOVCX,vertic –MOVDX,threshold –INT33H

28 INT 33H Function 1BH Get mouse sensitivity AX = 1BH Return values to registers as function 1AH Example –MOVAX,1BH –INT33H

29 INT 33H Function 1DH Select display page for pointer AX = 1DH BX = page number Example –MOVAX,1DH –MOVBX,00 –INT33H

30 INT 33H Function 1EH Get display page for pointer AX = 1EH Return value of page number in the BX Example –MOVAX,1EH –INT33H

31 INT 33H Function 24H Get mouse information AX = 24H Return information about version and type Values return –BH = major version number –BL = minor version number –CH = mouse type 1 = bus mouse 2 = serial mouse 3 = InPort mouse 4 = PS/2 mouse 5 = HP mouse

32 INT 33H Function 24H Example –MOVAX,24H –INT33H


Download ppt "Mouse handling Suthida Chaichomchuen"

Similar presentations


Ads by Google