China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-01 06:57
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » Detailed INT33 Documentation View 1,972 Replies 5
Original Poster Posted 2006-11-18 00:25 ·  中国 河北 石家庄 电信
初级用户
Credits 98
Posts 34
Joined 2006-11-03 02:31
19-year member
UID 69366
Gender Male
Status Offline
Hope this will be helpful to friends using a mouse or touchscreen under DOS

INT33 description
(1), Function 00H

Function description: Initialize the mouse; this operation only needs to be executed once
Input parameters: AX=00H
Output parameters: AX=0000H——mouse functions not supported, FFFFH——mouse functions supported
BX=number of mouse buttons (when mouse functions are supported)
When mouse functions are supported, the mouse is also set to the following parameters:
1. The mouse pointer is placed in the center of the screen
2. If the current mouse pointer is displayed, then after the operation, the mouse pointer is hidden
3. The display page of the mouse pointer is 0
4. The mouse pointer is displayed according to the screen display mode: text—reverse-video rectangular block, graphics—arrow shape
5. Horizontal pixel ratio=8:8, vertical pixel ratio=16:8
6. Set the horizontal and vertical display boundaries to the maximum boundaries of the current display mode
7. Light pen emulation enabled
8. Double-speed threshold value=64

(2), Function 01H

Function description: Display the mouse pointer; usually after mouse initialization, use this function to display the pointer
Input parameters: AX=01H
Output parameters: none

(3), Function 02H

Function description: Hide the mouse pointer; generally call this function when the program ends
Input parameters: AX=02H
Output parameters: none

(4), Function 03H

Function description: Read the mouse position and button status
Input parameters: AX=03H
Output parameters: BX=button status: bit 0=1——left button pressed
bit 1=1——right button pressed
bit 2=1——middle button pressed
other bits——reserved, for internal use
CX=horizontal position
DX=vertical position

(5), Function 04H

Function description: Set the mouse pointer position
Input parameters: AX=04H,CX=horizontal position,DX=vertical position
Output parameters: none

(6), Function 05H

Function description: Read mouse button information
Input parameters: AX=05H,BX=specified button: 0—left button, 1—right button, 2—middle button
Output parameters: AX=button status, see the description of BX in function 3H
BX=number of button presses
CX=horizontal position (at the last button press)
DX=vertical position (at the last button press)

(7), Function 06H

Function description: Read mouse button release information
Input parameters: AX=06H,BX=specified button: 0—left button, 1—right button, 2—middle button
Output parameters: AX=button status, see the description of BX in function 3H
BX=number of releases
CX=horizontal position (at the last release)
DX=vertical position (at the last release)

(8), Function 07H

Function description: Set the horizontal boundary of the mouse
Input parameters: AX=07H
CX=minimum horizontal position
DX=maximum horizontal position
Output parameters: none; the mouse may automatically move into the new area if the new area becomes smaller

(9), Function 08H

Function description: Set the vertical boundary of the mouse
Input parameters: AX=08H
CX=minimum vertical position
DX=maximum vertical position
Output parameters: none; the mouse may automatically move into the new area if the new area becomes smaller

(10), Function 09H

Function description: Set the graphics mouse shape
Input parameters: AX=09H
BX=horizontal position of the pointer
CX=vertical position of the pointer
ES:DX=bitmap address of the 16×16-bit cursor Parameters: (BX,CX) is the position of the mouse pointer within the 16×16 dot matrix, with (0,0) as the upper-left corner;
The memory pointed to by ES:DX stores the bitmap screen mask of the 16×16 dot matrix, immediately followed by the cursor mask of the 16×16 dot matrix.
Mouse pointer display method: the bitmap screen mask is logically ANDed with the contents of the screen display area, and then the cursor mask contents are XORed with the result of the previous operation.

Output parameters: none

(11), Function 0AH

Function description: Set the text mouse shape
Input parameters: AX=0AH
BX=cursor type: 0 — the meanings of the bits in CX and DX are as follows: bits 7~0 mouse pointer symbol
bits 10~8 character foreground color
bit 11 intensity
bits 14~12 character background color
bit 15 blinking

