Re: How interrupts work (x86 vs. C64)



Bjarni Juliusson wrote:
Some time ago I used interrupts at Commodore C-64. When I preset address
of system interrupt (as I know there was only one interrupt available)
to my code (which ended with jump to original address of interrupt) the
result was, that my code was repeated continuously (~60 times pre
second, in other 'thread'). The interrupts at x86 seem to work
differently. How do they work, and how to 'emulate' behavior of
interrupt from C64 ?

There is a table in memory with pointers to a number of interrupt routines to be called when the different interrupts occur. In real mode, this table is at address 0, but in protected mode it can be located anywhere and you set a register pointing to it.

I've read that (but not tried to) even in real mode you can have the IVT anywhere in memory by setting its address using LIDT, just as in PMode...

JJ

.



Relevant Pages

  • Re: Back to real mode from pmode (LIDT and PIC remap)
    ... In this case does your protected mode device driver ... get the IRQ or does the real mode handler try to deal with it? ... and you can't mask the IRQs (you'll lose IRQs that ... Disabling interrupt is also absolutely necessary in ...
    (comp.lang.asm.x86)
  • Re: Back to real mode from pmode (LIDT and PIC remap)
    ... In this case does your protected mode device driver ... get the IRQ or does the real mode handler try to deal with it? ... and you can't mask the IRQs (you'll lose IRQs that ... Disabling interrupt is also absolutely necessary in ...
    (comp.lang.asm.x86)
  • usb keyboard vs btx: an SMI theory
    ... rret_tramp, to enter real mode, execute an interrupt handler and exit ... when a hardware interrupt happens while in protected mode. ... Now lets look at the other end - "USB legacy support". ... emulates PS/2 keyboard for real USB keyboard in the following way. ...
    (freebsd-hackers)
  • Re: Seeing VERSIONINFO under Vista?
    ... The reasoning, of course, from the CPU designers' POV was that if you were ... and would not /need/ to go back to real mode except for a full ... processor reset, it started up in real mode. ... invalid address and then cause an interrupt the CPU then causes another ...
    (microsoft.public.vc.mfc)
  • Re: Back to real mode from pmode (LIDT and PIC remap)
    ... That way you don't have to switch back to real mode, ... get the IRQ or does the real mode handler try to deal with it? ... Disabling interrupt is also absolutely necessary in ...
    (comp.lang.asm.x86)