为什么键盘中断只能被响应一次,当我在按键盘的时候不能,在显示字符'A'了
已经设置了OCW2的普通EOI结束,为什么下一个键盘中断还不能响应?
DATA SEGMENT
NUM DB 48
OLD DW 0
DW 0
DATA ENDS
STACK SEGMENT
BUF DB 400H DUP(0)
STACK ENDS
CODE SEGMENT
ASSUME CS:CODE,SS:STACK,DS:DATA
START:
MOV AX , STACK
MOV SS , AX
MOV SP , OFFSET BUF
ADD SP , 400H
MOV AX , OFFSET CLOCKHANDLER ;向中断向量表写入键盘中断源程序地址
MOV DX , AX
MOV AX , CS
MOV DS , AX
MOV AL , 09H
MOV AH , 25H
INT 21H
CLI
MOV AL , 13H
OUT 20H , AL ;ICW1
MOV AL , 08H
OUT 21H , AL ;ICW2
MOV AL , 0DH
OUT 21H , AL ;ICW4
IN 21H , AL
AND AL , 0FDH ;设置键盘中断开
OUT 21H , AL ;OCW1
sti
.LOOP:
NOP
JMP .LOOP
MOV AH , 4CH
INT 21H
CLOCKHANDLER:
PUSH AX
PUSH ES
PUSH CX
STI
MOV AX , 0b800h
MOV ES , AX
MOV [ES:0030H] , 97 ;显示字符A
MOV [ES:0031H] , 37H
MOV CX , 0ffffH ;延迟
.S1:
MOV AX , 8000H
.S2:
DEC AX
JNZ .S2
DEC CX
JNZ .S1
MOV AX , 0B800H ;清除字符
MOV ES , AX
MOV [ES:0030H] , 0