After a reset the mouse pointer is hidden: the driver tracks the mouse, but draws nothing. INT 33h AX=0001h asks it to draw. Internally the driver keeps a counter, −1 after a reset; show adds 1 and never goes past 0, hide (INT 33h AX=0002h) subtracts 1, and the pointer is on screen exactly when the counter is 0.

Once shown, the pointer is the driver's business: it saves what is under it, draws it, and restores the screen as the mouse moves, from inside its interrupt handler. In text mode it inverts the colours of one character cell; in graphics modes it draws an arrow from a mask.

Driver version 7.02 and later can report the counter (INT 33h AX=002Ah, AL = counter as a signed byte), which makes the rule visible. The example prints it after each step:

prints: FF 00 00 FF (the pointer flashes on the DOS screen for a moment)
XOR AX, AX ; reset: the pointer starts hidden
INT 33h
CALL COUNTER1 ; FF: -1
MOV AX, 0001h ; show: -1 -> 0, the pointer appears
INT 33h
CALL COUNTER1 ; 00
MOV AX, 0001h ; show again: the counter stays at 0
INT 33h
CALL COUNTER1 ; 00
MOV AX, 0002h ; hide: back to -1
INT 33h
CALL COUNTER1 ; FF
COUNTER1 PROC NEAR ; print the cursor counter: 00 shown, FF, FE... hidden
MOV AX, 002Ah ; mouse (driver 7.02+): AL = the counter
INT 33h
CALL PHEX2
MOV DL, " "
MOV AH, 02h
INT 21h
RET
COUNTER1 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

Pitfalls

Because the counter stops at 0, an extra show is harmless, but an extra hide is not: one too many and the next show leaves the pointer invisible. Show the pointer after setting the video mode and resetting the driver, not before, since a mode change hides it. While the pointer is visible, anything a program writes to the screen may land under it and be overwritten when the driver restores the background; see INT 33h AX=0002h for the hide/draw/show pattern.