assume cs:codesg
codesg segment
start:
;安装中断处理程序内容
mov ax,0
mov es,ax
mov di,200h
mov ax,cs
mov ds,ax
mov si,offset show
mov cx,offset show_end- offset show
cld
rep movsb
;设置中断向量表
mov ax,0
mov es,ax
mov es:[01F0h],0200h
mov word ptr es:[01F4h],0
mov ax,4c00h
int 21h
;中断处理程序
show:
mov al,160
mul dh
add dl,dl
mov dh,0
add ax,dx
mov di,ax
mov ax,0B800h
mov es,ax
copy: mov al,ds:[si]
cmp al,0
je show_back
mov es:[di],al
inc si
inc di
mov es:[di],cl
inc di
jmp short copy
show_back: iret
show_end: nop
codesg ends
end start