汇编安装中断的程序:
push ds
push es
push bx
push dx
push cs
pop ds
mov si, offset myint ;int源程序在代码段
mov ax,0
mov es,ax
mov di,200h ;安装int的地址为200h
mov cx,offset myintend - offset myint
cld ;设置传输方向为正
rep movsb ;安装int
mov bx,word ptr es:[7ch*4] ;获得原先中断向量表
mov dx,word ptr es:[7ch*4+2] ;获得原先中断向量表段地址
mov word ptr es:[7ch*4],200h ;设置中断向量表
mov word ptr es:[7ch*4+2],0 ;设置中断向量表段地址(es)
jmp continue ;跳过自己编写的中断程序
myint:
;在这里输入自己编写的中断程序
iret
myintend:
nop
continue:
pop dx
pop bx
pop es
pop ds
mov ax,4c00h;退出程序
int 21h