INT 33h AX=0000h is the first mouse call a program makes. It answers whether a mouse is installed (AX = FFFFh yes, AX = 0000h no) and how many buttons it has (BX), and it puts the driver into a known state:

After a resetValue
pointerhidden (counter −1), in the middle of the screen
rangethe whole virtual screen of the current video mode
event handlerremoved (mask 0)
mickey ratio8 per 8 pixels across, 16 per 8 down
button countszero
pointer shapethe default arrow or text block
prints: FFFF 0003 320 96 (in text mode the middle of 640×200 is 320,100; the driver reports whole cells, so y shows as 96)
MOV AX, 0000h ; mouse: reset and detect
INT 33h ; AX = FFFFh: yes, BX = buttons
CALL PHEX4 ; FFFF
MOV DL, " "
MOV AH, 02h ; DOS: print the character in DL
INT 21h
MOV AX, BX
CALL PHEX4 ; 0003 here
MOV DL, " "
MOV AH, 02h ; DOS: print the character in DL
INT 21h
MOV AX, 0003h ; where did the reset put the pointer?
INT 33h ; CX = x, DX = y
MOV BX, DX ; keep y: printing uses DL
MOV AX, CX
CALL PDEC ; 320: half of 640
MOV DL, " "
MOV AH, 02h ; DOS: print the character in DL
INT 21h
MOV AX, BX
CALL PDEC ; 96: 100 rounded down to a text row
PHEX4 PROC NEAR ; print AX as four hex digits; keeps every register
PUSH AX
MOV AL, AH
CALL PHEX2 ; the high byte first
POP AX
CALL PHEX2 ; then the low byte
RET
PHEX4 ENDP
PHEX2 PROC NEAR ; print AL as two hex digits; keeps every register
PUSH AX
PUSH CX
PUSH DX
MOV DH, AL ; keep the byte
MOV CL, 4
SHR AL, CL ; the high nibble
CALL HEXN1
MOV AL, DH
AND AL, 0Fh ; the low nibble
CALL HEXN1
POP DX
POP CX
POP AX
RET
HEXN1:
ADD AL, "0"
CMP AL, "9"
JBE HEXN2
ADD AL, 7 ; past "9": "A".."F"
HEXN2:
MOV DL, AL
MOV AH, 02h
INT 21h
RET
PHEX2 ENDP
PDEC PROC NEAR ; print AX in decimal; keeps every register
PUSH AX
PUSH BX
PUSH CX
PUSH DX
MOV BX, 10
XOR CX, CX ; digits on the stack
DECD1:
XOR DX, DX
DIV BX ; AX = AX / 10, DX = the last digit
PUSH DX
INC CX
TEST AX, AX
JNZ DECD1
DECD2:
POP DX ; the digits come back first to last
ADD DL, "0"
MOV AH, 02h
INT 21h
LOOP DECD2
POP DX
POP CX
POP BX
POP AX
RET
PDEC ENDP

The button count

BX = 2 is a two-button mouse, 3 a three-button one (Mouse Systems, Logitech), and some drivers return FFFFh for two buttons. DOSBox-X reports 3. Do not rely on the middle button existing just because BX = 3.

Pitfalls

The reset can be slow on real hardware, up to a second or two with a serial mouse, because the driver resets the mouse too. INT 33h AX=0021h is the software-only reset (the same defaults, no hardware) and returns AX = FFFFh if a driver is there; use it when a program resets often. Call the reset after setting the video mode: the default range follows the mode current at the time. And check the vector before the first call (see INT 33h), because with no driver at all this call may go nowhere good.