The problem is that int 0x10
function 0x07
takes more parameters than you've given. Specifically,
- AH = 07 = scroll window down
- AL = number of lines to scroll (or 0 for all)
- BH = attribute to write to blank lines
- CH, CL = row, column of window upper left corner
- DH, DL = row, column of window lower right corner
Unless you set them, they'll just contain whatever happens to be there from previous instructions, which is very unlikely to be what you want!
So assuming that you're using the standard 80x25 character screen, your code should instead be written like this:
clearScreen:
pusha
mov ax, 0x0700 ; function 07, AL=0 means scroll whole window
mov bh, 0x07 ; character attribute = white on black
mov cx, 0x0000 ; row = 0, col = 0
mov dx, 0x184f ; row = 24 (0x18), col = 79 (0x4f)
int 0x10 ; call BIOS video interrupt
popa
ret
See this version of the famous Ralf Brown interrupt list for more details.