Functions 06h and 07h move the contents of a window, a rectangle of the screen given by its top-left corner in CX and its bottom-right corner in DX, by AL lines. 06h moves them up: the top AL lines disappear and AL blank lines appear at the bottom. 07h moves them down, and the blank lines appear at the top. The blanks are spaces in attribute BH. With AL = 0, or AL at least the height of the window, every line becomes blank: the window is cleared.

This is how the BIOS itself scrolls the screen when teletype output passes the bottom line, and how programs scroll part of the screen, a message area or a list, while the rest stays put. Both work on the active page. In graphics modes they work as well, filling with BH as a colour, but slowly on old cards.

Clearing the screen

MOV AX, 0600h ; scroll up, AL = 0: clear
MOV BH, 07h ; light grey on black
MOV CX, 0000h ; from row 0, column 0
MOV DX, 184Fh ; to row 24 (18h), column 79 (4Fh)
INT 10h
MOV AH, 02h ; and the cursor home
MOV BH, 0
MOV DX, 0000h
INT 10h

That is all a CLS needs. Setting the mode again also clears, but is slower and resets everything else; with another BH the same call paints the whole screen, BH = 1Fh for white on blue. The example paints a window near the top right, then scrolls it both ways, so each new line shows the attribute of the call that made it:

Prints "Window painted and scrolled"; on the screen, near the top right (rows 1–5, columns 50–77, until the screen scrolls): a red line, three blue lines and a green line.
MOV AX, 0600h ; AL = 0: clear the window
MOV BH, 1Fh ; white on blue
MOV CX, 0132h ; top left: row 1, column 50
MOV DX, 054Dh ; bottom right: row 5, column 77
INT 10h
MOV AX, 0602h ; scroll up 2 lines
MOV BH, 2Fh ; the two new bottom lines: green
MOV CX, 0132h
MOV DX, 054Dh
INT 10h
MOV AX, 0701h ; AH = 07h: scroll down 1 line
MOV BH, 4Fh ; the new top line: red
MOV CX, 0132h
MOV DX, 054Dh
INT 10h
MOV AH, 09h
MOV DX, OFFSET MSG1
INT 21h
MSG1 DB "Window painted and scrolled", 13, 10, "$"

Pitfalls

The corners are not checked: a corner off the screen, or a top-left below or right of the bottom-right, gives odd results that differ between BIOSes. The scroll code of some early BIOSes destroys BP, so keep nothing there across the call. On a real CGA the BIOS blanks the display while it moves the text in 80-column modes, to avoid "snow", so scrolling flickers. Only the active page scrolls; for other pages, or for speed, move the memory yourself with REP MOVSW.