1 — CX=starting scan line of the cursor
DX=ending scan line of the cursor

Output parameters: none

(12), Function 0BH

Function description: Read mouse movement counts
Input parameters: AX=0BH
Output parameters: CX=horizontal movement distance: positive——moved right, negative——moved left
DX=vertical movement distance: positive——moved down, negative——moved up

(13), Function 0CH

Function description: Set a handler for mouse events
Input parameters: AX=0CH
CX=interrupt mask
bit 0=1 ——mouse pointer position changed
bit 1=1 ——left button pressed
bit 2=1 ——left button released
bit 3=1 ——right button pressed
bit 4=1 ——right button released
bit 5=1 ——middle button pressed
bit 6=1 ——middle button released
bits 7~15=0 ——reserved

ES:DX=address of the interrupt handler

When entering the interrupt handler, the meanings of the relevant register values are:
  AX=interrupt mask
  BX=button status
  CX=horizontal position of the mouse pointer
  DX=vertical position of the mouse pointer
  SI=change amount of horizontal position
  DI=change amount of vertical position

Output parameters: none

(14), Function 0DH

Function description: Enable light pen emulation
Input parameters: AX=0DH
Output parameters: none

(15), Function 0EH

Function description: Disable light pen emulation
Input parameters: AX=0EH
Output parameters: none

(16), Function 0FH

Function description: Set the ratio between mouse counts and pixels
Input parameters: AX=0FH
CX=horizontal ratio
DX=vertical ratio
Output parameters: none

(17), Function 10H

Function description: Set the hidden area for the mouse pointer
Input parameters: AX=10H
CX=X coordinate of upper-left corner
DX=Y coordinate of upper-left corner
SI=X coordinate of lower-right corner
DI=Y coordinate of lower-right corner
Output parameters: none

(18), Function 13H

Function description: Set the double-speed threshold; the default value is 64
Input parameters: AX=13H
DX=threshold value
Output parameters: none

(19), Function 14H

Function description: Replace the mouse event interrupt
Input parameters: AX=14H
CX=interrupt mask
ES:DX=address of the interrupt handler
Output parameters: CX=old interrupt mask
ES:DX=address of the old interrupt handler
(20), Function 15H

Function description: Read the buffer size for mouse driver state
Input parameters: AX=15H
Output parameters: BX=size of the buffer needed to store mouse driver state

(21), Function 16H

Function description: Store mouse driver state
Input parameters: AX=16H
ES:DX=address for storing mouse driver state
Output parameters: none

(22), Function 17H

Function description: Reload mouse driver state
Input parameters: AX=17H
ES:DX=address of mouse driver state
Output parameters: none

(23), Function 18H

Function description: Set an alternate handler for mouse events
Input parameters: AX=18H
CX=replacement interrupt mask
ES:DX=address of the replacement interrupt handler
CF=0
Output parameters: none

(24), Function 19H

Function description: Read the address of the replacement handler
Input parameters: AX=19H
CX=replacement interrupt mask
Output parameters: if AX=-1——failed; otherwise, ES:DX=address of the interrupt handler

(25), Function 1AH

Function description: Set mouse sensitivity; valid range 1~100
Input parameters: AX=1AH
BX=horizontal sensitivity (the amount the mouse must move for every 8 pixels, generally 8)
CX=vertical sensitivity (the amount the mouse must move for every 8 pixels, generally 16)
DX=double-speed threshold
Output parameters: none

(26), Function 1BH

Function description: Read mouse sensitivity
Input parameters: AX=1BH
Output parameters: BX=horizontal sensitivity
CX=vertical sensitivity
DX=double-speed threshold

(27), Function 1CH

Function description: Set mouse interrupt rate
Input parameters: AX=1CH
BX=number of interrupts per second: 0—interrupts off, 1—30/S, 2—50/S, 3—100/S, 4—200/S
Output parameters: none

(28), Function 1DH

Function description: Select the display page for the mouse pointer
Input parameters: AX=1DH
BX=display page
Output parameters: none

(29), Function 1EH

Function description: Read the display page of the mouse pointer
Input parameters: AX=1EH
Output parameters: BX=display page

