;**********************************************
;编写并安装int 7ch中断例程,功能为显示一个用0
;结束的字符串,中断例程安装在0:200处
;**********************************************
assume cs:code
code segment
start:
mov ax,cs
mov ds,ax
mov si,offset display
mov ax,0
mov es,ax
mov di,200h
mov cx,offset displayend-offset display
cld
rep movsb
mov ax,0
mov es,ax
mov word ptr es:[7ch*4],200h
mov word ptr es:[7ch*4+2],0
mov ax,4c00h
int 21h
display:
push cx
push ax
push bx
push dx
push bp
push es
push di
mov ax,0b800h
mov es,ax
mov ah,0
mov al,dh
mov bl,160
mul bl
mov bp,ax
mov dh,0
add dl,dl
mov di,dx
mov al,cl
s:
mov cl,ds:[si]
mov ch,0
jcxz next
mov es:[bp+di],cl
mov es:[bp+di+1],al
inc si
add di,2
jmp short s
next:
pop di
pop es
pop bp
pop dx
pop bx
pop ax
pop cx
iret
displayend:nop
code ends
end start