assume cs:code
code segment
start:
mov ax,cs
mov ds,ax
mov ax,0
mov es,ax
mov si,offset int7
mov di,200h
mov cx,offset int7chend-offset int7
cld
rep movsb
cli
mov word ptr es:[7ch*4],200H
mov word ptr es:[7ch*4+2],0
sti
mov ax,4c00h
int 21h
org 200h
int7:
jmp int71
table dw sub1,sub2,sub3,sub4
int71:
push bx
cmp ah,3
ja int72
mov bl,ah
add bx,bx
call word ptr table[bx]
int72:
pop bx
iret
sub1:
push cx
push es
push bx
mov cx,2000
mov bx,0b800h
mov es,bx
mov bx,0
sub1s: mov byte ptr es:[bx],' '
add bx,2
loop sub1s
pop bx
pop es
pop cx
ret
sub2:
push cx
push bx
push es
mov cx,2000
mov bx,0b800h
mov es,bx
mov bx,1
sub2s: and byte ptr es:[bx],11111000b
or byte ptr es:[bx],al
add bx,2
loop sub2s
pop es
pop bx
pop cx
ret
sub3:
push cx
push bx
push es
mov cx,2000
mov bx,0b800h
mov es,bx
mov bx,1
sub3s: and byte ptr es:[bx],10001111b
shl al,1
shl al,1
shl al,1
shl al,1
or byte ptr es:[bx],al
add bx,2
loop sub3s
pop es
pop bx
pop cx
ret
sub4:
push cx
push bx
push es
push ds
push di
push si
mov bx,0b800h
mov es,bx
mov ds,bx
mov si,160
mov di,0
mov cx,24
cld
sub4s: push cx
mov cx,160
rep movsb
pop cx
loop sub4s
mov cx,80
mov bx,0
sub4s1: mov byte ptr es:[bx],' ';
add bx,2
loop sub4s1
pop si
pop di
pop ds
pop es
pop bx
pop cx
ret
int7chend:
nop
code ends
end start