|
20鱼币
assume cs:code
code segment
;-------安装程序--------
start:mov ax,cs
mov ds,ax
mov si,offset s
mov ax,0
mov es,ax
mov di,200h
mov cx,offset send-offset s ;设置cx长度
cld ;设置传输方向正向
rep movsb
cli ;屏蔽中断
mov word ptr es:[7ch*4],200h ;设置新int7ch地址
mov word ptr es:[7ch*4+2],0
sti
mov ax,4c00h
int 21h
s: jmp short set
table dw sub1-s+200h,sub2-s+200h,sub3-s+200h,sub4-s+200h
set: push bx
cmp ah,3
ja reps
mov bh,0
mov bl,ah
add bl,bl
call word ptr table[bx]
reps: pop bx
iret
;-----清屏功能----
sub1: push bx
push cx
push es
mov bx,0b800h
mov es,bx
xor bx,bx
mov cx,2000
sub1s: mov byte ptr es:[bx],' '
add bx,2
loop sub1s
pop es
pop cx
pop bx
ret
;------改变前景色功能-----
sub2: push bx
push cx
push es
mov bx,0b800h
mov es,bx;
mov bx,1
mov cx,2000
sub2s: and byte ptr es:[bx],11111000b
or byte ptr es:[bx],al
add bx,2
loop sub2s
pop es
pop cx
pop bx
ret
;-----改变背景色功能-------
sub3: push ax
push bx
push cx
push es
mov bx,0b800h
mov es,bx
mov bx,1
mov cl,4
shl al,cl
mov cx,2000
sub3s: and byte ptr es:[bx],10001111b
or byte ptr es:[bx],al
add bx,2
loop sub3s
pop es
pop cx
pop bx
pop ax
ret
;------向上滚动一行功能------
sub4: push cx
push ds
push es
push di
push si
mov si,0b800h
mov es,si
mov ds,si
mov si,160
mov di,0
cld
mov cx,24
sub4s: push cx
mov cx,160
rep movsb
pop cx
loop sub4s
;-------最后一行清空功能--------
mov cx,80
sub4s1:mov byte ptr es:[160*24+si],' '
add si,2
loop sub4s1
pop si
pop di
pop es
pop ds
pop cx
ret
send: nop
code ends
end start
|
-
编号subs1在代码137行,loop subs1在141行
|