Function 08h looks at the cell under the cursor of page BH and returns its character in AL and its attribute in AH. In a text mode that is a plain read of video memory. A graphics mode has no characters, only pixels, so the BIOS compares the dots at the cursor with its font and returns the character they match, or 0 if none does; AH means nothing there.

It serves for saving what a popup will cover, for reading what another program left on the screen, and for simple screen-reading tools. It reads one cell; for many, move the cursor each time or, much faster, read video memory at B800h directly. Here a Q printed by DOS is read back:

Prints "Q: read back Q, attribute 07h" (07h, light grey on black, is the usual colour at the DOS prompt; a screen painted in other colours gives another value).
MOV DL, "Q"
MOV AH, 02h ; DOS: print a Q
INT 21h
MOV AH, 03h ; the cursor is now just after it
MOV BH, 0
INT 10h ; DH = row, DL = column
DEC DL ; one column back: onto the Q
MOV AH, 02h
INT 10h
MOV AH, 08h ; read the character and attribute there
INT 10h ; AL = character, AH = attribute
MOV [CELL1], AX
INC DL ; DX still holds the position: after the Q again
MOV AH, 02h
INT 10h
MOV AH, 09h
MOV DX, OFFSET MSG1
INT 21h
MOV DL, BYTE PTR [CELL1] ; the character
MOV AH, 02h
INT 21h
MOV AH, 09h
MOV DX, OFFSET MSG2
INT 21h
MOV AL, BYTE PTR [CELL1+1] ; the attribute
CALL PHEX2
MOV AH, 09h
MOV DX, OFFSET MSG3
INT 21h
CELL1 DW 0
MSG1 DB ": read back $"
MSG2 DB ", attribute $"
MSG3 DB "h", 13, 10, "$"
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

The cursor does not move, so a loop over a line must step it with function 02h. In graphics modes the matching works only for characters drawn with the same font, in one colour, on a background of colour 0; text drawn over a picture, in another font or with XOR reads as 0. In text modes the result is exact.