|
楼主 |
发表于 2013-10-13 21:22:17
|
显示全部楼层
assume cs:code,ss:stack
stack segment
db 256 dup (0)
stack ends
code segment
start: mov ax,1;0表示清屏,1表示设置前景色,2表示设置背景色,3表示向上滚动一行
mov bl,1;0~7表示8中不同颜色
call setscreen
mov ax,4c00h
int 21h
setscreen: jmp ssstart
table dw cls,sc,sbc,froll
tcolor db 00000000b,00000001b,00000010b,00000011b,
00000100b,00000101b,00000110b,00000111b //前景色
tbcolor db 00000000b,00010000b,00100000b,00110000b,
01000000b,01010000b,01100000b,01110000b//背景色
ssstart:
add ax,ax
;mov ah,0
第22行 call word ptr table[ax]
ret
cls:
push ax
mov ax,0b800h
mov ds,ax
mov bx,0
mov cx,2000
clsloop1: mov byte ptr [bx],' '
add bx,2
loop clsloop1
pop bx
pop cx
pop ds
pop ax
ret
sc:
push ax
mov ax,0b800h
mov ds,ax
pop ax
mov al,bl
mov ah,0
mov bx,1
mov cx,2000
第48行 scloop1: mov byte ptr [bx],byte ptr tcolor[ax]
add bx,2
loop scloop1
ret
sbc:
push ax
mov ax,0b800h
mov ds,ax
mov al,bl
mov bx,1
mov cx,2000
第60行 sbcloop1: mov byte ptr [bx],byte ptr tbcolor[al]
add bx,2
loop sbcloop1
ret
froll:
mov ax,0b800h
mov ax,ds
mov si,160
mov ax,0b800h
mov es,ax
mov di,0
mov cx,24*160
cld
rep movsb
ret
code ends
end start |
|