实验12 编写0号中断的处理程序
编写0号中断的处理程序,使得在除法溢出发生时,在屏幕中间显示字符串“divide error!”,然后返回到DOS。
assume cs:code code segment start: mov ax,cs mov ds,ax mov si,offset do mov ax,0 mov es,ax mov di,200h mov cx,offset doend-offset do ;存放中断处理程序 cld rep movsb mov word ptr es:[0],200h mov word ptr es:[2],0 ;设置中断向量表 mov dx,0ffffh mov bx,1 ;测试一下 div bx mov ax,4c00h int 21h do:jmp short dostart db 'divide error!' dostart: mov ax,0 mov ds,ax mov si,202h mov ax,0b800h mov es,ax mov di,160*10+80 mov cx,13 s: mov al,ds:[si] mov ah,2 mov es:[di],ax inc si inc di inc di loop s mov ax,4c00h int 21h doend:nop code ends end start