assume cs:codesg
codesg segment
; 编写安装程序
start:mov ax,cs
mov ds,ax
mov si,offset int7c
mov ax,0
mov es,ax
mov di,200H
mov cx,offset int7cend- offset int7c
cld
rep movsb; int7c
; 将int7cH中断例程进行绑定
cli
mov word ptr es:[7CH*4],200H
mov word ptr es:[7CH*4+2],0H
sti
mov ax,4c00h
int21h
ORG 200H
; 编写中断程序
int7c:jmp short set
table dw sub1,sub2,sub3,sub4 ;定义地址表
set:push bx
push si
mov bl,ah
mov bh,0
add bl,bl
sub bl,2
call word ptr table[bx]
pop si
pop bx
iret
sub1:push bx
push cx
push es
mov bx,0B800H
mov es,bx
mov bx,0
mov cx,2000
s1: mov byte ptr es:[bx],' '
add bx,2
loop s1
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
s2: and byte ptr es:[bx],11111000B
or es:[bx],al
add bx,2
loop s2
pop es
pop cx
pop bx
ret
sub3:push bx
push cx
push es
mov cl,4
shl al,cl
mov bx,0B800H
mov es,bx
mov bx,1
mov cx,2000
s3: and byte ptr es:[bx],10001111B
or es:[bx],al
add bx,2
loop s3
pop es
pop cx
pop bx
ret
sub4:push ds
push es
push si
push di
push cx
mov si,0B800H
mov es,si
mov ds,si
mov si,160
mov di,0
cld
mov cx,24
ov: push cx
mov cx,160
rep movsb
pop cx
loop ov
mov cx,80
mov si,0
ll: mov byte ptr es:[160*24+si],' '
add si,2
loop ll
pop cx
pop di
pop si
pop es
pop ds
ret
int7cend:nop
codesg ends
end start