求教下为什么会卡死哈,谢谢哈
;王爽实验15 安装新中断替代int 9h 程序只能运行在dosbox里,windows下改int9会被自动改回来的;其它按键可以正常,当按A后可以显示满屏A但无法退回到c:\>下直接在满屏A那里卡住不响应了
assume cs:code
code segment
main:
mov ax,0
mov es,ax
mov di,204h
mov ax,cs
mov ds,ax
mov si,newint9
mov cx,offset endint9- offset newint9
mov ax,es:[9*4] ;这4句 保存原int9 ip和cs到200h 202h处
mov es:[200h],ax
mov ax,es:[9*4+2]
mov es:[202h],ax
rep movsb ;复制新中断到204开始处
cli ;安装新中断到向量表
mov word ptr es:[9*4],204h
mov word ptr es:[9*4+2],0
sti
mov ax,4c00h
int 21h
newint9: ;新中断程序
push ax
push cx
push es
push di
in al,060h
cmp al,01eh+80h ;A键的断码?
jne oldint9 ;不是
mov cx,0B800h ;是的话,显示满屏A
mov es,cx
mov cx,2000
mov di,0
s1:
mov byte ptr es:[di],'A'
add di,2
loop s1
jmp exit
oldint9: ;调用原先int9h处理按键
pushf
call dword ptr cs:[200h]
exit:
pop di
pop es
pop cx
pop ax
iret
endint9:nop
code ends
end main