第一版,第十五章,270页和271页:
int9:
push ax
push bx
push es
;first step:read scan code
in al,60h
;second step:save flag register
pushf
;third step:make tf if to zero
pushf
pop bx
and bh,11111100b
push bx
popf
;fourth step:call the orignial int 9h to deal with the basic things
call dword ptr ds:[0]
;if the key is 'ESC'
cmp al,1
jne int9ret;if not,do nothing.
mov ax,0b800h
mov es,ax
inc byte ptr es:[160*12+40*2+1]
int9ret:
;****!it should be popf front of pop es!
pop es
pop bx
pop ax
iret
他压入了两次pushf,第一次是为了标记寄存器进栈,第二次是为了修改TF,IF,可是在退出的时候居然少了一次popf,那不乱套了么,本来应该是标志寄存器的值,却进了es |