Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

interrupt vector

Status
Not open for further replies.

elfanddot

Programmer
Feb 21, 2002
28
0
0
US
I don't mean to be a nucence!
I realize that the last question about interrupts is impossible, after a little reading up on interrupts.
This one, i hope, should be possible. How would i go about finding the interrupt vector inside the interrupt handler.
The handler is going to be calling functions handling data in multiple structures based on IRQ's and to save space i need only one set of these functions handled by multiple interrupts. Any help is apprectiated.
 
You can't, not reliably anyway.

Since you're doing IRQ's you CAN ask the PIC what IRQ's he's still handling... but if he's handling multiple IRQ's at the same time, it can be difficult to say WHICH IRQ got you called. While it's likely to work that way, I wouldn't trust my program to run reliably on that.

What you do is to set several dummy int handlers:

IRQ01handler proc
mov IRQnum,01
jump realIRQhandler
IRQ01handler endp

IRQ02handler proc
mov IRQnum,02
jump realIRQhandler
IRQ02handler endp

IRQ03handler proc
mov IRQnum,03
jump realIRQhandler
IRQ03handler endp

realIRQhandler proc
mov esi, IRQnum
;do whatever....
iret
realIRQhandler endp


...and of course set each dummy handler to the proper interrupt vector. "Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
perfect,
that will work and i think i can retain it in the class structure.
my next move was going to be write duplicate header files w/ each member named diferently like a_... or b_... . which would have consumed memory, time, processor, etc.
thank you

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top