0% found this document useful (0 votes)
118 views2 pages

Mouse: Int 33H: Author: Internetnightmare

This 3 sentence summary provides the essential information about the document: The document discusses using the mouse in DOS applications by calling interrupt 33h to get the mouse position and buttons, setting the mouse resolution to 320x200, and providing a simple example that draws a red pixel at the current mouse coordinates on the screen. The full source code for the mouse tutorial is available for download.

Uploaded by

salamsalar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
118 views2 pages

Mouse: Int 33H: Author: Internetnightmare

This 3 sentence summary provides the essential information about the document: The document discusses using the mouse in DOS applications by calling interrupt 33h to get the mouse position and buttons, setting the mouse resolution to 320x200, and providing a simple example that draws a red pixel at the current mouse coordinates on the screen. The full source code for the mouse tutorial is available for download.

Uploaded by

salamsalar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Mouse: Int 33h

Author: InternetNightmare

In this tutorial I'll cover mouse usage in DOS applications. If you want to test the program in real DOS mode (without windows running) you'll need CuteMouse drivers that can be downloaded here. mov ax,0 int 33h ; mouse interrupt ; (ifi AX=FFFFh mouse is installed, if 0000 not, DX - number of mouse buttons) cmp ax,0 ja pmouse ; if AX > 0 lets start! mov ah,4ch int 21h ;else just exit pmouse: mov ax,03 ; function to get mouse position and buttons int 33h mov ax,dx ; Y coord to AX mov dx,320 mul dx ; multiply AX by 320 add ax,cx ; add X coord ; (Now currsor position is in AX, lets draw the pixel there) mov di,ax mov ax,0A000h mov es,ax mov dl,12 ; red color ;) mov es:[di],dl ; and we have the pixel drawn By default mouse resolution is 640x200, lets set it to 320x200 (monitor height is already set, lets just set the width) mov ax, 7 mov cx,0 ; min pos mov dx,320 ; max pos int 33h

And height can be set: mov ax, 8 mov cx,0 mov dx,200 int 33h The source for this tutorial can be found here.

You might also like