接管ax/bl bl=0 即除数为0时的中断 运行乱码 请各位指点
*****************************************************************
data segment
M dw 12
N db 0
String db 'DIVIDED BY ZERO!&'
data ends
code segment
assume cs:code, ds:data
main proc far
start:
push ds
mov ax, 0
push ax
mov ax, data
mov ds, ax
mov al, 0
mov ah, 35h ;取原中断矢量
int 21h
push es ;保存原中断矢量
push bx
mov dx, offset diy ;取自定义中断矢量偏移地址
mov ax, seg diy ;................段地址
mov ds, ax
mov al, 0
mov ah, 25h
int 21h
mov ax, M
mov bl, N
div bl
pop bx ;取出原中断矢量
pop es
mov dx, bx
mov ax, es ;恢复原中断矢量
mov ds, ax
mov ah, 25h
int 21h
ret
main endp
diy proc near
push dx
push ax
mov dl, offset String
mov ah, 2
int 21h
pop ax
pop dx
iret
diy endp
code ends
end start