Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- PromptFormattedString( FormattedString, scanCode, asciiTable[ scanCode ] );
- if( EscScanCode == scanCode )
- EscPressed = _True;
- else
- PromptMessage( PromptString );
- }
- //send EOI
- asm{
- mov al, 20h
- out 20h, al
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement