The text cursor is drawn by the card itself, as a blinking band of scan lines inside the character cell. Function 01h chooses the band: CH is its first line and CL its last, counted from 0 at the top of the cell. On a CGA a cell is 8 lines high and the usual underline is lines 6 to 7; monochrome and EGA cells are 14 lines high, VGA cells 16.

So that programs need not care, EGA and VGA BIOSes translate CGA-style values in the 25-line colour text modes, which IBM called cursor emulation: 0607h becomes the underline and 0007h a full block, whatever the real cell height. CGA values therefore work everywhere. Setting bit 5 of CH hides the cursor, which full-screen programs do while they draw.

CXCursor (CGA values)
0607hthe usual underline
0007ha full block
0407hthe lower half (insert mode in many editors)
2000hhidden

The BIOS keeps the shape at 40h:60h in its data area, and function 03h returns it in CX. A program that changes it should read it first and put it back before it exits; DOS does not, and a missing or odd cursor at the prompt is confusing.

Prints "Block cursor for 2 seconds: back, it was 0607h" (0607h is the shape mode 03h sets; another program may have left a different one). On the screen the cursor is a full block for those 2 seconds.
MOV AH, 03h ; read the cursor: CX = its shape
MOV BH, 0
INT 10h
MOV [SHAPE1], CX ; keep it
MOV AH, 01h ; set the shape
MOV CX, 0007h ; scan lines 0 to 7: a full block
INT 10h
MOV AH, 09h
MOV DX, OFFSET MSG1 ; the block blinks at the end of this text
INT 21h
MOV CX, 001Eh ; wait 2 s: CX:DX = 1E8480h microseconds
MOV DX, 8480h
MOV AH, 86h ; BIOS: wait
INT 15h
MOV AH, 01h ; the old shape back
MOV CX, [SHAPE1]
INT 10h
MOV AH, 09h
MOV DX, OFFSET MSG2
INT 21h
MOV AX, [SHAPE1]
CALL PHEX4 ; the shape we found
MOV AH, 09h
MOV DX, OFFSET MSG3
INT 21h
SHAPE1 DW 0
MSG1 DB "Block cursor for 2 seconds: $"
MSG2 DB "back, it was $"
MSG3 DB "h", 13, 10, "$"
PHEX4: ; print AX as four hex digits
PUSH AX
MOV AL, AH
CALL PHEX2 ; the high byte first
POP AX
PHEX2: ; print AL as two hex digits; changes AX, CX, DX
PUSH AX
MOV CL, 4
SHR AL, CL ; the high nibble first
CALL PDIG1
POP AX
AND AL, 0Fh ; then the low one, falling into PDIG1
PDIG1:
ADD AL, "0"
CMP AL, "9"
JBE PDIG2
ADD AL, 7 ; "A".."F"
PDIG2:
MOV DL, AL
MOV AH, 02h ; DOS: print DL
INT 21h
RET

Pitfalls

There is a cursor only in text modes; in graphics modes the BIOS draws none and this function has no visible effect. On the original CGA, values above 7 or a first line below the last give a split or missing cursor; the VGA's emulation maps odd values in its own way, so keep to 0–7 in CGA terms. Emulation can be switched off with INT 10h AH=12h (BL = 34h), and then the values are real scan lines of the 16-line cell. A mode set restores the standard underline.