Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Interrupts structure

JulienJulien Member Posts: 13
I would like to write an interrupt to read scan codes on port 60h (through 25h function of the 21h interrupt) but I don't know well the interrupts structure.
I know that I must PUSH registers (flags managed by IRET?) and POP them before quitting with IRET.
Are there other conditions to be respected?

I saw also that I must OUT 20h to the interrupt controller at 0020h:
I don't understand why.

I may be presomptuous, but any help would be wellcome.

Comments

  • archimedesarchimedes Member Posts: 31
    : I would like to write an interrupt to read scan codes on port 60h (through 25h function of the 21h interrupt) but I don't know well the interrupts structure.
    : I know that I must PUSH registers (flags managed by IRET?) and POP them before quitting with IRET.
    : Are there other conditions to be respected?

    In an interrupt handler you should start by pushing any registers you are going to modify. At the end,
    pop them back. Then do an IRET. IRET takes care of the flags for you. IRET is functionally equivalent
    to POPF, RET.

    : I saw also that I must OUT 20h to the interrupt controller at 0020h:
    : I don't understand why.

    Port 20h is the programmable interrupt controller (PIC). 20h tells it you're done with the interrupt
    handler. Shorthand for this is you're sending an EOI (end of interrupt) to the PIC.

    : I may be presomptuous, but any help would be wellcome.

    There is a keyboard handler on this site somewhere already. It works. You'll see lots of other code
    on other sites...it's bad. Trust me, I was looking for the same kinda code last month. Just use what's
    here.


  • archimedesarchimedes Member Posts: 31
    Here's the link:

    http://www.programmersheaven.com/search/Download.asp?FileID=770

    If that's bad, go to the upper right corner of this screen and search for Draeden.


  • AsmGuru62AsmGuru62 Member Posts: 6,519
    : Here's the link:
    :
    : http://www.programmersheaven.com/search/Download.asp?FileID=770
    :
    : If that's bad, go to the upper right corner of this screen and search for Draeden.
    :
    :
    There is a file INT9.ZIP somewhere on this site. It is written in "C". I made it in Asm and it works fine. I will send you the code...


  • JulienJulien Member Posts: 13
    : Here's the link:
    :
    : http://www.programmersheaven.com/search/Download.asp?FileID=770
    :
    : If that's bad, go to the upper right corner of this screen and search for Draeden.
    :
    :

    Thank you for your accurate explanations.

Sign In or Register to comment.