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:
XOR AX, AX ; reset: the pointer starts hiddenINT 33hCALL COUNTER1 ; FF: -1MOV AX, 0001h ; show: -1 -> 0, the pointer appearsINT 33hCALL COUNTER1 ; 00MOV AX, 0001h ; show again: the counter stays at 0INT 33hCALL COUNTER1 ; 00MOV AX, 0002h ; hide: back to -1INT 33hCALL COUNTER1 ; FFCOUNTER1 PROC NEAR ; print the cursor counter: 00 shown, FF, FE... hiddenMOV AX, 002Ah ; mouse (driver 7.02+): AL = the counterINT 33hCALL PHEX2MOV DL, " "MOV AH, 02hINT 21hRETCOUNTER1 ENDPPHEX2 PROC NEAR ; print AL as two hex digits; keeps every registerPUSH AXPUSH CXPUSH DXMOV DH, AL ; keep the byteMOV CL, 4SHR AL, CL ; the high nibbleCALL HEXN1MOV AL, DHAND AL, 0Fh ; the low nibbleCALL HEXN1POP DXPOP CXPOP AXRETHEXN1:ADD AL, "0"CMP AL, "9"JBE HEXN2ADD AL, 7 ; past "9": "A".."F"HEXN2:MOV DL, ALMOV AH, 02hINT 21hRETPHEX2 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.