assume cs:code
code segment
start:
mov ax, 0
mov es, ax
mov ax, 200h
mov di, ax
push cs
pop ds
mov ax, offset int7c
mov si, ax
mov cx, offset int7c_end - offset int7c
cld
rep movsb
cli
mov ax, 0
mov ds, ax
mov bx, 07ch*4
mov word ptr ds:[bx], 200h
mov word ptr ds:[bx+2], 0
sti
mov ax, 4c00h
int 21h
int7c:
jmp short int7c_code
table dw sub1-int7c+200h, sub2-int7c+200h
int7c_code:
push ax
push bx
cmp ah, 1
ja int7c_ok
sub bx, bx
mov bl, ah
add bx, bx
push cs
pop ds
call word ptr [bx+200h+2]
int7c_ok:
pop bx
pop ax
iret
sub1:
push bx
push cx
push es
mov bx, 0b800h
mov es, bx
mov bx, 0
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
suberror:
ret
int7c_end:
nop
code ends
end start