인터럽트 9 (dos)와 같은 키보드 하드웨어 인터럽트에 대해 배우고 있습니다. 그리고 화살표 키 (왼쪽, 오른쪽, 위, 아래)를 누르면 두 개의 연속적인 인터럽트가 있음을 알았습니다. 첫 번째는 'Shift'버튼 인터럽트이고 두 번째는 내가 누른 화살표 키입니다.화살표 키를 누르면 두 개의 키보드 인터럽트가 발생합니까? (int 09h)
키보드의 번호 9 인터럽트를 다시 작성하고 구성하여 누를 수있는 버튼의 검색 코드를 묻는 메시지가 나타났습니다.
예를 들어, 오른쪽 화살표 키를 누르면, 'Shift'버튼 인터럽트가 발생했다는 것을 알게 될 것입니다. (화면 42에 scane code 42가 표시됩니다.) 그리고 내가 누른 화살표 키 오른쪽 화살표 키)도 인터럽트 (스캔 코드 77)를 보냅니다.
제 질문은 왜 이런 일입니까?
INT (9)에 대한 나의 코드 : I (예 : 오른쪽 화살표 키) 화살표 키를 누른 후
void interrupt interrupt_9_Implementation{
unsigned char scanCode;
asm{
in al, 60h // read the keyboard input from port 60h (96 Decimal) into al;
mov scanCode, al // save the keyboard input into 'scanCode' varaible
in al, 61h // read 8255 port 61h (97 Decimal) into al
or al, 128 // set the MSB - the keyboard acknowlege signal
out 61h, al // send the keyboard acknowlege signal from al
xor al, 128 // unset the MSB - the keyboard acknowlege signal
out 61h, al // send the keyboard acknowlege signal from al
}
if(128 > scanCode){ // if the button is being pressed or being released. if the button is being pressed then the MSb isn't set and therfore it must be smaller than 128
printf("You pressed key assigned scan code = %d\n", scanCode);
if(EscScanCode == scanCode)
EscPressed = _True;
else
printf("Press any key (almost)\n:");
}
// send EOI
asm{
mov al, 20h
out 20h, al
}
}
, 나는거야 :
Press any key (almost)
:You pressed key assigned scan code = 42 // the 'shift' key scan code
Press any key (almost)
:You pressed key assigned scan code = 77 // the right arrow button scan code
을 지금까지 그것은 단지 일어나고있다 화살표 키. 'Shift'가 눌러지지 않습니다. Logitech Wave 키보드를 사용하고 있습니다. http://www.win.tue.nl/~aeb/linux/kbd/scancodes-1.html에 따르면