用汇编语言写一过程用来清屏

来源:百度知道 编辑:UC知道 时间:2024/05/25 13:05:02

用汇编语言写一过程用来清屏,过程中的数皆为十六进制。
push es/pushf ;将过程中破坏的寄存器压栈
push ax/push cx/push di
mov ax,b800/mov es,ax ;置显示缓冲段址
cld/xor di,di ;置显示缓冲偏移
mov cx,07ff
SSX:mov al,20/stosb ;写显示缓冲区字符
mov al,07/stosb ;置显示缓冲区字色
loop SSX
pop di/pop cx/pop ax ;恢复现场
popf//pop es
ret

只在3号显示模式下有效,老师恐怕能给个及格。