(30), Function 1FH

Function description: Disable the mouse driver
Input parameters: AX=1FH
Output parameters: if AX=-1——failed; otherwise, ES:BX=address of the mouse driver

(31), Function 20H

Function description: Enable the mouse driver
Input parameters: AX=20H
Output parameters: none

(32), Function 21H

Function description: Reset the mouse driver
Input parameters: AX=21H
Output parameters: if AX=-1——failed; otherwise, BX=2

(33), Function 22H

Function description: Set the information language of the mouse driver
Input parameters: AX=22H
BX=language code: 0—English, 1—French, 2—Dutch, 3—German, 4—Swedish, 5—Finnish, 6—Spanish, 7—Portuguese, 8—

Italian
Output parameters: none

(34), Function 23H

Function description: Read the language
Input parameters: AX=23H
Output parameters: BX=language code

(35), Function 24H

Function description: Read mouse information
Input parameters: AX=24H
Output parameters: BH=major version number, BL=minor version number
CL=interrupt request number
CH=mouse type: 1-Bus Mouse, 2-Serial Mouse, 3-InPort Mouse, 4-PS/2 Mouse, 5-HP Mouse

(36), Function 25H

Function description: Read mouse driver information
Input parameters: AX=25H
Output parameters:
AX=mouse driver information:
bit 15 ——0: the driver is a .SYS file; otherwise, it is a .COM file
bit 14——0: incomplete mouse display driver; otherwise, complete
bits 13-12——00: software text cursor
01: hardware text cursor
1X: graphics cursor

(37), Function 26H

Function description: Read maximum valid coordinates
Input parameters: AX=26H
Output parameters: BX=mouse driver status
CX=maximum horizontal coordinate
DX=maximum vertical coordinate
Floor 2 Posted 2006-11-18 03:43 ·  中国 山东 济南 教育网
高级用户
★★
Credits 506
Posts 187
Joined 2005-12-04 22:41
20-year member
UID 46500
Gender Male
Status Offline
Yeah, I just read about this stuff not long ago. There was a very detailed explanation in that book by Qiu Bojun. Your explanation is also very good.
Floor 3 Posted 2006-12-19 13:21 ·  中国 陕西 西安 电信
新手上路
Credits 18
Posts 9
Joined 2006-12-18 14:06
19-year member
UID 73868
Gender Male
Status Offline
Very detailed. It would be even better if you could give some application examples
Floor 4 Posted 2007-02-22 08:49 ·  中国 山东 济宁 曲阜市 联通
中级用户
★★★
痴迷DOS者
Credits 456
Posts 570
Joined 2004-10-09 00:00
21-year member
UID 32281
Gender Male
Status Offline
DO
CALL GetMouseStatus(BTN,Y,X)
IF BTN=1 AND Y<=3 AND X<=2 AND Y>=2 AND X>=2 THEN btnOK_Click
K$=INKEY$
IF K$<>"" THEN Screen_KeyPress
LOOP
Write it in assembly.
DOS不是万能的,没有DOS是万万不能的
自古系统谁无死?留取胆清照汗青!uploadImages/20035317345478982.png
Floor 5 Posted 2007-02-22 09:34 ·  中国 山东 济宁 曲阜市 联通
中级用户
★★★
痴迷DOS者
Credits 456
Posts 570
Joined 2004-10-09 00:00
21-year member
UID 32281
Gender Male
Status Offline
DS:DX DSX
DS:DI DSI
ES:DX ESX
ES:DI ESI
ADD CS:[BX+SI],AL
ADD CS:[BX+SI],AL

When posting, it's best to use these options:
X Disable URL recognition
X Disable Smilies
X Disable Discuz! code
口 Use personal signature
口 Receive email notification of new replies
DOS不是万能的,没有DOS是万万不能的
自古系统谁无死?留取胆清照汗青!uploadImages/20035317345478982.png
Floor 6 Posted 2008-10-12 19:50 ·  中国 北京 东城区 联通
新手上路
Credits 18
Posts 9
Joined 2008-09-16 17:28
17-year member
UID 125788
Gender Male
Status Offline
Read it, very useful
Forum Jump: