flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
StringCheesian 28 Feb 2004, 04:45
I made my keyboard int handler put an 'A' on the screen whenever a key is pressed, but I'm not seeing an A... and I'm stumped. This is my first protected mode interrupt handler, so I could doing something wrong.
The whole file is less than 2 kb, but I didn't know if it would be annoying to post that much text, so I attached it. Here's the keyboard int handler: Code: keyboardIntHandler: push eax push ebx push ds mov eax, dataSel mov ds, eax ; A grey-on-blue 'A' should appear at (1,0) on the ; screen as soon as a key is pressed: mov al, 'A' mov ah, 0x17 mov [0xB8002], ax ; Update the key state map: xor eax, eax mov bl, 1 in al, 60h test al, 80h jz byte @F and al, 7Fh dec bl @@: mov [keyStateMap+eax], bl pop ds pop ebx pop eax iretd
|
|||||||||||
![]() |
|
StringCheesian 28 Feb 2004, 06:26
Thanks, that probably would have causes a lot of problems later.
But it's still acting like the interrupt is never being called... EDIT: INT 9 gets called whenever a key is pressed, just like in real mode, right? Or do I have to poll for input? |
|||
![]() |
|
0x4e71 28 Feb 2004, 11:56
Well, did you enable IRQ1 and did you enable interrupts? otherwise, when initializing, add something like :
Code: mov ax,$FFFd ; enable irq 1 only out $21,al mov al,ah out $A1,al sti Also, at the bottom of your handler you have to tell the PIC you are done with IRQ1, so: Code: mov al,$20 out $20,al Cheers, -Luigi |
|||
![]() |
|
StringCheesian 29 Feb 2004, 05:01
Yey, it works! Now I wish I understood why it works: what's an IRQ?
|
|||
![]() |
|
0x4e71 29 Feb 2004, 11:37
sure.
read http://www.osdever.net/tutorials/irqs.php?the_id=37 and many other tutorials at osdever.net |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.