Function 13h, which arrived with the PC/AT and the EGA, is teletype for a whole string with colours. It puts the cursor of page BH at row DH, column DL, writes CX characters from ES:BP, and acts on CR, LF, backspace and bell as function 0Eh does, scrolling at the bottom. The write mode in AL decides two things:

ALThe stringThe cursor afterwards
00hcharacters, all in attribute BLback where it was
01hcharacters, all in attribute BLafter the string
02hcharacter, attribute, character, attribute...back where it was
03hcharacter, attribute pairsafter the string

The string is addressed by ES:BP, not DS:DX or DS:SI as one might expect. In a .COM program ES already equals DS, so MOV BP, OFFSET TEXT1 is all it takes; an .EXE must set ES first. CX counts characters, so in modes 02h and 03h the string is 2 × CX bytes long, and no terminator is needed or recognised.

Prints "Two lines above from INT 10h AH=13h"; on the screen above it: "Yellow on blue" in yellow on blue, and a line "RGB" in light red, light green and light blue.
MOV AH, 03h ; start at the cursor: DH = row, DL = column
MOV BH, 0
INT 10h
MOV AX, 1301h ; write a string: one attribute, move the cursor
MOV BX, 001Eh ; page 0, yellow on blue
MOV CX, 16 ; 14 characters, then CR and LF
MOV BP, OFFSET TXT1 ; ES:BP = the string (ES = DS in a .COM)
INT 10h
MOV AH, 03h ; the cursor is now on the next line
MOV BH, 0
INT 10h
MOV AX, 1303h ; character, attribute pairs; move the cursor
MOV BX, 0000h ; page 0 (BL is not used)
MOV CX, 5 ; 5 characters: CX does not count the attributes
MOV BP, OFFSET TXT2
INT 10h
MOV AH, 09h
MOV DX, OFFSET MSG1
INT 21h
TXT1 DB "Yellow on blue", 13, 10
TXT2 DB "R", 0Ch, "G", 0Ah, "B", 09h, 13, 07h, 10, 07h
MSG1 DB "Two lines above from INT 10h AH=13h", 13, 10, "$"

Pitfalls

BP holds the string pointer, so code that keeps a stack frame in BP must save it around the call. The original PC and XT BIOS lack the function and return without doing anything. The cursor position comes from DH and DL, not from the current cursor, so to write "at the cursor" read it first with function 03h, as the example does. In modes 00h and 01h a CR or LF in the string moves the cursor without being drawn, and the attribute applies only to the characters drawn.