Function 03h returns the cursor of page BH as the BIOS data area has it: the row in DH, the column in DL, and in CX the cursor shape set by function 01h, which all pages share. Nothing on the screen changes.
Its everyday job is to remember the position before moving the cursor and to put it back afterwards, or to find out where DOS output has got to, since DOS moves the same cursor:
MOV AH, 09hMOV DX, OFFSET MSG1 ; "abc" without CR LF: the cursor stays on the lineINT 21hMOV AH, 03h ; read the cursor of page 0MOV BH, 0INT 10h ; DH = row, DL = column, CX = shapeMOV [COL1], DLMOV AH, 09hMOV DX, OFFSET MSG2INT 21hMOV DL, [COL1]ADD DL, "0" ; one digit is enough hereMOV AH, 02hINT 21hMOV AH, 09hMOV DX, OFFSET CRLF1INT 21hCOL1 DB 0MSG1 DB "abc$"MSG2 DB ": the cursor is in column $"CRLF1 DB 13, 10, "$"
Saving and restoring the position around output somewhere else:
MOV AH, 03hMOV BH, 0INT 10hPUSH DX ; the position; ... move the cursor, write a status line ...POP DXMOV AH, 02h ; back where it wasMOV BH, 0INT 10h
Pitfalls
CX is overwritten even when only the position was wanted, a classic trap when CX holds a loop count. The values come from the data area, so a program that moved the hardware cursor by programming the CRT controller directly is not seen here. In graphics modes the position is still returned; the shape means nothing there.